@import url('https://fonts.googleapis.com/css2?family=Inter:wght=300;400;500;600;700&display=swap');

/* --- Dynamic Theme Variables --- */
:root {
    /* Light Mode (Default) */
    --bg-main: #f8fafc;
    --bg-container: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-element: #e2e8f0;
    --bg-badge: #f8fafc;
    --bg-tab: #f1f5f9;
    --bg-card: #ffffff;
    
    /* Institutional Color Blueprint */
    --primary: #0f172a;       /* Deep Corporate Navy */
    --accent: #0ea5e9;        /* Premium Teal/Blue */
    --accent-hover: #0284c7;
    --radius-lg: 12px;
    --radius-md: 8px;
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.05), 0 10px 10px -5px rgba(0,0,0,0.02);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
}

/* --- Dark Mode Variables Matrix --- */
[data-theme="dark"] {
    --bg-main: #090d16;
    --bg-container: #111827;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border-element: #1f2937;
    --bg-badge: #1f2937;
    --bg-tab: #1f2937;
    --bg-card: #1f2937;
    --primary: #38bdf8;       /* Adapt primary highlights for contrast */
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.15s ease; 
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
}

/* --- Teacher-Grade Split Screen Layout --- */
.auth-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.auth-sidebar {
    flex: 1;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #ffffff;
    padding: 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.brand-title {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 15px;
    color: #ffffff;
}

.brand-desc {
    color: #94a3b8;
    font-size: 16px;
    margin-bottom: 40px;
    line-height: 1.6;
}

.feature-list { list-style: none; }
.feature-item { margin-bottom: 20px; font-size: 15px; color: #cbd5e1; display: flex; align-items: center; }
.feature-item::before {
    content: "✓";
    color: #0ea5e9; /* Kept fixed accent for visibility */
    font-weight: bold;
    margin-right: 12px;
    font-size: 18px;
}

.auth-content-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background-color: var(--bg-main);
}

.auth-card {
    background: var(--bg-container);
    width: 100%;
    max-width: 420px;
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-element);
}

/* --- Typography --- */
h2 {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 24px;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 25px;
}

/* --- Form Fields & Inputs --- */
.form-group {
    text-align: left;
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

input[type="text"], input[type="email"], input[type="password"], textarea {
    width: 100%;
    padding: 12px 14px;
    font-family: inherit;
    font-size: 14px;
    color: var(--text-primary);
    background-color: var(--bg-container);
    border: 1px solid var(--border-element);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

input:focus, textarea:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

/* --- Buttons --- */
.btn {
    background: #0f172a;
    color: #ffffff;
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    width: 100%;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    transition: all 0.2s ease;
}
[data-theme="dark"] .btn:not(.btn-accent) {
    background: #1f2937;
    border: 1px solid var(--border-element);
}

.btn-accent { background: #0ea5e9; color: #ffffff; }
.btn-accent:hover { background: var(--accent-hover); }

/* --- Premium Custom File Upload Architecture --- */
.upload-zone-wrapper {
    position: relative;
    width: 100%;
}

.upload-dropzone {
    border: 2px dashed #cbd5e1;
    background: var(--bg-main);
    padding: 35px 20px;
    border-radius: var(--radius-md);
    text-align: center;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
[data-theme="dark"] .upload-dropzone { border-color: #374151; }

.upload-dropzone:hover {
    border-color: #0ea5e9;
    background: rgba(14, 165, 233, 0.04);
}

.hidden-file-input {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.upload-icon-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    pointer-events: none;
}
.upload-icon-label strong { color: #0ea5e9; }

/* --- Modular Layout Components (Header / Footer / Profile) --- */
.container {
    max-width: 1140px;
    width: 100%;
    margin: 40px auto;
    background: var(--bg-container);
    padding: 30px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-element);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}

.header-flex { 
    display: flex; 
    flex-direction: column;
    gap: 20px;
    border-bottom: 1px solid var(--border-element); 
    padding-bottom: 20px; 
    margin-bottom: 25px; 
}

.brand-area h1 {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    width: 100%;
    justify-content: space-between;
}

/* Dark Mode Switch Trigger */
.theme-toggle-btn {
    background: var(--bg-badge);
    border: 1px solid var(--border-element);
    color: var(--text-primary);
    padding: 10px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    box-shadow: var(--shadow-sm);
}
.theme-toggle-btn:hover { border-color: #0ea5e9; }

/* Responsive Profile Badge Component */
.user-profile-badge { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    background: var(--bg-badge); 
    padding: 8px 14px; 
    border-radius: var(--radius-md); 
    border: 1px solid var(--border-element); 
    box-shadow: var(--shadow-sm);
}

.avatar-icon {
    width: 32px;
    height: 32px;
    background-color: #e0f2fe;
    border-radius: 50%;
    border: 2px solid #0ea5e9;
}
[data-theme="dark"] .avatar-icon { background-color: #0c4a6e; }

.user-info { display: flex; flex-direction: column; }
.user-label { font-size: 10px; text-transform: uppercase; font-weight: 700; color: var(--text-secondary); }
.user-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }

.btn-logout { 
    font-size: 12px;
    color: #b91c1c; 
    background: #fef2f2;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #fca5a5;
    text-decoration: none; 
    font-weight: 600; 
}
[data-theme="dark"] .btn-logout { background: #451a1a; color: #fca5a5; border-color: #7f1d1d; }

/* --- Navigation System Interface --- */
.nav-tabs { display: flex; flex-wrap: wrap; gap: 6px; background: var(--bg-tab); padding: 6px; border-radius: var(--radius-md); margin-bottom: 25px; border: 1px solid var(--border-element); }
.tab-btn { flex: 1 1 120px; padding: 10px 12px; border: none; background: transparent; color: var(--text-secondary); border-radius: 6px; cursor: pointer; font-weight: 600; font-size: 13px; text-align: center; }
.tab-btn.active { background: var(--bg-container); color: #0ea5e9; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* --- Grid Systems & Panels --- */
.partner-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; margin-top: 20px; }
.card { background: var(--bg-card); padding: 24px; border-radius: var(--radius-md); border: 1px solid var(--border-element); box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.tags { background: var(--bg-tab); color: var(--text-primary); padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 500; border: 1px solid var(--border-element); margin-right: 5px; display: inline-block; }

/* --- Institutional Data Arrays --- */
.table-responsive { width: 100%; overflow-x: auto; margin-top: 15px; border-radius: var(--radius-md); border: 1px solid var(--border-element); }
.admin-table { width: 100%; border-collapse: collapse; text-align: left; }
.admin-table th, .admin-table td { padding: 14px 16px; font-size: 14px; color: var(--text-primary); }
.admin-table th { background: var(--bg-tab); font-weight: 600; border-bottom: 2px solid var(--border-element); }
.admin-table td { background: var(--bg-container); border-bottom: 1px solid var(--border-element); }
.btn-delete { color: #b91c1c; text-decoration: none; font-weight: 600; }

/* --- System Alerts --- */
.alert { padding: 12px 14px; border-radius: var(--radius-md); margin-bottom: 20px; font-size: 13px; font-weight: 500; }
.alert.error { background: #fef2f2; color: #991b1b; border: 1px solid #fca5a5; }
.alert.success { background: #ecfdf5; color: #065f46; border: 1px solid #6ee7b7; }
.auth-footer { margin-top: 20px; font-size: 13px; color: var(--text-secondary); text-align: center; }
.auth-footer a { color: #0ea5e9; text-decoration: none; font-weight: 600; }

/* --- Professional Feedback Modal Popups --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
}
.modal-overlay.active { opacity: 1; visibility: visible; }

.success-modal-card {
    background: var(--bg-container);
    border: 1px solid var(--border-element);
    max-width: 400px;
    width: 90%;
    padding: 30px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    text-align: center;
    transform: scale(0.85);
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-overlay.active .success-modal-card { transform: scale(1); }

.success-checkmark {
    width: 52px;
    height: 52px;
    background: #ecfdf5;
    border: 2px solid #10b981;
    color: #10b981;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: bold;
    margin: 0 auto 15px auto;
}
[data-theme="dark"] .success-checkmark { background: #064e3b; }

.modal-title { font-size: 20px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
.modal-message { font-size: 14px; color: var(--text-secondary); margin-bottom: 24px; line-height: 1.5; }
.btn-modal-close {
    background: #10b981;
    color: #ffffff;
    border: none;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    width: 100%;
}
.btn-modal-close:hover { background: #059669; }

/* --- Modular Footer Area --- */
.main-footer {
    margin-top: 50px;
    padding-top: 20px;
    border-top: 1px solid var(--border-element);
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
}

/* --- Responsive Layout Optimization Engine --- */
@media (min-width: 768px) {
    .header-flex { flex-direction: row; justify-content: space-between; align-items: center; }
    .header-controls { width: auto; justify-content: flex-end; }
}

@media (max-width: 768px) {
    .auth-sidebar { display: none; }
    .nav-tabs { flex-direction: column; }
}
/* ==========================================
   Modern Dropdown (Select) Styling 
   ========================================== */

.form-group select {
    width: 100%;
    padding: 12px 40px 12px 16px; /* Right padding handles custom arrow space */
    font-size: 15px;
    font-family: inherit;
    color: #333333;
    background-color: #ffffff;
    border: 1px solid #dcdcdc;
    border-radius: 6px;
    box-sizing: border-box;
    transition: all 0.3s ease;
    cursor: pointer;
    
    /* Default browser arrow ko remove karne ke liye */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    
    /* Custom clean arrow icon placement (SVG background) */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
}

/* Dropdown Focus State (Hover or Click) */
.form-group select:focus {
    outline: none;
    border-color: #007bff; /* Aapke theme ka accent color yahan use karein */
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

/* Disabled Placeholder Option Color Styling */
.form-group select:invalid,
.form-group select option[value=""] {
    color: #888888;
}

/* Dropdown ke andar ke Options Layout */
.form-group select option {
    color: #333333;
    background-color: #ffffff;
    padding: 12px;
}
/* Common Box Styling for all pages */
.custom-box { 
    background: #fff; 
    padding: 25px; 
    border-radius: 8px; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.05); 
    margin-bottom: 30px; 
    border: 1px solid #e9ecef; 
}
.custom-box h3 { margin-top: 0; color: #007bff; border-bottom: 2px solid #f1f3f5; padding-bottom: 10px; }
.brand-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.site-logo {
    width: 45px;
    height: 45px;
    object-fit: contain;
}