/* ============================================
   AI TEACHER LABS - SHARED STYLES v1.0
   
   INSTRUCTIONS:
   1. Save this file as "teacher-labs-shared.css" in your root directory
   2. Add to every HTML page BEFORE the <style> tag:
      <link rel="stylesheet" href="teacher-labs-shared.css">
   3. Delete duplicate styles from individual pages
   
   Last updated: 2025
   ============================================ */

/* === ROOT VARIABLES === */
:root {
    --brand: #2F5D9F;
    --ink: #0F172A;
    --muted: #475569;
    --bg: #F5F7FB;
    --border: #E6EDF6;
    --shadow: 0 8px 20px rgba(0,0,0,.07);
    --radius: 16px;
    --green: #157f3b;
    --red: #b00020;
}

/* === GLOBAL RESETS === */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Inter, Helvetica, Arial, sans-serif;
    color: var(--ink);
    background: #fff;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* === HEADER & NAVIGATION === */
header.nav {
    position: sticky;
    top: 0;
    background: #fff;
    border-bottom: 1px solid var(--border);
    z-index: 10;
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    min-height: 60px;
    position: relative;
}

.brand {
    font-weight: 800;
    color: var(--brand);
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    text-decoration: none;
    font-size: 16px;
}

.brand:hover {
    opacity: 0.8;
}

.brand img {
    width: 32px;
    height: 32px;
}

.brand-short {
    display: none;
}

/* Centered Desktop Tabs */
.tabs {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    align-items: center;
}

.tabs a {
    padding: 8px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    font-size: 15px;
    font-weight: 500;
}

.tabs a.active {
    background: var(--bg);
    color: var(--brand);
}

.tabs a:hover {
    background: var(--bg);
}

/* Mobile Navigation */
.mobile-nav {
    display: none;
    position: relative;
}

.mobile-nav-toggle {
    padding: 10px 16px;
    border-radius: 12px;
    background: var(--brand);
    color: white;
    border: 1px solid var(--brand);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    min-width: 120px;
    justify-content: space-between;
}

.mobile-nav-toggle:hover {
    background: #2851a0;
}

.mobile-nav-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    min-width: 180px;
    z-index: 20;
    display: none;
    margin-top: 4px;
}

.mobile-nav-dropdown.show {
    display: block;
}

.mobile-nav-dropdown a {
    display: block;
    padding: 14px 18px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid var(--border);
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.mobile-nav-dropdown a:last-child {
    border-bottom: none;
}

.mobile-nav-dropdown a:hover {
    background: var(--bg);
}

.mobile-nav-dropdown a.active {
    background: var(--bg);
    color: var(--brand);
}

/* Auth Controls */
.auth-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
    min-width: 200px;
}

.user-info {
    font-size: 0.9rem;
    color: var(--muted);
}


/* Search Icon */
.search-icon-link {
    font-size: 1.3rem;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s ease;
    padding: 4px 8px;
}

.search-icon-link:hover {
    color: var(--brand);
}

/* === BUTTONS === */
.btn {
    border-radius: var(--radius);
    padding: 8px 14px;
    font-weight: 600;
    border: 1px solid var(--brand);
    cursor: pointer;
    background: var(--brand);
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
}

.btn:hover {
    filter: brightness(1.05);
}

.btn-outline {
    background: transparent;
    color: var(--brand);
}

.btn-danger {
    background: #dc2626;
    border-color: #dc2626;
    color: white;
}

.btn-danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
}

/* === MODALS === */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
    max-width: 400px;
    width: 92%;
    padding: 24px;
    position: relative;
}

.modal h3 {
    margin: 0 0 16px;
    text-align: center;
    color: var(--brand);
    font-size: 1.3rem;
}

.modal .close-btn {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--muted);
    line-height: 1;
    padding: 4px;
}

.modal .close-btn:hover {
    color: var(--ink);
}

.modal .field {
    margin-bottom: 12px;
}

.modal .field label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 14px;
}

.modal .field input,
.modal .field textarea,
.modal .field select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font: inherit;
}

.modal .actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 16px;
}

/* Logout Modal Specific */
.logout-modal {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    max-width: 400px;
    width: 92%;
    padding: 24px;
    position: relative;
    text-align: center;
}

.logout-modal h3 {
    margin: 0 0 12px;
    color: var(--brand);
    font-size: 1.3rem;
}

.logout-modal p {
    margin: 0 0 20px;
    color: var(--muted);
    line-height: 1.5;
}

.logout-modal .actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* Status Messages */
.status-message {
    padding: 8px 12px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.status-success {
    background: #d1fae5;
    color: var(--green);
    border: 1px solid #a7f3d0;
}

.status-error {
    background: #fee2e2;
    color: var(--red);
    border: 1px solid #fca5a5;
}

/* Logout Success Notification */
.logout-success {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 20px 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3);
    z-index: 9999;
    font-weight: 600;
    font-size: 1.1rem;
    animation: logoutSuccess 0.5s ease-out;
}

@keyframes logoutSuccess {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* === FOOTER === */
footer {
    background: var(--bg);
    border-top: 1px solid var(--border);
    padding: 40px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 32px;
}

.footer-section h4 {
    color: var(--brand);
    font-weight: 700;
    margin-bottom: 16px;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section ul li a {
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-section ul li a:hover {
    color: var(--brand);
}

.social-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 20px;
}

.social-links a {
    color: var(--muted);
    text-decoration: none;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.social-links a:hover {
    background: #F1F5FB;
    color: var(--brand);
}

.footer-bottom {
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.footer-bottom a {
    color: var(--brand);
    text-decoration: underline;
}

/* === MOBILE RESPONSIVE === */
@media (max-width: 768px) {
    .nav-inner {
        padding: 8px 12px;
        gap: 8px;
    }
    
    .brand {
        font-size: 13px !important;
        line-height: 1.1 !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 4px !important;
        min-width: 70px !important;
    }
    
    .brand img {
        width: 24px !important;
        height: 24px !important;
    }
    
    .brand-full {
        display: none !important;
    }
    
    .brand-short {
        display: inline !important;
    }
    
    .tabs {
        display: none !important;
    }
    
    .mobile-nav {
        display: block !important;
        flex: 1 !important;
        text-align: center !important;
    }
    
    .auth-controls {
        min-width: 110px !important;
        gap: 6px !important;
    }
    
    .auth-controls .btn {
        padding: 6px 10px !important;
        font-size: 12px !important;
        min-width: 60px !important;
        border-radius: 20px !important;
    }
    
    .mobile-nav-toggle {
        padding: 8px 12px !important;
        font-size: 13px !important;
        min-width: 100px !important;
    }
    
    .search-icon-link {
        display: none !important;
    }
    
    /* Mobile footer - matches Student Labs exactly */
    footer {
        padding: 30px 0 16px;
        margin-top: 20px;
    }
    
    .footer-content {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
        margin-bottom: 20px !important;
    }
    
    .footer-section h4 {
        margin-bottom: 12px;
        font-size: 1rem;
    }
    
    .footer-section ul li {
        margin-bottom: 6px;
    }
    
    .social-links {
        gap: 8px !important;
        margin-bottom: 16px !important;
    }
    
    .social-links a {
        font-size: 0.8rem;
        padding: 6px 10px;
    }
    
    .footer-bottom {
        font-size: 0.85rem;
        line-height: 1.6;
        padding: 16px 12px 0;
    }
    
    /* Prevent awkward link wrapping */
    .footer-bottom a[href*="shala-books"] {
        display: inline-block;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 0 16px;
    }
    
    /* Better text wrapping for very narrow screens */
    .footer-bottom {
        font-size: 0.8rem !important;
        padding: 16px 8px 0 !important;
    }
    
    .footer-bottom a[href*="shala-books"] {
        display: inline-block;
        white-space: nowrap;
    }
}

/* ============================================
   END OF SHARED STYLES
   
   NEXT STEPS:
   1. ✅ Save this as "teacher-labs-shared.css"
   2. ✅ Add <link> tag to each HTML page
   3. ✅ Delete duplicate CSS from individual pages
   4. ✅ Test each page on desktop and mobile
   
   Questions? See the Migration Guide artifact
   ============================================ */

  