/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700&display=swap');

:root {
    --primary: #1e3a5f;
    /* Deep Navy Blue */
    --secondary: #d4af37;
    /* Royal Gold */
    --accent: #2c3e50;
    /* Dark Grey */
    --bg-light: #f8fafc;
    --text-dark: #1e293b;
    --text-light: #64748b;
    --white: #ffffff;
    --radius: 8px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

body {
    font-family: 'Tajawal', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    margin: 0;
    line-height: 1.6;
    overflow-x: hidden;
    /* Fix horizontal scroll */
    width: 100%;
}

/* Global Container Fixes */
*,
*::before,
*::after {
    box-sizing: border-box;
}

img,
video,
iframe {
    max-width: 100%;
    height: auto;
}

.main-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    overflow-x: hidden;
}

section {
    width: 100%;
    overflow: hidden;
    /* Contain inner floats/margins */
}

/* Navbar */
.public-nav {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid var(--secondary);
    box-shadow: var(--shadow);
    padding: 0.8rem 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-menu-toggle {
    display: none;
}

.nav-brand {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 0.8rem;
    border-radius: var(--radius);
    transition: all 0.3s ease;
}

.nav-links a:hover {
    color: var(--secondary);
    background: rgba(30, 58, 95, 0.05);
}

.nav-btn {
    background: linear-gradient(135deg, var(--secondary), #b8860b);
    color: var(--white) !important;
    padding: 0.6rem 1.4rem;
    border-radius: 50px;
    box-shadow: 0 4px 10px rgba(212, 175, 55, 0.3);
}

.nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(212, 175, 55, 0.4);
}

/* Hero Section */
.hero {
    background: linear-gradient(rgba(30, 58, 95, 0.9), rgba(30, 58, 95, 0.8)), url('../images/hero_bg.png');
    background-size: cover;
    color: var(--white);
    padding: 6rem 1rem;
    text-align: center;
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero p {
    font-size: 1.5rem;
    color: #e2e8f0;
    max-width: 700px;
    margin-bottom: 2rem;
}

/* Button Standards */
/* Button Standards - Premium Look */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 0;
    gap: 0.5rem;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #2980b9 100%);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(30, 58, 95, 0.3);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(30, 58, 95, 0.4);
}

.btn-primary:hover::before {
    opacity: 1;
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary) 0%, #f1c40f 100%);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.4);
}

.btn-outline-white {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.8);
    color: var(--white);
    backdrop-filter: blur(5px);
}

.btn-outline-white:hover {
    background: var(--white);
    color: var(--primary);
    border-color: var(--white);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.3);
}

/* Utilities */
.section-light {
    background: white;
    padding: 4rem 2rem;
    text-align: center;
}

.section-alt {
    background: var(--bg-light);
    padding: 4rem 2rem;
    text-align: center;
}

.text-primary {
    color: var(--primary);
}

.mb-2 {
    margin-bottom: 2rem;
}

.mb-3 {
    margin-bottom: 3rem;
}

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.flex-wrap {
    flex-wrap: wrap;
}

.w-100 {
    width: 100%;
}

/* Hero Specifics using new buttons */
.hero-btn {
    /* Deprecated, use .btn classes in HTML, keeping for backward compat if needed */
    padding: 1rem 3rem;
    font-size: 1.2rem;
}

/* Features */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-card {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
    border-top: 4px solid var(--primary);
}

.feature-card:hover {
    transform: translateY(-10px);
}

/* Footer */
footer {
    background: var(--primary);
    color: var(--white);
    padding: 3rem 1rem;
    text-align: center;
    margin-top: 4rem;
}

footer a {
    color: var(--secondary);
    text-decoration: none;
    margin: 0 0.5rem;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .public-nav {
        flex-wrap: wrap;
        padding: 0.5rem 1rem;
        position: sticky;
        top: 0;
        z-index: 1000;
    }

    .nav-brand img {
        height: 40px !important;
    }

    .mobile-menu-toggle {
        display: block;
        background: none;
        border: none;
        font-size: 1.5rem;
        color: var(--primary);
        cursor: pointer;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        text-align: center;
        gap: 0.5rem;
        margin-top: 1rem;
        background: white;
        padding: 1rem;
        border-radius: var(--radius);
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links a {
        display: block;
        padding: 0.75rem;
        background: rgba(0, 0, 0, 0.03);
    }

    .hero {
        padding: 5rem 1rem 3rem 1rem;
        /* Adjusted padding */
        min-height: auto;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .hero h1 {
        font-size: 2rem;
        /* Better scale for mobile */
        line-height: 1.3;
        margin-bottom: 1rem;
    }

    .hero p {
        font-size: 1.1rem;
        padding: 0 1rem;
    }

    .hero-btn {
        width: 100%;
        display: block;
        margin-bottom: 1rem;
    }

    .features-grid {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
        /* Better gap */
        padding: 2rem 1rem;
    }

    .section-title {
        font-size: 1.8rem;
    }
}

/* Bottom Navigation & FAB (Mobile Only) */
.bottom-nav,
.mobile-spacer,
.float-whatsapp {
    display: none;
}

@media (max-width: 768px) {
    .bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: var(--white);
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
        justify-content: space-around;
        align-items: center;
        padding: 0.5rem 0;
        z-index: 2000;
        border-top-left-radius: 15px;
        border-top-right-radius: 15px;
    }

    .nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-decoration: none;
        color: var(--text-light);
        font-size: 0.75rem;
        gap: 4px;
        flex: 1;
    }

    .nav-item i {
        font-size: 1.2rem;
    }

    .nav-item.active,
    .nav-item:hover {
        color: var(--primary);
    }

    .center-item {
        background: var(--primary);
        color: white !important;
        width: 50px;
        height: 50px;
        border-radius: 50%;
        display: flex;
        justify-content: center;
        align-items: center;
        margin-top: -25px;
        box-shadow: 0 4px 10px rgba(30, 58, 95, 0.4);
        border: 4px solid var(--bg-light);
    }

    .center-item i {
        font-size: 1.5rem;
    }

    .mobile-spacer {
        display: block;
    }

    /* Floating WhatsApp */
    .float-whatsapp {
        display: flex;
        position: fixed;
        width: 50px;
        height: 50px;
        bottom: 80px;
        /* Above bottom nav */
        right: 20px;
        background-color: #25d366;
        color: #FFF;
        border-radius: 50px;
        text-align: center;
        font-size: 30px;
        box-shadow: 2px 2px 3px #999;
        z-index: 100;
        align-items: center;
        justify-content: center;
        text-decoration: none;
    }

    .my-float {
        margin-top: 0;
    }
}

/* Form Styles */
.apply-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.full-width {
    grid-column: span 2;
}

.apply-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.apply-form input,
.apply-form select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    /* Prevent auto-zoom on iOS */
    box-sizing: border-box;
}

.apply-form input:focus,
.apply-form select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

@media (max-width: 768px) {
    .apply-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .full-width {
        grid-column: span 1;
    }
}

/* Page & Contact Styles */
.container-responsive {
    background: white;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    max-width: 1000px;
    margin: 2rem auto;
}

.page-title-primary {
    color: var(--primary);
    margin-top: 0;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
    font-size: 2rem;
}

.content-body {
    line-height: 1.8;
    color: #4b5563;
    min-height: 300px;
    font-size: 1.1rem;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 3rem;
    margin-top: 2rem;
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 2rem;
}

.info-item i {
    background: rgba(30, 58, 95, 0.1);
    color: var(--primary);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.info-item h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
}

.info-item p {
    margin: 0;
    color: #666;
}

@media (max-width: 768px) {
    .container-responsive {
        padding: 1.5rem;
        margin: 1rem;
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .info-item {
        background: #f8fafc;
        padding: 1rem;
        border-radius: 8px;
    }
}

/* Auth Pages Styles */
.auth-container {
    max-width: 450px;
    margin: 3rem auto;
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h2 {
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
}

.auth-btn {
    width: 100%;
    padding: 0.75rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s;
}

.auth-btn:hover {
    background: var(--secondary);
}

.auth-links {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
}

.auth-links a {
    color: var(--primary);
    text-decoration: none;
    font-weight: bold;
}

/* Dashboard Styles */
.portal-container {
    max-width: 1100px;
    margin: 2rem auto;
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
    padding: 0 1rem;
}

.sidebar {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    height: fit-content;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    margin-bottom: 0.5rem;
}

.sidebar-menu a {
    display: block;
    padding: 0.75rem 1rem;
    color: #4b5563;
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.2s;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: #eff6ff;
    color: var(--primary);
    font-weight: 600;
}

.content-area {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.welcome-box {
    background: linear-gradient(135deg, var(--primary) 0%, #2563eb 100%);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

/* Responsive Dashboard Tables (Cards on Mobile) */
@media (max-width: 768px) {
    .portal-container {
        grid-template-columns: 1fr;
        margin: 1rem auto;
    }

    .sidebar {
        display: none;
        /* Hide sidebar on mobile, assume Bottom Nav covers it */
    }

    /* Convert Table to Cards */
    table,
    thead,
    tbody,
    th,
    td,
    tr {
        display: block;
    }

    thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    tr {
        border: 1px solid #e5e7eb;
        border-radius: 12px;
        margin-bottom: 1rem;
        padding: 1rem;
        background: #f9fafb;
    }

    td {
        border: none;
        border-bottom: 1px solid #eee;
        position: relative;
        padding-right: 50%;
        text-align: left;
    }

    td:last-child {
        border-bottom: none;
    }

    td::before {
        position: absolute;
        right: 0;
        top: 1rem;
        /* Match padding */
        width: 45%;
        padding-right: 15px;
        white-space: nowrap;
        font-weight: bold;
        color: var(--primary);
        content: attr(data-label);
        text-align: right;
    }
}

/* Install PWA Prompt custom styles if needed */
#install-prompt {
    display: none;
    position: fixed;
    bottom: 80px;
    left: 20px;
    right: 20px;
    background: white;
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    text-align: center;
}