/*
Theme Name: LawFocus Educational Initiatives
Theme URI: https://lawfocus.edu
Author: Custom Theme
Description: Multi-page custom WordPress theme for LawFocus Educational Initiatives.
Version: 1.0
Text Domain: lawfocus
*/

/* =========================================================
   GLOBAL VARIABLES & UI/UX RULES
   ========================================================= */
:root {
    --primary-navy: #0F172A;
    --brand-blue: #1E3A8A;
    --accent-amber: #D97706;
    --bg-canvas: #F8FAFC;
    --card-surface: #FFFFFF;
    --text-main: #334155;
    --text-dark: #0F172A;
    --text-light: #64748B;
    --alert-red: #EF4444;
    --success-green: #10B981;
    --whatsapp-green: #25D366;
    --border-soft: #E2E8F0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-canvas);
    color: var(--text-main);
    line-height: 1.6;
    font-size: 16px; 
    overflow-x: hidden;
}

/* =========================================================
   HEADER, NAVIGATION & TICKER
   ========================================================= */
.sticky-wrapper {
    position: sticky;
    top: 0;
    z-index: 9999;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    background-color: var(--primary-navy);
}

.news-ticker-wrapper {
    display: flex;
    background-color: #1E293B;
    border-bottom: 2px solid var(--accent-amber);
    height: 45px;
    overflow: hidden;
    position: relative;
}

.ticker-title {
    background-color: var(--alert-red);
    color: white;
    font-weight: 800;
    font-size: 0.9rem;
    padding: 0 25px;
    display: flex;
    align-items: center;
    z-index: 10;
    box-shadow: 4px 0 10px rgba(0,0,0,0.5);
    animation: red-pulse 1.5s infinite;
    white-space: nowrap;
}

@keyframes red-pulse {
    0% { background-color: #EF4444; }
    50% { background-color: #B91C1C; }
    100% { background-color: #EF4444; }
}

.ticker-text-container {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.ticker-track {
    display: inline-block;
    white-space: nowrap;
    padding-left: 100%;
    animation: scroll-ticker 35s linear infinite;
    color: #F8FAFC;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 45px;
}

.ticker-track:hover { animation-play-state: paused; }
.ticker-item { display: inline-block; margin-right: 80px; }
.ticker-item strong { color: var(--accent-amber); margin-right: 5px; }

@keyframes scroll-ticker {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-100%, 0, 0); }
}

header {
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.logo-area h1 {
    font-size: 1.4rem;
    font-weight: 800;
    color: #FFFFFF;
    cursor: pointer;
}
.logo-area span { color: var(--accent-amber); }

.mobile-toggle {
    display: none;
    color: white;
    font-size: 1.8rem;
    background: none;
    border: none;
    cursor: pointer;
}

/* Base Navigation Elements */
nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
    align-items: center;
    margin: 0;
    padding: 0;
}

nav li {
    position: relative;
}

nav a {
    color: #E2E8F0;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.2s ease;
    cursor: pointer;
    display: block;
}

nav a:hover, nav a.active-link { color: var(--accent-amber); }

/* Hide JS-Injected Mobile Toggle Buttons on Desktop */
.mobile-submenu-toggle {
    display: none !important;
}

/* --- DESKTOP DROPDOWN SUB-MENU STYLES (min-width: 769px) --- */
@media (min-width: 769px) {
    nav ul .menu-item-has-children > a::after {
        content: ' ▾';
        font-size: 0.85em;
        margin-left: 4px;
        opacity: 0.7;
    }

    nav ul .sub-menu {
        position: absolute;
        top: 100%;
        left: 0;
        min-width: 220px;
        background-color: var(--card-surface);
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
        border-radius: 8px;
        padding: 10px 0;
        display: flex;
        flex-direction: column;
        gap: 0;
        list-style: none;
        
        /* Reveal Animation */
        opacity: 0;
        visibility: hidden;
        transform: translateY(15px);
        transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
        z-index: 100;
    }

    /* Hover & Focus state to show sub-menu */
    nav ul li:hover > .sub-menu,
    nav ul li:focus-within > .sub-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    /* Sub-Menu Links */
    nav ul .sub-menu a {
        color: var(--text-main);
        padding: 12px 20px;
        font-size: 0.9rem;
        font-weight: 500;
        border-bottom: 1px solid var(--border-soft);
        width: 100%;
    }

    nav ul .sub-menu li:last-child > a {
        border-bottom: none;
    }

    nav ul .sub-menu a:hover {
        color: var(--brand-blue);
        background-color: var(--bg-canvas);
        padding-left: 25px; /* Nice indent effect on hover */
    }

    /* Level 3 Dropdowns (Flyouts) */
    nav ul .sub-menu .sub-menu {
        top: 0;
        left: 100%;
        transform: translateX(15px);
    }
    nav ul .sub-menu li:hover > .sub-menu {
        transform: translateX(0);
    }
}

.nav-btn {
    background: var(--accent-amber);
    color: white !important;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 700;
}
.nav-btn:hover { background: #B45F06; }

@media (max-width: 1100px) and (min-width: 769px) {
    nav ul { gap: 12px; }
    nav a { font-size: 0.85rem; }
    .nav-btn { padding: 6px 12px; font-size: 0.85rem; }
}

/* --- MOBILE NAVIGATION ACCORDION STYLES (max-width: 768px) --- */
@media (max-width: 768px) {
    .mobile-toggle { display: block; }

    nav ul {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--primary-navy);
        padding: 10px 5%;
        border-top: 1px solid #1E293B;
        box-shadow: 0 10px 10px rgba(0,0,0,0.2);
        gap: 0;
    }

    nav ul.active { 
        display: flex; 
        align-items: stretch;
    }
    
    nav li {
        width: 100%;
        position: relative;
        border-bottom: 1px solid #1E293B;
    }

    nav a { 
        padding: 15px 50px 15px 0; /* Space reserved for toggle arrow button */
        display: block; 
        width: 100%; 
    }

    /* Mobile Submenu Toggle Button (Injected by JS) */
    .mobile-submenu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        position: absolute;
        right: 0;
        top: 0;
        width: 48px;
        height: 50px; /* Matches line height of top parent link */
        background: transparent;
        border: none;
        border-left: 1px solid #1E293B;
        color: var(--accent-amber);
        font-size: 0.85rem;
        cursor: pointer;
        z-index: 10;
        transition: background-color 0.2s ease;
    }

    .mobile-submenu-toggle:active {
        background-color: rgba(255, 255, 255, 0.05);
    }

    /* Mobile Sub-Menu Container */
    nav ul .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background-color: rgba(0, 0, 0, 0.25); /* Darkened nested background */
        border-radius: 0;
        width: calc(100% + 10%); /* Stretches edge-to-edge of nav overlay */
        margin-left: -5%;
        padding: 0;
        display: none; /* Controlled by .mobile-active class in JS */
        flex-direction: column;
        list-style: none;
    }
    
    /* Reveal Sub-Menu on JS Mobile Active Toggle */
    nav ul li.mobile-active > .sub-menu {
        display: flex;
    }

    nav ul .sub-menu li {
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    nav ul .sub-menu li:last-child {
        border-bottom: none;
    }

    nav ul .sub-menu a {
        color: #CBD5E1;
        padding: 12px 5% 12px 10%; /* Indented child menu links */
        font-size: 0.9rem;
        width: 100%;
    }
    
    nav ul .sub-menu a:hover {
        background-color: transparent;
        color: var(--accent-amber);
        padding-left: 10%;
    }

    .nav-btn { 
        background: transparent; 
        color: var(--accent-amber) !important; 
        padding: 15px 0; 
        border-bottom: none; 
        margin-top: 5px;
    }
}

/* =========================================================
   PAGE ROUTING & SHARED COMPONENTS
   ========================================================= */
.page {
    display: block; 
    animation: fadeIn 0.4s ease-in forwards;
}

@keyframes fadeIn { to { opacity: 1; } }

.content-container {
    padding: 80px 5%;
    max-width: 1200px; 
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: 2.5rem; 
    color: var(--text-dark);
    font-weight: 800;
    margin-bottom: 15px;
    line-height: 1.2;
}

.section-subtitle {
    text-align: center;
    color: var(--text-light);
    max-width: 700px;
    margin: 0 auto 40px auto;
    font-size: 1.1rem;
}

.grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.btn-action {
    background-color: var(--whatsapp-green);
    color: white;
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn-action:hover { background-color: #1DA851; }

.btn-secondary {
    background: transparent;
    color: var(--brand-blue);
    border: 2px solid var(--brand-blue);
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn-secondary:hover { background: var(--brand-blue); color: white; }

.btn-submit {
    background-color: var(--brand-blue);
    color: white;
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    transition: background 0.3s;
}
.btn-submit:hover { background-color: var(--primary-navy); }

.mt-3 { margin-top: 15px; }
.mb-4 { margin-bottom: 20px; }

/* =========================================================
   HOME PAGE SPECIFICS
   ========================================================= */
.hero-section {
    position: relative;
    color: white;
    padding: 120px 5% 100px 5%;
    text-align: center;
    overflow: hidden;
    min-height: 600px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.slide {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.5s ease-in-out; 
    z-index: 0;
}
.slide.active { opacity: 1; }

.hero-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 40%, rgba(30, 58, 138, 0.75));
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2; 
    max-width: 900px;
}

.hero-content h2 {
    font-size: 3.2rem; 
    font-weight: 800;
    margin-bottom: 20px;
    letter-spacing: -1px;
    line-height: 1.1;
}

.hero-content p {
    font-size: 1.25rem;
    max-width: 750px;
    margin: 0 auto 35px auto;
    color: #CBD5E1;
}

@media (max-width: 768px) { .hero-content h2 { font-size: 2.2rem; } }

.badge {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    padding: 8px 18px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #F8FAFC;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 5px;
}
.badge::before { content: '✓'; color: var(--accent-amber); }

/* =========================================================
   INNER PAGE HEADER & CARDS
   ========================================================= */
.inner-page-header {
    background: var(--brand-blue);
    color: white;
    padding: 80px 5% 40px 5%;
    text-align: center;
}
.inner-page-header h2 { font-size: 2.8rem; font-weight: 800; }
.inner-page-header p { font-size: 1.1rem; color: #E2E8F0; max-width: 600px; margin: 15px auto 0 auto; }

.card {
    background: var(--card-surface);
    padding: 40px 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border-top: 4px solid var(--brand-blue);
    transition: transform 0.3s ease, border-color 0.3s ease;
    cursor: pointer;
    border: 1px solid transparent;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.card:hover { 
    transform: translateY(-5px); 
    border-color: var(--accent-amber);
    border-top: 4px solid var(--accent-amber);
}
.card h4 { font-size: 1.3rem; color: var(--text-dark); margin-bottom: 15px; font-weight: 800; }

.card-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-amber);
    font-weight: 700;
    margin-top: 15px;
    text-decoration: none;
}

/* Portfolios */
.portfolio-card {
    background: var(--bg-canvas);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border: 1px solid #E2E8F0;
    transition: transform 0.3s ease;
}
.portfolio-card:hover { transform: translateY(-5px); }
.portfolio-img { width: 100%; height: 240px; object-fit: cover; border-bottom: 3px solid var(--brand-blue); background-color: #CBD5E1; }
.portfolio-content { padding: 25px; }
.portfolio-tag {
    background: #E0E7FF; color: var(--brand-blue); font-size: 0.75rem; font-weight: 700;
    padding: 5px 12px; border-radius: 50px; display: inline-block; margin-bottom: 12px; text-transform: uppercase;
}
.portfolio-dest { font-size: 0.9rem; color: var(--accent-amber); font-weight: 600; margin-bottom: 15px; }

/* =========================================================
   APPLICATION FORM & REQUIREMENTS
   ========================================================= */
.form-container {
    background: var(--card-surface);
    padding: 50px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    max-width: 800px;
    margin: -40px auto 40px auto;
    position: relative;
    z-index: 10;
}

.form-group { margin-bottom: 25px; text-align: left; }
.form-label { display: block; font-weight: 600; margin-bottom: 8px; color: var(--text-dark); }
.form-control {
    width: 100%;
    padding: 14px 20px;
    font-size: 1rem;
    border: 2px solid #E2E8F0;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s;
    background-color: var(--bg-canvas);
}
.form-control:focus { border-color: var(--brand-blue); background-color: #FFF; }
textarea.form-control { resize: vertical; min-height: 120px; }

.req-box {
    background: #F1F5F9;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--accent-amber);
    margin-bottom: 30px;
}
.req-box ul { padding-left: 20px; margin-top: 10px; }
.req-box li { margin-bottom: 8px; }

@media (max-width: 768px) { .form-container { padding: 30px 20px; } }

/* =========================================================
   HIGH-END SCHEDULE TABLE
   ========================================================= */
.timetable-container {
    width: 100%;
    overflow-x: auto;
    margin-top: 30px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid var(--border-soft);
}

.timetable {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    min-width: 800px;
}

.timetable th {
    background-color: var(--primary-navy);
    color: white;
    padding: 16px 20px;
    font-weight: 700;
    font-size: 0.95rem;
}

.timetable td {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-soft);
    color: var(--text-main);
    font-size: 0.95rem;
}

.timetable tr:last-child td { border-bottom: none; }
.timetable tr:hover td { background-color: #F8FAFC; }

.status-pill {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.status-pill.open { background-color: #DEF7EC; color: #03543F; }
.status-pill.closing { background-color: #FDF2F2; color: #9B1C1C; }

/* =========================================================
   BEFORE & AFTER / DIAGNOSTIC
   ========================================================= */
.split-diagnostic-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 40px;
}

@media (max-width: 768px) { .split-diagnostic-grid { grid-template-columns: 1fr; } }

.diagnostic-card {
    background: white;
    padding: 35px;
    border-radius: 12px;
    border: 1px solid var(--border-soft);
    box-shadow: 0 4px 10px rgba(0,0,0,0.02);
}
.diagnostic-card.red-border { border-top: 5px solid var(--alert-red); }
.diagnostic-card.green-border { border-top: 5px solid var(--success-green); }

.diagnostic-item { display: flex; gap: 15px; margin-bottom: 15px; }
.diagnostic-item .icon { font-weight: bold; font-size: 1.2rem; }

/* =========================================================
   SCHOLARSHIP CATEGORY SELECTORS & ACTIVE STATES
   ========================================================= */
.scholarship-selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.scholarship-cat-card {
    background: var(--card-surface);
    padding: 30px 25px;
    border-radius: 12px;
    border: 2px solid var(--border-soft);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
    position: relative;
    overflow: hidden;
}

.scholarship-cat-card::after {
    content: ''; position: absolute; left: 0; bottom: 0; height: 4px; width: 100%;
    background-color: transparent; transition: background-color 0.2s ease;
}

.scholarship-cat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 20px -8px rgba(15, 23, 42, 0.08);
    border-color: var(--brand-blue);
}

.scholarship-cat-card.active {
    border-color: var(--accent-amber);
    background: #FFFFFF;
    box-shadow: 0 12px 20px -5px rgba(15, 23, 42, 0.1);
}

.scholarship-cat-card.active::after { background-color: var(--accent-amber); }

.scholarship-cat-card h4 {
    font-size: 1.25rem; font-weight: 800; color: var(--text-dark);
    margin-bottom: 8px; transition: color 0.2s ease;
}

.scholarship-cat-card.active h4 { color: var(--brand-blue); }
.scholarship-cat-card p { font-size: 0.95rem; color: var(--text-light); }

.scholarship-table-wrapper { opacity: 1; transition: opacity 0.35s ease; }
.scholarship-table-wrapper.loading { opacity: 0.3; }

/* =========================================================
   MODAL (PORTAL DIALOG) STYLING
   ========================================================= */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.7); backdrop-filter: blur(5px);
    display: flex; justify-content: center; align-items: center;
    z-index: 10000; opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}

.modal-overlay.active { opacity: 1; pointer-events: auto; }

.modal-card {
    background: var(--card-surface); border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 500px; width: 90%; transform: translateY(20px);
    transition: transform 0.3s ease; border-top: 6px solid var(--accent-amber);
}

.modal-overlay.active .modal-card { transform: translateY(0); }

.modal-header {
    padding: 20px 25px; border-bottom: 1px solid var(--border-soft);
    display: flex; justify-content: space-between; align-items: center;
}
.modal-header h3 { font-size: 1.3rem; color: var(--text-dark); font-weight: 800; }
.modal-close-btn {
    background: none; border: none; color: var(--text-light); font-size: 1.5rem;
    cursor: pointer; transition: color 0.2s;
}
.modal-close-btn:hover { color: var(--alert-red); }
.modal-body { padding: 25px; text-align: center; }

.scholar-highlight-box {
    background: #EFF6FF; border-left: 4px solid var(--brand-blue);
    padding: 20px; border-radius: 8px; margin-top: 15px; text-align: left;
}
.scholar-highlight-box strong { color: var(--brand-blue); }


/* Style the dropdown container background and shadow */
nav ul .sub-menu {
    background-color: var(--card-surface);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
}

/* Style individual links inside the sub-menu */
nav ul .sub-menu a {
    color: var(--text-main);
    padding: 12px 20px;
    font-size: 0.9rem;
}

/* Style the hover effect for sub-menu items */
nav ul .sub-menu a:hover {
    color: var(--brand-blue);
    background-color: var(--bg-canvas);
}

/* =========================================================
   FOOTER
   ========================================================= */
footer {
    background-color: #0F172A; color: #64748B; text-align: center; padding: 40px 20px; font-size: 0.9rem;
    border-top: 4px solid var(--accent-amber);
}
.footer-links { margin-top: 15px; display: flex; justify-content: center; gap: 20px; }
.footer-links a { color: #E2E8F0; text-decoration: none; font-size: 0.85rem; }
.footer-links a:hover { color: var(--accent-amber); }