/**
 * EduStream Pro - Professional Academic UI
 * Clean, institutional design for university software
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
    color: #2c3e50;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Header Styles - Professional Academic */
.header {
    background: #1a365d;
    color: white;
    padding: 1.25rem 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-bottom: 3px solid #2c5282;
}

.header h1 {
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.3px;
    color: white;
    margin-bottom: 0.25rem;
}

.header .subtitle {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 400;
}

.header a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: color 0.2s;
    font-weight: 500;
}

.header a:hover {
    color: white;
    text-decoration: underline;
}

/* Container Styles */
.container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.card {
    background: white;
    border-radius: 4px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    margin-bottom: 1.5rem;
    border: 1px solid #e2e8f0;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #2c3e50;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="date"],
.form-group input[type="time"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 0.9375rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: white;
    color: #2c3e50;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

.login-form {
    max-width: 100%;
}

/* Button Styles - Professional */
.btn {
    padding: 0.625rem 1.5rem;
    font-size: 0.9375rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    font-size: 0.8125rem;
}

.btn-primary {
    background: #3182ce;
    color: white;
}

.btn-primary:hover {
    background: #2c5282;
    box-shadow: 0 2px 4px rgba(49, 130, 206, 0.3);
}

.btn-success {
    background: #38a169;
    color: white;
}

.btn-success:hover {
    background: #2f855a;
    box-shadow: 0 2px 4px rgba(56, 161, 105, 0.3);
}

.btn-danger {
    background: #e53e3e;
    color: white;
}

.btn-danger:hover {
    background: #c53030;
    box-shadow: 0 2px 4px rgba(229, 62, 62, 0.3);
}

.btn-warning {
    background: #dd6b20;
    color: white;
}

.btn-warning:hover {
    background: #c05621;
    box-shadow: 0 2px 4px rgba(221, 107, 32, 0.3);
}

.btn-secondary {
    background: #718096;
    color: white;
}

.btn-secondary:hover {
    background: #4a5568;
    box-shadow: 0 2px 4px rgba(113, 128, 150, 0.3);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

/* Alert Styles */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.alert-error {
    background: #fed7d7;
    color: #742a2a;
    border-left-color: #e53e3e;
}

.alert-success {
    background: #c6f6d5;
    color: #22543d;
    border-left-color: #38a169;
}

/* Dashboard Styles */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #e2e8f0;
    flex-wrap: wrap;
    gap: 1rem;
}

.dashboard-header h2 {
    color: #1a202c;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* Classes List */
.classes-list {
    display: grid;
    gap: 1rem;
}

.class-item {
    background: white;
    padding: 1.5rem;
    border-radius: 4px;
    border-left: 4px solid #3182ce;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.class-item:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
    border-left-color: #2c5282;
}

.class-info h3 {
    color: #1a202c;
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.class-info p {
    color: #718096;
    font-size: 0.875rem;
    margin: 0.25rem 0;
}

.class-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Lectures Grid */
.lectures-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.lecture-card {
    background: white;
    padding: 1.5rem;
    border-radius: 4px;
    border-left: 4px solid #38a169;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.lecture-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.lecture-card.active {
    border-left-color: #38a169;
}

.lecture-card.blacklisted {
    border-left-color: #e53e3e;
    opacity: 0.7;
}

.lecture-card h3 {
    color: #1a202c;
    margin-bottom: 0.75rem;
    font-size: 1.125rem;
    font-weight: 600;
}

.lecture-card p {
    color: #718096;
    font-size: 0.875rem;
    margin: 0.4rem 0;
}

.lectures-list {
    display: grid;
    gap: 1rem;
}

.lecture-item {
    background: white;
    padding: 1.5rem;
    border-radius: 4px;
    border-left: 4px solid #3182ce;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.lecture-item:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.lecture-item h3 {
    color: #1a202c;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.lecture-item p {
    color: #718096;
    font-size: 0.875rem;
    margin: 0.3rem 0;
}

/* Students List */
.students-list {
    display: grid;
    gap: 0.75rem;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.students-list::-webkit-scrollbar {
    width: 6px;
}

.students-list::-webkit-scrollbar-track {
    background: #f7fafc;
}

.students-list::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.students-list::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

.student-item {
    background: #f7fafc;
    padding: 1rem 1.25rem;
    border-radius: 4px;
    border-left: 3px solid #3182ce;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
    border: 1px solid #e2e8f0;
}

.student-item:hover {
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border-left-color: #2c5282;
}

.student-info {
    flex: 1;
}

.student-name {
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 0.25rem;
    font-size: 0.9375rem;
}

.student-details {
    font-size: 0.8125rem;
    color: #718096;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-present {
    background: #c6f6d5;
    color: #22543d;
}

.status-absent {
    background: #fed7d7;
    color: #742a2a;
}

.student-actions {
    display: flex;
    gap: 0.5rem;
}

/* Classroom Styles - Professional */
.classroom-container {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 1.5rem;
}

.video-section {
    background: white;
    border-radius: 4px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    border: 1px solid #e2e8f0;
}

.video-container {
    position: relative;
    width: 100%;
    height: 600px;
    background: #1a202c;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
    border: 1px solid #2d3748;
}

.video-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a202c;
    color: white;
}

#localVideo {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 220px;
    height: 165px;
    border-radius: 4px;
    border: 3px solid white;
    object-fit: cover;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

#remoteVideo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-controls {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    align-items: center;
}

#cameraSelect {
    padding: 0.625rem 1rem;
    font-size: 0.9375rem;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    background: white;
    color: #2d3748;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    min-width: 180px;
}

#cameraSelect:hover {
    border-color: #2c5282;
    background: #f7fafc;
}

#cameraSelect:focus {
    outline: none;
    border-color: #2c5282;
    box-shadow: 0 0 0 3px rgba(44, 82, 130, 0.1);
}

.classroom-sidebar {
    background: white;
    border-radius: 4px;
    padding: 1.5rem;
    height: fit-content;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    border: 1px solid #e2e8f0;
}

.classroom-sidebar h3 {
    color: #1a202c;
    margin-bottom: 1.25rem;
    font-size: 1.125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e2e8f0;
}

.attendance-info {
    background: #f7fafc;
    padding: 1.25rem;
    border-radius: 4px;
    margin-top: 1rem;
    font-size: 0.875rem;
    color: #4a5568;
    border: 1px solid #e2e8f0;
}

.attendance-info p {
    margin: 0.75rem 0;
    font-weight: 500;
}

.attendance-info strong {
    color: #2d3748;
    font-weight: 600;
    display: inline-block;
    min-width: 80px;
}

/* Modal Styles - Professional */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: auto;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 2.5rem;
    border-radius: 4px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    border: 1px solid #e2e8f0;
}

.close {
    color: #718096;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.close:hover,
.close:focus {
    color: #2d3748;
}

/* Table Styles - Professional */
.attendance-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.attendance-table th {
    background: #1a365d;
    color: white;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.attendance-table td {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    background: white;
    font-size: 0.875rem;
}

.attendance-table tr:hover td {
    background: #f7fafc;
}

.attendance-table tr:last-child td {
    border-bottom: none;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .classroom-container {
        flex-direction: column;
        height: auto;
    }
    
    .classroom-sidebar {
        max-width: none;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .classroom-container {
        flex-direction: column;
        height: auto;
    }
    
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .class-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .class-actions {
        width: 100%;
        margin-top: 1rem;
    }
    
    .student-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .student-actions {
        width: 100%;
        margin-top: 0.5rem;
    }
    
    .lecture-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .video-container {
        height: 400px;
    }
    
    #localVideo {
        width: 150px;
        height: 112px;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 2rem;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.hidden {
    display: none;
}

/* Loading Spinner - Professional */
.spinner {
    border: 3px solid #e2e8f0;
    border-top: 3px solid #3182ce;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 0.8s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Selection Color */
::selection {
    background: rgba(49, 130, 206, 0.2);
    color: #1a202c;
}

/* Focus Visible */
*:focus-visible {
    outline: 2px solid #3182ce;
    outline-offset: 2px;
    border-radius: 2px;
}

/* Classroom Layout */
.classroom-container {
    display: flex;
    gap: 1.5rem;
    height: calc(100vh - 100px);
}

.video-section {
    flex: 3;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.video-container {
    flex: 1;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.video-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a202c;
    z-index: 10;
}

.video-controls {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    justify-content: center;
}

.classroom-sidebar {
    flex: 1;
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    width: 350px;
    border: 1px solid #e2e8f0;
}

.students-list {
    flex: 1;
    overflow-y: auto;
    margin-top: 1rem;
}

.student-item {
    padding: 0.75rem;
    border-bottom: 1px solid #edf2f7;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.student-info {
    font-size: 0.9rem;
}

.student-name {
    font-weight: 600;
    color: #2d3748;
}

.student-details {
    font-size: 0.8rem;
    color: #718096;
}

.status-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 9999px;
    background: #edf2f7;
    color: #4a5568;
}

.status-absent {
    background: #fed7d7;
    color: #c53030;
}

.attendance-info p {
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}
