/* ===== GLOBAL RESET (STOPS MOBILE OVERFLOW) ===== */
*, *::before, *::after {
    box-sizing: border-box;
}
html, body {
    overflow-x: hidden; /* Instantly stops side-to-side scrolling */
    width: 100%;
    margin: 0;
    padding: 0;
}




/* ===== LAYOUT & SMOOTH TRANSITIONS ===== */
html {
    transition: background-color 0.3s ease, color 0.3s ease;
}

.layout {
    display: flex;
}

/* ===== SIDEBAR ===== */
.side-nav {
    position: sticky;
    top: 0; 
    width: 240px;
    height: 100vh;
    background: linear-gradient(180deg, #0f172a, #020617);
    color: white;
    padding: 12px 16px;
    overflow-y: auto;
    transition: all 0.3s ease;
    border-right: 1px solid rgba(255,255,255,0.05);
    z-index: 1000;
    box-sizing: border-box;
    display: flex;
    flex-direction: column; /* Allows pushing theme toggle to bottom */
}

.nav-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 25px;
    padding: 0 12px;
}

.toggle-btn {
    background: rgba(255,255,255,0.05);
    border: none;
    color: white;
    cursor: pointer;
    padding: 10px 10px;
    border-radius: 8px;
    transition: 0.2s;
}

.toggle-btn:hover {
    background: rgba(255,255,255,0.15);
}

/* ===== LINKS & NAVIGATION ===== */
.side-nav nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1; /* Pushes the theme toggle down */
}

.nav-link {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 12px;
    color: #94a3b8;
    text-decoration: none;
    transition: 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.nav-link i {
    width: 24px;
    text-align: center;
    font-size: 18px;
    flex-shrink: 0;
}

.nav-link:hover {
    background: rgba(79,70,229,0.2);
    color: white;
}

.nav-link.active {
    background: #4f46e5;
    color: white;
}

/* ===== THEME TOGGLE BUTTON ===== */
.theme-toggle-container {
    margin-top: auto; 
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.theme-toggle-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 15px;
}

/* ===== COLLAPSE STATE ===== */
.side-nav.collapsed {
    width: 80px;
}

.side-nav.collapsed span,
.side-nav.collapsed .logo-text {
    display: none;
}

.side-nav.collapsed .nav-link {
    justify-content: center;
    padding: 12px 0;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    padding: 20px;
    transition: 0.3s;
}

.public-header {
    width: 100%;
}

.main-content .container {
    max-width: 100%;
}

.mobile-toggle {
    display: none;
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    margin-right: 15px;
    color: var(--text);
}

@media (max-width: 768px) {
    .side-nav {
        position: fixed;
        left: -100%;
        top: 0;
        overflow-y: auto;
        height: 100vh;
    }
    .side-nav.active { left: 0; }
    .main-content { padding: 15px; }
    .mobile-toggle { display: inline-block; }
}

/* ==========================================
   ===== PROFESSIONAL FOOTER STYLES ===== 
   ========================================== */

.site-footer {
    background: var(--card); /* Updated for Dark Mode */
    border-top: 1px solid var(--border);
    margin-top: auto; 
    color: var(--text-light);
    font-family: 'Plus Jakarta Sans', sans-serif;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.footer-top { padding: 70px 0 50px; }

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 40px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: 800;
    color: var(--primary); 
    margin-bottom: 20px;
}

.footer-logo span { color: var(--text); }
.footer-brand p { font-size: 15px; line-height: 1.7; margin-bottom: 25px; max-width: 90%; }

.social-links { display: flex; gap: 12px; }
.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--bg); /* Updated for Dark Mode */
    color: var(--text-light);
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-3px); 
    box-shadow: 0 5px 15px rgba(37, 99, 235, 0.2);
}

.footer-links h3, .footer-newsletter h3 {
    color: var(--text); /* Updated for Dark Mode */
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 25px;
}

.footer-links ul { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 15px; }
.footer-links a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: 0.2s;
    display: inline-block;
}
.footer-links a:hover { color: var(--primary); transform: translateX(5px); }

.footer-newsletter p { font-size: 15px; margin-bottom: 20px; line-height: 1.6; }
.newsletter-form { display: flex; gap: 8px; }

.newsletter-form input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid var(--border); /* Updated for Dark Mode */
    background: var(--bg); /* Updated for Dark Mode */
    color: var(--text);
    border-radius: 8px;
    outline: none;
    font-family: inherit;
    font-size: 14px;
    transition: 0.3s;
}

.newsletter-form input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.newsletter-form button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: 0.2s;
}
.newsletter-form button:hover { background: #1d4ed8; }

.footer-bottom {
    padding: 25px 0;
    border-top: 1px solid var(--border); /* Updated for Dark Mode */
    text-align: center;
    font-size: 14px;
    color: var(--text-light);
}

@media (max-width: 1024px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
    .side-nav {
        position: fixed;
        left: -100%;
        top: 0;
        width: 250px !important; /* Forces menu to be full width on phone */
        height: 100vh;
        z-index: 9999; 
        box-shadow: 5px 0 20px rgba(0,0,0,0.5); 
    }
    .side-nav.active { left: 0; }
    
    /* Forces text to show on mobile even if collapsed on desktop */
    .side-nav span { display: inline-block !important; }
    .side-nav .nav-link { justify-content: flex-start !important; padding: 12px 16px !important; }
    
    .main-content { padding: 0; width: 100%; overflow-x: hidden; } 
    .mobile-toggle { display: inline-block; margin-right: 15px; }
}