/* Base USA Flag Theme CSS - Shared Components Only */
/* Color Palette: Red (#DC2626, #B91C1C), White (#FFFFFF, #F9FAFB), Blue (#1E40AF, #1E3A8A), Green (#16A34A) */

/* Font Import - Include this in <head> of each page */
/* <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet"> */

/* General Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #F9FAFB 0%, #FFFFFF 100%);
    margin: 0;
    padding: 0;
    color: #1F2937;
    line-height: 1.6;
}

/* Zoom to 80% by default */
html {
    zoom: 0.8;
}

/* Firefox compatibility */
@-moz-document url-prefix() {
    body {
        transform: scale(0.8);
        transform-origin: top left;
        width: 125%;
    }
}

/* Navbar Styles - SQUARESPACE INSPIRED */
.navbar {
    background: #4A5FC1; /* Softer, less aggressive blue */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 2.5rem; /* Thinner navbar */
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(74, 95, 193, 0.15);
}

/* Left side - Navigation links */
.navbar-left {
    display: flex;
    align-items: center;
    gap: 0;
}

.navbar-left a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    position: relative;
}

.navbar-left a:hover {
    border-bottom-color: rgba(255, 255, 255, 0.5);
}

.navbar-left a.active {
    border-bottom-color: white;
}

/* Separator between nav items */
.nav-separator {
    color: rgba(255, 255, 255, 0.4);
    margin: 0 0.5rem;
    font-weight: 300;
}

/* Right side - Profile section */
.navbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Profile button with initials */
.profile-button {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.15);
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    color: white;
}

.profile-button:hover {
    background: rgba(255, 255, 255, 0.25);
}

.profile-initials {
    width: 32px;
    height: 32px;
    background: white;
    color: #4A5FC1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
}

/* Profile dropdown */
.profile-dropdown {
    position: relative;
}

.profile-dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 45px;
    background: white;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    border-radius: 12px;
    min-width: 220px;
    z-index: 1001;
    overflow: hidden;
    border: 1px solid #E5E7EB;
}

.profile-dropdown-content.show {
    display: block;
    animation: dropdownSlide 0.2s ease-out;
}

@keyframes dropdownSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* User info section in dropdown */
.profile-info {
    padding: 16px;
    border-bottom: 1px solid #E5E7EB;
}

.profile-name {
    font-weight: 600;
    color: #1F2937;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.profile-email {
    font-size: 0.85rem;
    color: #6B7280;
}

/* Dropdown actions */
.profile-dropdown-content button,
.profile-dropdown-content a {
    width: 100%;
    background: none;
    border: none;
    padding: 12px 16px;
    text-align: left;
    font-size: 0.9rem;
    color: #374151;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-weight: 500;
    text-decoration: none;
    display: block;
}

.profile-dropdown-content button:hover,
.profile-dropdown-content a:hover {
    background-color: #F3F4F6;
}

.profile-dropdown-content button.logout-btn,
.profile-dropdown-content a.logout-btn {
    color: #DC2626;
}

.profile-dropdown-content button.logout-btn:hover,
.profile-dropdown-content a.logout-btn:hover {
    background-color: #FEE2E2;
}

/* Main Headers - SHARED STYLING */
.main-header, .section-header {
    text-align: center;
    color: #1E3A8A;
    font-size: 2.2rem;
    margin: 3rem 0 1.5rem 0;
    font-weight: 600;
}

/* Class count badge - match navbar blue */
.class-count {
    background: #4A5FC1; /* Match navbar color */
    color: white;
    padding: 6px 16px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(74, 95, 193, 0.3);
}


/* Semester badge - softer neutral color */
.semester-badge {
    background: #E5E7EB; /* Light gray, almost white */
    color: #374151; /* Darker text for contrast */
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Button Styles - SHARED BUTTONS */
.button-container {
    text-align: center;
    margin: 2.5rem 0;
}

.button-container a, 
.button-container button,
.create-button,
a.create-button,
button.create-button {
    background: #4A5FC1; /* Match navbar color */
    color: white;
    padding: 14px 28px;
    text-decoration: none;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(74, 95, 193, 0.3);
    display: inline-block;
    vertical-align: middle;
    text-align: center;
    line-height: 1;
    font-family: inherit;
}

.button-container a:hover, 
.button-container button:hover,
.create-button:hover,
a.create-button:hover,
button.create-button:hover {
    background: #3D4FA8; /* Slightly darker on hover */
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(74, 95, 193, 0.4);
    text-decoration: none;
}

.button-container button:disabled,
button.create-button:disabled {
    background: #94A3B8;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 4px rgba(148, 163, 184, 0.2);
}

/* Dropdown Styles - SHARED DROPDOWNS (for card dropdowns, not navbar) */
.dropdown {
    position: absolute;
    top: 16px;
    right: 16px;
}

.dropbtn {
    background: none;
    border: none;
    color: #9CA3AF;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.dropbtn:hover {
    background: #F9FAFB;
    color: #6B7280;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 35px;
    background: white;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    border-radius: 12px;
    z-index: 10;
    width: 180px;
    border: 1px solid #DBEAFE;
    overflow: hidden;
}

.dropdown-content button {
    width: 100%;
    background: none;
    border: none;
    padding: 12px 16px;
    text-align: left;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-weight: 500;
}

.dropdown-content button:hover {
    background-color: #EFF6FF;
    color: #1E3A8A;
}

/* Modal Styles - SHARED MODALS */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    margin: 10% auto;
    padding: 32px;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    text-align: center;
    position: relative;
    z-index: 1601;
    border: 1px solid #DBEAFE;
}

.modal-content h3 {
    color: #1E3A8A;
    font-weight: 600;
    margin-bottom: 24px;
    font-size: 1.5rem;
}

.modal-content label {
    display: block;
    margin-top: 16px;
    font-weight: 600;
    color: #1E3A8A;
    margin-bottom: 8px;
}

.modal-content input[type="text"],
.modal-content textarea,
.modal-content select {
    width: 100%;
    padding: 12px 16px;
    margin: 16px 0;
    border-radius: 12px;
    border: 2px solid #DBEAFE;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.modal-content input[type="text"]:focus,
.modal-content textarea:focus,
.modal-content select:focus {
    outline: none;
    border-color: #1E40AF;
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.modal-content .submit-btn {
    background: #4A5FC1; /* Match navbar color */
    color: white;
    padding: 12px 24px;
    margin-top: 20px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(74, 95, 193, 0.3);
}

.modal-content .submit-btn:hover {
    background: #3D4FA8;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(74, 95, 193, 0.4);
}

.close {
    position: absolute;
    top: 16px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    color: #9CA3AF;
    transition: color 0.3s ease;
}

.close:hover {
    color: #6B7280;
}

/* Flash Messages - SHARED */
.flash-container {
    position: fixed;
    top: 70px; /* Adjusted for thinner navbar */
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 500px;
    z-index: 2000;
    pointer-events: none;
}

.flash {
    padding: 16px 24px 16px 52px;
    margin-bottom: 12px;
    border-radius: 14px;
    color: white;
    font-size: 0.95rem;
    font-weight: 500;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    animation: slideInDown 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    backdrop-filter: blur(10px);
    pointer-events: auto;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    min-height: 56px;
}

.flash::before {
    content: '';
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.flash.fade-out {
    animation: slideOutUp 0.4s cubic-bezier(0.36, 0, 0.66, -0.56) forwards;
}

/* Success Flash - Green */
.flash-success { 
    background: linear-gradient(135deg, #16A34A 0%, #15803D 100%);
}

.flash-success::before {
    content: '✓';
    font-size: 20px;
    font-weight: bold;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    width: 28px;
    height: 28px;
}

/* Danger/Error Flash - Red */
.flash-danger, .flash-error { 
    background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%);
}

.flash-danger::before, .flash-error::before {
    content: '✕';
    font-size: 20px;
    font-weight: bold;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    width: 28px;
    height: 28px;
}

/* Info/Neutral Flash - Blue */
.flash-info { 
    background: linear-gradient(135deg, #1E40AF 0%, #1E3A8A 100%);
}

.flash-info::before {
    content: 'i';
    font-size: 18px;
    font-weight: bold;
    font-style: italic;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    width: 28px;
    height: 28px;
}

/* Warning Flash - Red (since no orange/yellow in palette) */
.flash-warning { 
    background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%);
}

.flash-warning::before {
    content: '!';
    font-size: 20px;
    font-weight: bold;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    width: 28px;
    height: 28px;
}

/* Progress bar animation */
.flash::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 0 0 14px 14px;
    animation: progressBar 4s linear forwards;
}

@keyframes slideInDown {
    from { 
        opacity: 0; 
        transform: translateY(-30px) scale(0.95);
    }
    to   { 
        opacity: 1; 
        transform: translateY(0) scale(1);
    }
}

@keyframes slideOutUp {
    from { 
        opacity: 1; 
        transform: translateY(0) scale(1);
    }
    to   { 
        opacity: 0; 
        transform: translateY(-30px) scale(0.95);
    }
}

@keyframes progressBar {
    from { width: 100%; }
    to { width: 0%; }
}

/* Form Input Styling - SHARED */
select, input[type="text"], textarea {
    font-family: inherit;
}

select {
    background: white;
    cursor: pointer;
}

select:focus, input:focus, textarea:focus {
    outline: none;
    border-color: #1E40AF;
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

/* Checkbox styling - SHARED */
.checkbox-group {
    text-align: left;
    margin-bottom: 20px;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #1E40AF;
    margin-right: 8px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    color: #374151;
    transition: opacity 0.2s;
    cursor: pointer;
}

.checkbox-group label:hover {
    color: #1E3A8A;
}

/* Container Styles - SHARED GRID LAYOUT */
.container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
    padding: 0 8%;
    margin: 3rem 0 4rem 0;
    align-items: start;
    max-width: 1800px;
    margin-left: auto;
    margin-right: auto;
}

/* Single column on smaller screens */
@media (max-width: 900px) {
    .container {
        grid-template-columns: 1fr;
        padding: 0 5%;
    }
}

/* Card Styles - SHARED CARD COMPONENTS */
.card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: white;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #DBEAFE;
    transition: all 0.3s ease;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(to right, #DC2626 0%, white 33%, white 66%, #1E40AF 100%);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    border-color: #93C5FD;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 3%;
    }
    
    .navbar {
        padding: 0.75rem 1rem;
    }
    
    .navbar-left a {
        font-size: 0.85rem;
        padding: 0.5rem 0.75rem;
    }
}

@media (max-width: 600px) {
    .flash-container {
        width: 95%;
        top: 60px;
    }
    
    .flash {
        padding: 14px 20px 14px 48px;
        font-size: 0.9rem;
    }
}
