/* site.css - Refactored to use semantic theme variables only */
:root {
    /* Font definitions only */
    --font-latin: "Inter", sans-serif;
    --font-arabic: "Tajawal", sans-serif;
    /* Additional theme variables for navbar compatibility */
    --color-text-topnav: var(--color-text);
    /* RTL/LTR variables */
    /*    --start : left;
    --end : right;*/
    --transform-direction: 1;
    --topnav-height: 64px;
    --sidebar-width: 280px;
    --z-overlay: 1085;
    --z-sidebar: 1090;
}

[data-theme="dark"] {
    --color-text-topnav: var(--color-text);
}

[dir="rtl"] {
    --start: right;
    --end: left;
    --transform-direction: -1;
}

/* 1. Base font sizing */
html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

/* 2. Box-sizing & full-height layout */
html {
    box-sizing: border-box;
    height: 100%;
    position: relative;
    min-height: 100%;
}

*, *::before, *::after {
    box-sizing: inherit;
}

/* 3. Body & main layout */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0 0 60px; /* footer offset */
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-latin);
}

html[dir="rtl"] body {
    font-family: var(--font-arabic);
}

main {
    flex: 1;
}

/* 4. Responsive images & media */
img, picture, video, canvas, svg {
    max-width: 100%;
    height: auto;
}

/* 5. Focus styles */
.btn:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem var(--color-bg-content), 0 0 0 0.25rem var(--color-primary);
}

/* 6. Document direction */
html[dir="rtl"] {
    direction: rtl;
}

html[dir="ltr"] {
    direction: ltr;
}

/* 7. Typography for Arabic */
html[dir="rtl"] {
    font-family: var(--font-arabic);
    font-weight: 400;
}

/* 8. Floating-label placeholders */
.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--color-text-secondary);
}

/* LTR placeholders */
html[dir="ltr"] .form-floating > .form-control-plaintext::placeholder,
html[dir="ltr"] .form-floating > .form-control::placeholder {
    text-align: start;
}

html[dir="ltr"] .form-floating > .form-control-plaintext:focus::placeholder,
html[dir="ltr"] .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* RTL placeholders */
html[dir="rtl"] .form-floating > .form-control-plaintext::placeholder,
html[dir="rtl"] .form-floating > .form-control::placeholder {
    text-align: end;
}

html[dir="rtl"] .form-floating > .form-control-plaintext:focus::placeholder,
html[dir="rtl"] .form-floating > .form-control:focus::placeholder {
    text-align: end;
}

/* Navbar dropdown adjustments */
.navbar .dropdown-menu {
    z-index: 1080;
    min-width: 12rem;
}

/* 9. Navbar improvements */
.navbar-brand {
    display: flex;
    align-items: center;
    color: var(--color-primary) !important;
    font-weight: 600;
    font-size: 1rem;
}

.navbar {
    background-color: var(--color-bg-topnav);
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text-topnav);
    box-shadow: 0 1px 2px var(--shadow-light);
    padding: 0.5rem 0;
}

    .navbar .nav-link {
        color: var(--color-text) !important;
        transition: color 0.15s ease;
        font-weight: 500;
        padding: 0.5rem 0.75rem;
        border-radius: 6px;
        min-height: 36px; /* Ensure minimum touch target size */
        display: flex;
        align-items: center;
    }

        .navbar .nav-link:hover {
            color: var(--color-primary) !important;
            background-color: var(--color-primary-light);
        }

        .navbar .nav-link.active {
            color: var(--color-primary) !important;
            font-weight: 600;
            background-color: var(--color-primary-light);
        }

    .navbar .navbar-brand:hover {
        color: var(--color-primary-hover) !important;
        transition: color 0.15s ease;
    }

/* Force proper RTL/LTR navbar layout */
html[dir="rtl"] .navbar-collapse {
    direction: rtl;
}

html[dir="ltr"] .navbar-collapse {
    direction: ltr;
}

/* Navbar item spacing */
.navbar-nav .nav-item {
    margin: 0 0.5rem;
}

html[dir="rtl"] .navbar-nav .nav-item {
    margin: 0 0.5rem;
}

/* Fix navbar auto margins for RTL */
html[dir="rtl"] .navbar-nav.ms-auto {
    margin-inline-start: auto !important;
    margin-inline-end: 0 !important;
}

html[dir="ltr"] .navbar-nav.ms-auto {
    margin-inline-start: auto !important;
    margin-inline-end: 0 !important;
}

.navbar .navbar-collapse {
    overflow: visible;
}

.navbar .dropdown-menu {
    z-index: var(--z-dropdown, 1080);
    min-width: 12rem;
    box-shadow: var(--shadow-md, 0 4px 10px rgba(0,0,0,.1));
}

/* 10. Navbar mobile collapse */
@media (max-width: 991px) {
    .navbar-nav {
        flex-direction: column;
        width: 100%;
        background-color: var(--color-bg-content);
        border-radius: 6px;
        margin-top: 0.5rem;
        padding: 0.5rem;
        box-shadow: 0 2px 4px var(--shadow-light);
    }

        .navbar-nav .nav-item {
            width: 100%;
            margin: 0.125rem 0;
        }

        .navbar-nav .nav-link {
            padding: 0.5rem 0.75rem;
            border-radius: 4px;
            min-height: 36px; /* Ensure minimum touch target size */
        }

    /* RTL mobile nav adjustments */
    html[dir="rtl"] .navbar-nav {
        text-align: right;
    }

        html[dir="rtl"] .navbar-nav .nav-link {
            text-align: right;
            padding-inline-end: 0.75rem;
        }

    html[dir="ltr"] .navbar-nav {
        text-align: left;
    }

        html[dir="ltr"] .navbar-nav .nav-link {
            text-align: left;
            padding-inline-start: 0.75rem;
        }
}

/* 11. Language-switch buttons */
.lang-switcher {
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 2px var(--shadow-medium);
}

    .lang-switcher .btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
        border-radius: 0;
        border: 1px solid var(--color-border);
        color: var(--color-text-secondary);
        background-color: var(--color-bg-content);
        font-weight: 500;
        transition: all 0.15s ease;
        min-height: 36px; /* Ensure minimum touch target size */
    }

        .lang-switcher .btn:hover {
            background-color: var(--color-surface);
            color: var(--color-text);
        }

        .lang-switcher .btn.active {
            background-color: var(--color-primary);
            border-color: var(--color-primary);
            color: white;
        }

            .lang-switcher .btn.active:hover {
                background-color: var(--color-primary-dark);
            }

        .lang-switcher .btn:not(:last-child) {
            border-inline-end: none;
        }

html[dir="rtl"] .lang-switcher .btn:not(:last-child) {
    border-inline-start: none;
    border-inline-end: 1px solid var(--color-border);
}

html[dir="rtl"] .lang-switcher .btn:not(:first-child) {
    border-inline-end: none;
}

/* Language switcher in mobile */
@media (max-width: 991px) {
    .lang-switcher {
        margin-top: 1rem;
        justify-content: center;
    }

        .lang-switcher .btn {
            flex: 1;
            max-width: 120px;
            min-height: 36px; /* Ensure minimum touch target size */
        }
}

/* ===== LANGUAGE SWITCHER ===== */
.lang-switcher {
    display: flex;
    background: var(--color-surface);
    border-radius: 6px;
    padding: 2px;
    gap: 2px;
    box-shadow: var(--box-shadow-light);
    border: 1px solid var(--color-border);
}

.lang-btn {
    background: transparent;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text);
    font-weight: 500;
}

    .lang-btn:hover {
        background: var(--color-primary-light);
        color: var(--color-primary);
    }

    .lang-btn.active {
        background: var(--color-primary);
        color: white;
        box-shadow: var(--box-shadow);
    }

[dir="rtl"] .lang-switcher {
    flex-direction: row-reverse;
}

/* Responsive adjustments for language switcher */
@media (max-width: 575.98px) {
    .lang-btn {
        padding: 6px 12px;
        font-size: 13px;
        width: 70px;
    }
}


/* 12. Footer */
footer {
    padding: 1.25rem 0;
    background-color: var(--color-footer-bg);
    color: var(--color-footer-text);
    border-top: 1px solid var(--color-footer-border);
}

/* 13. Professional styling */
.card {
    background-color: var(--color-bg-content);
    border: 1px solid var(--color-border);
    box-shadow: 0 1px 3px var(--shadow-light);
    transition: box-shadow 0.15s ease;
    border-radius: 6px;
}

    .card:hover {
        box-shadow: 0 2px 6px var(--shadow-medium);
    }

.btn-primary {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: all 0.15s ease;
    min-height: 36px; /* Ensure minimum touch target size */
}

    .btn-primary:hover {
        background-color: var(--color-primary-hover);
        border-color: var(--color-primary-hover);
        transform: translateY(-1px);
        box-shadow: 0 2px 4px var(--shadow-medium);
    }

.btn-outline-primary {
    color: var(--color-primary);
    border-color: var(--color-primary);
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    min-height: 36px; /* Ensure minimum touch target size */
}

    .btn-outline-primary:hover {
        background-color: var(--color-primary);
        border-color: var(--color-primary);
    }

/* 14. Form improvements */
.form-control {
    border: 1px solid var(--color-border);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
}

    .form-control:focus {
        border-color: var(--color-primary);
        box-shadow: 0 0 0 0.125rem var(--color-primary-light);
    }

/* 15. Professional text styling */
h1, h2, h3, h4, h5, h6 {
    color: var(--color-border);
    font-weight: 600;
}

.text-professional {
    color: var(--color-text);
    line-height: 1.5;
}

.text-accent {
    color: var(--color-accent);
    font-weight: 600;
}

/* Responsive improvements for forms and buttons */
@media (max-width: 575.98px) {
    .form-control {
        padding: 0.375rem 0.625rem;
    }

    .btn {
        padding: 0.375rem 0.75rem;
        min-height: 36px; /* Ensure minimum touch target size */
    }

    .btn-sm {
        padding: 0.25rem 0.5rem;
        min-height: 32px; /* Ensure minimum touch target size */
    }
}


/* ===== HOME PAGE STYLES ===== */

/* Hero Section */
.hero-section {
    background: var(--gradient-primary);
    color: white;
    margin: 0;
    padding: 4rem 0;
}

.hero-logo {
    width: 100px;
    height: 100px;
    object-fit: contain;
    background: var(--color-glass);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 1rem;
    border: 2px solid var(--color-glass);
}

.stat-number {
    color: var(--color-accent);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
}

/* Services Section */
.services-section {
    background-color: var(--color-surface);
    margin: 0;
}

.service-card {
    background: var(--color-bg-content);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    transition: all 0.3s ease;
}

    .service-card:hover {
        transform: translateY(-5px);
        box-shadow: var(--box-shadow-lg);
        border-color: var(--color-primary);
    }

.service-icon {
    font-size: 3rem;
    color: var(--color-primary);
}

/* Why Section */
.why-section {
    background-color: var(--color-bg);
    margin: 0;
    color: var(--color-text);
}

    .why-section h2,
    .why-section h6 {
        color: var(--color-text);
    }

    .why-section .lead {
        color: var(--color-text-secondary);
    }

.stat-card {
    background: var(--color-bg-content);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    transition: all 0.3s ease;
}

    .stat-card:hover {
        transform: translateY(-3px);
        box-shadow: var(--box-shadow-md);
    }

    .stat-card h4 {
        color: var(--color-text);
    }

/* CTA Section */
.cta-section {
    background: var(--gradient-primary);
    margin: 0;
}

/* Button styles for theme compatibility */
.btn-outline-light {
    color: white;
    border-color: white;
}

    .btn-outline-light:hover {
        background-color: white;
        color: var(--color-primary);
        border-color: white;
    }

/* Ensure full-width sections */
body > section {
    width: 100%;
}

/* Fix margin issues from layout container */
main > section:first-child {
    margin-top: 0;
}

/* Dark theme specific adjustments */
[data-theme="dark"] .services-section {
    background-color: var(--color-surface);
}

[data-theme="dark"] .service-card,
[data-theme="dark"] .stat-card {
    background: var(--color-bg-content);
    border-color: var(--color-border);
}

[data-theme="dark"] .hero-logo {
    background: rgba(30, 41, 59, 0.4);
    border-color: rgba(148, 163, 184, 0.2);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2rem;
    }

    .stat-card {
        padding: 1.5rem !important;
    }

    .service-card {
        margin-bottom: 1rem;
    }
}

@media (max-width: 575.98px) {
    .hero-section {
        padding: 3rem 0;
    }

    .hero-logo {
        width: 80px;
        height: 80px;
    }

    .service-icon {
        font-size: 2.5rem;
    }

    .stat-card {
        padding: 1rem !important;
    }

        .stat-card i {
            font-size: 2rem;
        }
}

/* RTL Support */
[dir="rtl"] .service-card,
[dir="rtl"] .stat-card {
    text-align: right;
}

[dir="rtl"] .d-flex.align-items-start {
    text-align: right;
}

    [dir="rtl"] .d-flex.align-items-start i {
        margin-left: 1rem;
        margin-right: 0;
    }

/* Sidebar mobile offcanvas */
#appSidebar {
    width: var(--sidebar-width);
    height: calc(100vh - var(--topnav-height));
    position: fixed;
    top: var(--topnav-height);
    inset-inline-start: 0;
    transform: translateX(-100%);
    transition: transform 200ms ease;
    z-index: var(--z-sidebar);
    will-change: transform;
}
[dir="rtl"] #appSidebar { transform: translateX(100%); }
body.sidebar-open #appSidebar { transform: translateX(0); }

#sidebarOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 150ms ease;
    z-index: var(--z-overlay);
}
body.sidebar-open #sidebarOverlay {
    opacity: 1;
    pointer-events: auto;
}
body.sidebar-open { overflow: hidden; }

@media (min-width: 992px) {
    #appSidebar {
        position: sticky;
        top: var(--topnav-height);
        transform: none !important;
        height: calc(100vh - var(--topnav-height));
    }
    #sidebarOverlay { display: none !important; }
    body.sidebar-open { overflow: auto; }
}

[data-theme-toggle] { cursor: pointer; }
:focus-visible {
    outline: 2px solid var(--color-primary, #0d6efd);
    outline-offset: 2px;
}



/* home.css - Modern redesign for the Law Firm Home Page */

/* Hero Section */
.hero-section-modern {
    background: var(--gradient-header);
    color: white;
    padding: 6rem 0;
    position: relative;
    overflow: hidden;
}

    .hero-section-modern h1,
    .hero-section-modern .lead {
        color: white !important; /* Ensures text is white, overriding theme styles */
        text-shadow: 0 2px 4px rgba(0,0,0,0.5); /* Enhanced shadow for better readability */
    }

    .hero-section-modern::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.05) 25%, transparent 25%), linear-gradient(-45deg, rgba(255, 255, 255, 0.05) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.05) 75%), linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.05) 75%);
        background-size: 20px 20px;
        opacity: 0.5;
        z-index: 0;
    }

    .hero-section-modern .container {
        position: relative;
        z-index: 1;
    }

.hero-logo-modern {
    width: 120px;
    height: 120px;
    object-fit: contain;
    background: var(--color-glass);
    backdrop-filter: blur(12px);
    border-radius: 24px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px 0 var(--shadow-dark);
}

.modern-btn, .modern-btn-outline, .modern-btn-cta {
    padding: 0.75rem 2rem;
    font-weight: 600;
    border-radius: 50px;
    transition: all 0.3s ease;
    border-width: 2px;
}

.modern-btn {
    background-color: var(--color-accent) !important;
    border-color: var(--color-accent) !important;
    color: #fff !important;
}

    .modern-btn:hover {
        background-color: var(--color-accent-hover) !important;
        border-color: var(--color-accent-hover) !important;
        transform: translateY(-3px);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    }

.modern-btn-outline {
    border-color: white !important;
    color: white !important;
}

    .modern-btn-outline:hover {
        background-color: white !important;
        color: var(--color-primary) !important;
        transform: translateY(-3px);
    }

/* Section Header */
.section-header-modern h2 {
    color: var(--color-text);
    position: relative;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

    .section-header-modern h2::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 60px;
        height: 3px;
        background: var(--color-primary);
        border-radius: 2px;
    }

[dir="rtl"] .section-header-modern.text-end h2::after,
.section-header-modern.text-start h2::after {
    left: 0;
    transform: none;
}

[dir="rtl"] .section-header-modern.text-end h2::after {
    left: auto;
    right: 0;
}


/* About Us Section */
.about-section-modern {
    background-color: var(--color-bg);
}
    /* Added styles for better text visibility in light mode */
    .about-section-modern h5 {
        color: var(--color-text)
    }

    .about-section-modern p {
        color: var(--color-text-secondary);
    }


.about-image-container {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 25px var(--shadow-medium);
}

    .about-image-container img {
        display: block;
        width: 100%;
        height: auto;
    }

.about-experience-badge {
    position: absolute;
    bottom: -1px;
    right: -1px;
    background: var(--gradient-primary);
    color: white;
    padding: 1.5rem;
    border-top-left-radius: 12px;
    text-align: center;
    line-height: 1.2;
}

    .about-experience-badge span {
        display: block;
    }

[dir="rtl"] .about-experience-badge {
    right: auto;
    left: -1px;
    border-top-left-radius: 0;
    border-top-right-radius: 12px;
}

/* Services Section */
.services-section-modern {
    background-color: var(--color-surface);
}

.service-card-modern {
    background: var(--color-bg-content);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    color: var(--color-text); /* Ensure base text color is theme-aware */
}

    .service-card-modern p {
        color: var(--color-text); /* Use main text color for better contrast */
        opacity: 0.8;
    }

    .service-card-modern:hover {
        transform: translateY(-10px);
        box-shadow: 0 15px 30px var(--shadow-medium);
        border-color: var(--color-primary);
    }

.service-icon-modern {
    font-size: 2.5rem;
    width: 80px;
    height: 80px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--color-primary-light);
    color: var(--color-primary);
    transition: all 0.3s ease;
}

.service-card-modern:hover .service-icon-modern {
    background: var(--color-primary);
    color: white;
    transform: rotate(15deg) scale(1.1);
}

/* Stats Section */
.stats-section-modern {
    background-color: var(--color-bg);
    padding: 4rem 0;
}

.stat-card-modern {
    padding: 2rem;
}

    .stat-card-modern h3 {
        color: var(--color-primary);
        margin-bottom: 0.5rem;
    }

.stat-label-modern {
    color: var(--color-text);
    /* Removed opacity for better light/dark theme compatibility */
    font-size: 1.1rem;
    font-weight: 500;
}

/* CTA Section */
.cta-section-modern {
    background: var(--gradient-primary) center/cover no-repeat;
    position: relative;
    color: white;
}
    /* Force heading and paragraph text to be white for visibility */
    .cta-section-modern h2, .cta-section-modern p {
        color: white !important;
        text-shadow: 0 2px 4px rgba(0,0,0,0.5); /* Enhanced shadow for better readability */
    }

.modern-btn-cta {
    background-color: white !important;
    color: var(--color-primary) !important;
    border-color: white !important;
    padding: 0.75rem 2.5rem;
}

    .modern-btn-cta:hover {
        background-color: var(--color-accent) !important;
        border-color: var(--color-accent) !important;
        color: white !important;
        transform: translateY(-3px);
    }


/* Responsive adjustments */
@media (max-width: 991.98px) {
    .about-image-container {
        margin-bottom: 2rem;
    }
}

@media (max-width: 767.98px) {
    .hero-section-modern {
        padding: 4rem 0;
    }

    .hero-logo-modern {
        width: 100px;
        height: 100px;
        padding: 1.2rem;
    }

    .service-card-modern, .stat-card-modern {
        margin-bottom: 1rem;
    }
}


.notification-detail-btn {
    --notif-btn-bg: rgba(var(--bs-primary-rgb), 0.08);
    --notif-btn-border: rgba(var(--bs-primary-rgb), 0.2);
    border-radius: 999px;
    border: 1px solid var(--notif-btn-border);
    background: var(--notif-btn-bg);
    color: var(--bs-primary);
    font-weight: 600;
    letter-spacing: .02em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .2rem .95rem;
    transition: all .2s ease;
}

.notification-detail-btn:hover,
.notification-detail-btn:focus {
    color: #fff;
    background: var(--bs-primary);
    border-color: var(--bs-primary);
    text-decoration: none;
    box-shadow: 0 .25rem .75rem rgba(var(--bs-primary-rgb), .3);
}

.notification-detail-btn__icon {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 999px;
    background: #fff;
    color: var(--bs-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .9rem;
    box-shadow: inset 0 0 0 1px var(--notif-btn-border);
}

.notification-detail-btn:hover .notification-detail-btn__icon,
.notification-detail-btn:focus .notification-detail-btn__icon {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    box-shadow: none;
}
