/* Font Import */
/* Font Import Moved to HTML Head for Performance */

:root {
    /* Default is Dark Mode (Black & Gold) */
    --bg-color: #050505;
    /* Deep Black BG */
    --surface-color: #0e0e0e;
    /* Card Surface */
    --primary-color: #0A0A0A;
    /* Semantic: Main Elements */
    --secondary-color: #1a1a1a;
    /* Semantic: Secondary elements */
    --accent-color: #BF9B30;
    /* Gold */
    --text-color: #e2e8f0;
    /* Light Text */
    --heading-color: #BF9B30;
    /* Gold Headings */
    --text-muted: #94a3b8;

    --navbar-bg: rgba(10, 10, 10, 0.95);

    --btn-primary-bg: #BF9B30;
    /* Gold Button for Dark Mode */
    --btn-primary-text: #050505;

    --white: #ffffff;
    --border-radius: 4px;
    --transition: 0.3s ease;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --border-gold: 1px solid rgba(191, 155, 48, 0.3);
    --input-bg: #2a2a2a;
    --input-border: #444;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Tajawal', sans-serif;
    /* direction: rtl;  <- Removed to allow html[dir] to control it */
    /* text-align: right; <- Removed */
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
    border: none;
    text-align: center;
}

.btn-primary {
    background-color: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    border: 1px solid var(--btn-primary-bg);
}

.btn-primary:hover {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: var(--white);
}

.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--text-color);
    color: var(--text-color);
}

.btn-secondary:hover {
    background-color: var(--text-color);
    color: var(--bg-color);
}

/* Navbar */
.navbar {
    background-color: var(--navbar-bg);
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 0 rgba(191, 155, 48, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 15px 0;
    border-bottom: 1px solid var(--secondary-color);
    direction: rtl;
    /* Force Navbar to stay RTL */
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    gap: 20px;
}

.logo img {
    height: 75px;
    width: 75px;
    object-fit: contain;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    padding: 0;
    border-radius: 4px;
    /* Subtle radius */
    /* Removed background-color and border */
    transition: var(--transition);
}

.logo img:hover {
    transform: scale(1.02);
    box-shadow: 0 0 15px rgba(191, 155, 48, 0.4);
}

/* FOUC Prevention: Hide both navbar states by default */
.nav-guest,
.nav-user {
    display: none;
}

/* Show guest navbar when HTML has auth-guest class */
html.auth-known.auth-guest .nav-guest {
    display: flex;
    align-items: center;
}

/* Show user navbar when HTML has auth-user class */
html.auth-known.auth-user .nav-user {
    display: flex;
    align-items: center;
}

/* Fallback: if JavaScript fails, show guest navbar */
html:not(.auth-known) .nav-guest {
    display: flex;
    align-items: center;
}

.nav-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-links a {
    color: var(--text-color);
    font-weight: 500;
    position: relative;
}

.nav-links a:hover {
    color: var(--accent-color);
}

.btn-login {
    background-color: var(--accent-color);
    color: var(--primary-color);
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 600;
    transition: var(--transition);
    border: 2px solid var(--accent-color);
}

.btn-login:hover {
    background-color: transparent;
    color: var(--accent-color);
    transform: scale(1.05);
}

/* User Menu (Authenticated) */
.user-menu {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.03);
    padding: 6px 15px;
    border-radius: 30px;
    border: 1px solid var(--secondary-color);
    margin-left: 15px;
}

.user-name {
    color: var(--accent-color);
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-logout {
    background: transparent;
    border: 1px solid var(--secondary-color);
    color: var(--text-muted);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
}

.btn-logout:hover {
    border-color: #ef4444;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.btn-dashboard {
    background-color: var(--accent-color);
    color: var(--primary-color);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    border: 1px solid var(--accent-color);
}

.btn-dashboard:hover {
    background-color: transparent;
    color: var(--accent-color);
}


.lang-toggle {
    background: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 5px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    margin-inline-end: 15px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
}

.lang-toggle:hover {
    background-color: var(--accent-color);
    color: var(--primary-color);
}

.lang-icon {
    font-size: 1.2rem;
    /* Grid globe effect simulation */
    background: radial-gradient(circle, transparent 60%, currentColor 62%);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: inline-block;
    border: 1px solid currentColor;
    position: relative;
    overflow: hidden;
}

.lang-icon::before,
.lang-icon::after {
    content: '◆';
    position: absolute;
    border: 1px solid currentColor;
    border-radius: 50%;
}

.lang-icon::before {
    width: 100%;
    height: 40%;
    top: 30%;
    left: 0;
    border: none;
    border-top: 1px solid currentColor;
    border-bottom: 1px solid currentColor;
}

.lang-icon::after {
    width: 40%;
    height: 100%;
    left: 30%;
    top: 0;
    border: none;
    border-left: 1px solid currentColor;
    border-right: 1px solid currentColor;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
    position: relative;
    /* order: -1; Removed to keep Logo on Right (RTL default) */
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    transition: var(--transition);
    border-radius: 2px;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Header / Hero */
.hero {
    background-color: var(--surface-color);
    /* Use surface instead of raw black */
    color: var(--text-color);
    padding: 80px 0;
    text-align: center;
    border-bottom: 3px solid var(--accent-color);
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: var(--accent-color);
}

.hero p {
    font-size: 1.1rem;
    max-width: 700px;
    margin: 0 auto 30px;
}

/* Sections General */
section {
    padding: 60px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2rem;
    color: var(--heading-color);
}

/* About Section */
.about-section {
    background-color: var(--surface-color);
    border-top: 3px solid var(--accent-color);
    border-bottom: 3px solid var(--accent-color);
}

.about-section p {
    color: var(--text-color);
}

/* Services Section */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.service-card {
    background-color: var(--surface-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--secondary-color);
}

.service-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
}

.service-card img {
    width: 100%;
    height: 250px;
    /* Fixed height for consistency */
    object-fit: contain;
    display: block;
    background-color: transparent;
    padding: 15px;
    /* Add some padding so it doesn't touch edges */
}

.card-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-content h3 {
    margin-bottom: 10px;
    color: var(--accent-color);
}

.card-content p {
    margin-bottom: 20px;
    flex-grow: 1;
}

.card-actions {
    display: flex;
    gap: 10px;
}

.card-actions .btn {
    flex: 1;
    font-size: 0.9rem;
}

.card-content ul {
    flex-grow: 1;
    margin-bottom: 20px;
}

.btn-sm {
    padding: 5px 15px;
    font-size: 0.9rem;
    width: fit-content;
    margin-top: auto;
    align-self: center;
    /* Fallback if flex-grow fails or for explicit spacing */
}

/* Contact Info Section */
.contact-info-section {
    background-color: var(--secondary-color);
    color: var(--text-color);
    /* Updated from var(--white) to adapt */
    text-align: center;
}

.contact-info-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.contact-info-list a {
    color: var(--accent-color);
}

/* Footer */
footer {
    background-color: #0f172a;
    color: #94a3b8;
    text-align: center;
    padding: 20px 0;
    border-top: 1px solid #1e293b;
    font-size: 0.9rem;
}

/* Project Pages */
.project-details {
    background-color: var(--surface-color);
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: var(--border-gold);
}

.project-section {
    margin-bottom: 30px;
}

.project-section h2 {
    color: var(--accent-color);
    margin-bottom: 15px;
    border-bottom: 1px solid var(--secondary-color);
    display: inline-block;
    padding-bottom: 5px;
}

/* Contact Form Page */
.contact-form-container {
    max-width: 600px;
    margin: 0 auto;
    background-color: var(--surface-color);
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: var(--border-gold);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--input-border);
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
    background-color: var(--input-bg);
    color: var(--text-color);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(191, 155, 48, 0.2);
}

.form-group textarea {
    height: 120px;
    resize: vertical;
}

/* Appointment Booking Styles */
.form-hint {
    display: block;
    margin-top: 5px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Calendar Header */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: var(--surface-color);
    border: 1px solid var(--input-border);
    border-radius: 8px 8px 0 0;
    margin-top: 15px;
}

.calendar-month-year {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent-color);
}

.calendar-nav-btn {
    background-color: transparent;
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.calendar-nav-btn:hover {
    background-color: var(--accent-color);
    color: var(--primary-color);
    transform: scale(1.1);
}

.calendar-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Visual Calendar Styles */
.calendar-container {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    padding: 15px;
    background-color: rgba(191, 155, 48, 0.05);
    border-radius: 0 0 8px 8px;
    border: 1px solid var(--input-border);
    border-top: none;
}

.calendar-day-header {
    padding: 10px 5px;
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--accent-color);
    background-color: var(--surface-color);
    border-radius: 4px;
}

.calendar-day {
    padding: 15px;
    border: 2px solid var(--input-border);
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background-color: var(--input-bg);
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-height: 60px;
    justify-content: center;
}

.calendar-day.empty {
    border: none;
    background: transparent;
    cursor: default;
}

.calendar-day:hover:not(.disabled):not(.selected) {
    border-color: var(--accent-color);
    background-color: rgba(191, 155, 48, 0.1);
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(191, 155, 48, 0.2);
}

.calendar-day.selected {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: var(--primary-color);
    font-weight: 600;
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(191, 155, 48, 0.3);
}

.calendar-day.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background-color: var(--secondary-color);
}

.calendar-day-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-color);
}

.calendar-day.selected .calendar-day-name {
    color: var(--primary-color);
}

.calendar-day-date {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

.calendar-day-month {
    font-size: 0.75rem;
    opacity: 0.8;
}

.time-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.time-slot {
    padding: 12px;
    border: 2px solid var(--input-border);
    border-radius: var(--border-radius);
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background-color: var(--input-bg);
    color: var(--text-color);
    font-weight: 500;
}

.time-slot:hover:not(.disabled):not(.selected) {
    border-color: var(--accent-color);
    background-color: rgba(191, 155, 48, 0.1);
    transform: translateY(-2px);
}

.time-slot.selected {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: var(--primary-color);
    font-weight: 600;
}

.time-slot.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background-color: var(--secondary-color);
}

.time-slot.booked {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: var(--secondary-color);
    text-decoration: line-through;
}

.success-message {
    background-color: #d1fae5;
    color: #065f46;
    padding: 15px;
    border-radius: var(--border-radius);
    margin-top: 20px;
    text-align: center;
    display: none;
    /* Hidden by default */
    border-left: 4px solid #10b981;
    font-weight: 500;
}

.error-message {
    background-color: #fee2e2;
    color: #991b1b;
    padding: 15px;
    border-radius: var(--border-radius);
    margin-top: 20px;
    text-align: center;
    display: none;
    /* Hidden by default */
    border-left: 4px solid #ef4444;
    font-weight: 500;
}


/* Responsive */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .navbar .container {
        position: relative;
    }

    .nav-links {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        background-color: var(--primary-color);
        flex-direction: column;
        padding: 20px;
        transition: left 0.3s ease;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
        z-index: 1000;
    }

    .nav-links.active {
        left: 0;
    }

    .nav-links a,
    .nav-links .lang-toggle {
        width: 100%;
        text-align: center;
        padding: 15px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-links .btn-login {
        margin-top: 10px;
    }

    /* Hide decorative side images on mobile */
    .hero img[style*="position: absolute"] {
        display: none !important;
    }

    .about-section img[style*="position: absolute"] {
        display: none !important;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    /* Calendar Mobile Optimization */
    .calendar-container {
        padding: 5px !important;
        gap: 4px !important;
        max-width: 100% !important;
        margin: 10px 0 !important;
    }

    .calendar-header {
        padding: 6px !important;
        font-size: 0.85rem !important;
    }

    .calendar-month-year {
        font-size: 0.9rem !important;
    }

    .calendar-header button {
        width: 28px !important;
        height: 28px !important;
        font-size: 0.9rem !important;
    }

    .calendar-day-header {
        padding: 5px 2px !important;
        font-size: 0.65rem !important;
    }

    .calendar-day {
        min-height: 30px !important;
        max-height: 30px !important;
        padding: 3px 1px !important;
        gap: 1px !important;
        font-size: 0.7rem !important;
        border-width: 1px !important;
    }

    .calendar-day-name {
        font-size: 0.55rem !important;
        display: none;
        /* Hide day names on mobile to save space */
    }

    .calendar-day-date {
        font-size: 0.85rem !important;
        font-weight: 600 !important;
    }

    .calendar-day-month {
        font-size: 0.55rem !important;
        display: none;
        /* Hide month on mobile */
    }

    .time-slots-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 6px !important;
        margin-top: 10px !important;
    }

    .time-slot {
        padding: 8px 4px !important;
        font-size: 0.8rem !important;
    }

}

/* ============================================
   AUTHENTICATION PAGES STYLES
   ============================================ */

.auth-section {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    padding: 60px 0;
    background: linear-gradient(135deg, var(--bg-color) 0%, var(--surface-color) 100%);
}

.auth-container {
    max-width: 500px;
    margin: 0 auto;
    background-color: var(--surface-color);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    border: var(--border-gold);
    overflow: hidden;
    position: relative;
}

.auth-form-wrapper {
    padding: 40px;
    animation: fadeIn 0.5s ease;
}

.auth-form-wrapper.hidden {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h2 {
    color: var(--accent-color);
    font-size: 2rem;
    margin-bottom: 10px;
}

.auth-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.auth-form .form-group {
    margin-bottom: 20px;
}

.auth-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    right: 15px;
    font-size: 1.2rem;
    pointer-events: none;
    z-index: 1;
}

[dir="ltr"] .input-icon {
    left: 15px;
    right: auto;
}

.input-with-icon input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: 1px solid var(--input-border);
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
    background-color: var(--input-bg);
    color: var(--text-color);
}

[dir="ltr"] .input-with-icon input {
    padding: 12px 15px 12px 45px;
}

.input-with-icon input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(191, 155, 48, 0.1);
}

.toggle-password {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: var(--text-color);
    opacity: 0.6;
    transition: var(--transition);
    z-index: 2;
}

[dir="ltr"] .toggle-password {
    right: 15px;
    left: auto;
}

.toggle-password:hover {
    opacity: 1;
}

/* Simple Eye Icon using CSS */
.eye-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    position: relative;
}

.eye-icon::before {
    content: '◆';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 18px;
    height: 12px;
    border: 2px solid currentColor;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
}

.eye-icon::after {
    content: '◆';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background-color: currentColor;
    border-radius: 50%;
}

/* Closed eye (when password is visible) */
.toggle-password.active .eye-icon::before {
    height: 2px;
    border-radius: 0;
    border-left: none;
    border-right: none;
}

.toggle-password.active .eye-icon::after {
    display: none;
}

.password-hint {
    display: block;
    margin-top: 5px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    font-size: 0.9rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text-color);
}

.remember-me input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent-color);
}

.forgot-password-link {
    color: var(--accent-color);
    text-decoration: none;
    transition: var(--transition);
}

.forgot-password-link:hover {
    text-decoration: underline;
}

.terms-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    color: var(--text-color);
    font-size: 0.9rem;
}

.terms-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: var(--accent-color);
    flex-shrink: 0;
}

.btn-auth {
    width: 100%;
    padding: 14px;
    font-size: 1.05rem;
    font-weight: 600;
    margin-top: 10px;
    transition: var(--transition);
}

.btn-auth:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(191, 155, 48, 0.3);
}

.auth-divider {
    text-align: center;
    margin: 25px 0;
    position: relative;
}

.auth-divider::before {
    content: '◆';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background-color: var(--input-border);
}

.auth-divider span {
    background-color: var(--surface-color);
    padding: 0 15px;
    position: relative;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.auth-switch {
    text-align: center;
    color: var(--text-color);
    font-size: 0.95rem;
}

.switch-form-link {
    color: var(--accent-color);
    font-weight: 600;
    text-decoration: none;
    margin-right: 5px;
    transition: var(--transition);
}

.switch-form-link:hover {
    text-decoration: underline;
}

.auth-message {
    padding: 15px;
    border-radius: var(--border-radius);
    margin-top: 20px;
    text-align: center;
    display: none;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-message.show {
    display: block;
}

.success-message {
    background-color: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10b981;
}

.error-message {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

/* Responsive for Auth Pages */
@media (max-width: 768px) {
    .auth-container {
        margin: 0 15px;
    }

    .auth-form-wrapper {
        padding: 30px 20px;
    }

    .auth-header h2 {
        font-size: 1.6rem;
    }

    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* ============================================
   CUSTOM NOTIFICATION SYSTEM (TOASTS)
   ============================================ */

.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

[dir="rtl"] .notification-container {
    right: auto;
    left: 20px;
}

.toast {
    background-color: var(--surface-color);
    color: var(--text-color);
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--accent-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 500px;
    pointer-events: auto;
    animation: toastSlideInLTR 0.3s ease forwards;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-grow: 1;
}

.toast-action-btn {
    background: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: var(--transition);
    white-space: nowrap;
    margin-inline-start: 8px;
}

.toast-action-btn:hover {
    background-color: var(--accent-color);
    color: var(--primary-color);
}

[dir="rtl"] .toast {
    animation: toastSlideInRTL 0.3s ease forwards;
}

.toast.removing {
    animation: toastSlideOutLTR 0.3s ease forwards;
}

[dir="rtl"] .toast.removing {
    animation: toastSlideOutRTL 0.3s ease forwards;
}

@keyframes toastSlideInLTR {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastSlideInRTL {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastSlideOutLTR {
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes toastSlideOutRTL {
    to {
        transform: translateX(-100%);
        opacity: 0;
    }
}

.toast-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.toast-message {
    flex-grow: 1;
    font-size: 0.95rem;
    font-weight: 500;
}

.toast.success {
    border-color: #10b981;
}

.toast.success .toast-icon {
    color: #10b981;
}

.toast.error {
    border-color: #ef4444;
}

.toast.error .toast-icon {
    color: #ef4444;
}

.toast.warning {
    border-color: var(--accent-color);
}

.toast.warning .toast-icon {
    color: var(--accent-color);
}

@media (max-width: 480px) {
    .notification-container {
        top: 10px;
        right: 10px;
        left: 10px;
        width: calc(100% - 20px);
        max-width: 100%;
    }

    [dir="rtl"] .notification-container {
        right: 10px;
        left: 10px;
    }

    .toast {
        min-width: auto;
        width: 100%;
        max-width: 100%;
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    .toast-message {
        font-size: 0.85rem;
        line-height: 1.3;
    }

    .toast-icon {
        font-size: 1.2rem;
    }

    .toast-action-btn {
        padding: 3px 8px;
        font-size: 0.75rem;
    }
}

/* --- Modal Styles --- */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: block;
    opacity: 1;
}

.modal-content {
    background-color: var(--surface-color);
    margin: 5% auto;
    padding: 0;
    border: 1px solid var(--accent-color);
    width: 90%;
    max-width: 800px;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    position: relative;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
    animation: slideDown 0.4s ease forwards;
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-body {
    padding: 2rem;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-section {
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 1rem;
}

.modal-section:last-child {
    border-bottom: none;
}

.modal-section h3 {
    color: var(--accent-color);
    margin-bottom: 1rem;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-section ul {
    list-style-type: none;
    padding-right: 1rem;
    /* RTL support */
}

.modal-section ul li {
    margin-bottom: 0.5rem;
    position: relative;
}

.modal-section ul li::before {
    content: '◆';
    color: var(--accent-color);
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
}

.close-btn {
    color: var(--text-color);
    float: left;
    /* RTL: left is the closing side */
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
    position: absolute;
    top: 15px;
    left: 20px;
    z-index: 10;
}

.close-btn:hover,
.close-btn:focus {
    color: var(--accent-color);
    text-decoration: none;
    cursor: pointer;
}

.project-summary {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-muted);
}

.key-points li strong {
    color: var(--text-color);
}


/* Custom Scrollbar for Modal (Gold/Rustic) */
.modal-body::-webkit-scrollbar {
    width: 10px;
}

.modal-body::-webkit-scrollbar-track {
    background: var(--surface-color);
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 4px;
    border: 2px solid var(--surface-color);
    /* Creates padding effect */
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #d4af37;
    /* Lighter gold on hover */
}

/* Fix Bullet Point Overlap for RTL */
.modal-section ul {
    list-style-type: none;
    padding-right: 1.5rem;
    /* Increased padding */
    margin-right: 0;
}

.modal-section ul li {
    margin-bottom: 1rem;
    position: relative;
    padding-right: 1.5rem;
    /* Use padding instead of negative margins for bullet */
}

.modal-section ul li::before {
    content: '◆';
    color: var(--accent-color);
    font-weight: bold;
    display: inline-block;
    position: absolute;
    right: 0;
    /* Align to right edge of padded area */
    top: 0;
    width: 1em;
    margin-left: 0;
}



/* LTR Support for Modals */
[lang='en'] .modal-section ul {
    direction: ltr;
    text-align: left;
    padding-right: 0;
    padding-left: 1rem;
    margin-right: 0;
    margin-left: 0;
}

[lang='en'] .modal-section ul li {
    direction: ltr;
    text-align: left;
    padding-right: 0;
    padding-left: 1.5rem;
}

[lang='en'] .modal-section ul li::before {
    right: auto;
    left: 0;
}

/* Auth & Navbar Visibility */
html.auth-guest .nav-user {
    display: none !important;
}

html.auth-guest .nav-guest {
    display: block !important;
}

html.auth-user .nav-guest {
    display: none !important;
}

html.auth-user .nav-user {
    display: block !important;
}

/* Dashboard Button Visibility */
html.auth-admin #nav-dashboard-link {
    display: inline-block !important;
}

html:not(.auth-admin) #nav-dashboard-link {
    display: none !important;
}

/* Custom Scrollbar Styles (Gold & Black) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #050505;
}

::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #d4a017;
}

/* Ensure modals use the custom scrollbar style */
.modal-content,
.project-details,
.table-container {
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) #050505;
}