/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: #f0f2f5;
    color: #333;
    font-size: 16px;
    line-height: 1.5;
    padding: 20px;
    min-height: 100vh;
}

/* Container styles */
.container {
    max-width: 1000px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    padding: 25px;
}

/* Header styles */
h1 {
    text-align: center;
    color: #1a73e8;
    font-size: 28px;
    margin-bottom: 25px;
    font-weight: 600;
}

/* Camera section */
.camera-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.webcam-container {
    width: 640px;
    height: 480px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background: #000;
    border: 3px solid #fff;
}

#webcam {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Status box */
.status-box {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    text-align: center;
    width: 100%;
    max-width: 640px;
}

#status {
    font-size: 28px;
    margin-bottom: 10px;
    font-weight: 600;
}

#confidence {
    font-size: 28px;
    color: #666;
}

/* Status indicators */
.present {
    color: #28a745;
    background: #e8f5e9;
    padding: 5px 12px;
    border-radius: 6px;
    border: 1px solid #c8e6c9;
}

.absent {
    color: #dc3545;
    background: #ffebee;
    padding: 5px 12px;
    border-radius: 6px;
    border: 1px solid #ffcdd2;
}

/* Attendance records */
.attendance-records {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

h2 {
    color: #1a73e8;
    font-size: 22px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.record-container {
    overflow-y: auto;
    max-height: 350px;
}

/* Table styles */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
    font-size: 15px;
}

th {
    background: #f8f9fa;
    font-weight: 600;
    color: #444;
    position: sticky;
    top: 0;
    z-index: 10;
}

tr:hover td {
    background: #f5f9ff;
}

/* Scrollbar styling */
.record-container::-webkit-scrollbar {
    width: 6px;
}

.record-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.record-container::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.record-container::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Responsive styles */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 15px;
    }

    .webcam-container {
        width: 100%;
        height: auto;
        aspect-ratio: 4/3;
    }

    h1 {
        font-size: 24px;
    }

    #status {
        font-size: 25px;
    }

    #confidence {
        font-size: 18px;
    }

    th, td {
        padding: 10px;
        font-size: 20px;
    }

    .status-box {
        padding: 25px;
    }
}

/* Loading and transition states */
.initializing {
    color: #666;
    font-style: italic;
}

.status-box, .present, .absent {
    transition: all 0.3s ease;
}

/* Print styles */
@media print {
    body {
        background: white;
        padding: 0;
    }

    .container {
        box-shadow: none;
    }

    .webcam-container {
        display: none;
    }

    .record-container {
        max-height: none;
    }
}