/* assets/style.css */
@import url('https://fonts.googleapis.com/css2?family=Noto+Kufi+Arabic:wght@400;700&display=swap');
/* FontAwesome CDN will be included in HTML head, but we style here */

:root {
    --bg-color: #121212;
    --card-bg: rgba(30, 30, 30, 0.8);
    --primary-color: #007bff;
    --text-color: #ffffff;
    --text-muted: #aaaaaa;
    --border-radius: 12px;
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
}

body.light-mode {
    --bg-color: #f4f7f6;
    --card-bg: #ffffff;
    --primary-color: #007bff;
    --text-color: #333333;
    --text-muted: #666666;
    --glass-border: 1px solid rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Noto Kufi Arabic', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    direction: rtl;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s, color 0.3s;
}

/* Glassmorphism Logins */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-grow: 1;
    padding: 20px;
}

.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: var(--glass-border);
    border-radius: var(--border-radius);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.glass-card h2 {
    margin-bottom: 20px;
    color: var(--primary-color);
}

.form-group {
    margin-bottom: 15px;
    text-align: right;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 12px;
    background: rgba(128, 128, 128, 0.1);
    border: 1px solid rgba(128, 128, 128, 0.2);
    border-radius: 8px;
    color: var(--text-color);
    font-family: 'Noto Kufi Arabic', sans-serif;
    transition: border 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(128, 128, 128, 0.15);
}

.btn {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-family: 'Noto Kufi Arabic', sans-serif;
    transition: background 0.3s, transform 0.2s;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.btn:hover {
    background: #0056b3;
    transform: translateY(-2px);
}

/* Alert Messages */
.alert {
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 8px;
    text-align: center;
    font-weight: bold;
}

.alert-danger {
    background: rgba(220, 53, 69, 0.2);
    color: #ff6b6b;
    border: 1px solid #dc3545;
}

.alert-success {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
    border: 1px solid #28a745;
}

/* Dashboard Layout */
.navbar {
    background: var(--card-bg);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

/* Global link style */
a {
    text-decoration: none !important;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    margin-left: 20px;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.nav-active {
    color: var(--primary-color) !important;
    position: relative;
}

/* Removed underline after effect */

.message a {
    color: inherit;
    text-decoration: none !important;
    /* Force no underline */
    border-bottom: 1px dotted rgba(255, 255, 255, 0.5);
    /* Optional: subtle dot if needed, else remove */
}

.post-content a {
    color: var(--primary-color);
    text-decoration: none !important;
}

.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 15px;
    width: 100%;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
}

.card {
    background: var(--card-bg);
    border: var(--glass-border);
    border-radius: var(--border-radius);
    padding: 25px;
    transition: transform 0.3s;
}

.card:hover {
    transform: translateY(-5px);
}

.badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
}

.badge-new {
    background: #28a745;
    color: white;
}

.badge-updated {
    background: #ffc107;
    color: black;
}

/* Chat Styles */
.chat-box {
    height: 500px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.1);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(128, 128, 128, 0.1);
}

.message {
    margin-bottom: 15px;
    padding: 15px;
    border-radius: 15px;
    max-width: 85%;
    position: relative;
    word-wrap: break-word;
}

.message.user {
    background: var(--primary-color);
    color: white;
    align-self: flex-start;
    /* RTL right */
    border-top-right-radius: 2px;
}

.message.other {
    background: #3a3a3a;
    color: white;
    align-self: flex-end;
    /* RTL left */
    border-top-left-radius: 2px;
}

body.light-mode .message.other {
    background: #e9ecef;
    color: #333;
}

.message a {
    color: inherit;
    text-decoration: none !important;
}

/* Post/Content Styles */
.post-content img {
    max-width: 100%;
    border-radius: 8px;
    margin: 10px 0;
}

.chat-media {
    max-width: 200px;
    max-height: 150px;
    border-radius: 8px;
    cursor: pointer;
    display: block;
    margin-top: 5px;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.2s;
}

.chat-media:hover {
    transform: scale(1.05);
}

.chat-media {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

/* Lightbox */
#lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    cursor: zoom-out;
}

#lightbox img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 5px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.post-media {
    width: 100%;
    height: 200px;
    /* Fixed height for consistency in grid */
    object-fit: cover;
    /* Crop to fit */
    border-radius: 8px;
}

.post-content a {
    color: var(--primary-color);
}

/* Admin Editor Overrides */
.note-editor.note-frame {
    border: 1px solid rgba(128, 128, 128, 0.2) !important;
}

.note-editor .note-toolbar {
    background: var(--card-bg) !important;
    border-bottom: 1px solid rgba(128, 128, 128, 0.2) !important;
}

.note-editor .note-editing-area .note-editable {
    background: var(--bg-color) !important;
    color: var(--text-color) !important;
}

.note-btn {
    color: var(--text-color) !important;
    background: transparent !important;
}

/* Toast Notification Animation */
@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}