/* attendance.css - Premium Attendance Modal Styles */

.attendance-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    animation: fadeIn 0.3s ease-out;
}

.attendance-modal.open {
    display: flex;
}

.attendance-card {
    background: white;
    width: 100%;
    max-width: 500px;
    border-radius: 32px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.attendance-modal.open .attendance-card {
    transform: translateY(0);
}

.attendance-header {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    padding: 2rem;
    text-align: center;
    color: white;
}

.attendance-header h3 {
    margin: 0;
    font-family: 'Yeseva One', cursive;
    font-size: 1.75rem;
    letter-spacing: -0.5px;
}

.attendance-header p {
    margin: 0.5rem 0 0;
    opacity: 0.9;
    font-size: 0.95rem;
}

.attendance-body {
    padding: 2rem;
}

.camera-container {
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #0f172a;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: inset 0 0 40px rgba(0,0,0,0.5);
}

#attendanceVideo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1); /* Mirror view */
}

#attendanceCanvas {
    display: none;
}

.camera-overlay {
    position: absolute;
    inset: 0;
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    margin: 20px;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.camera-overlay::after {
    content: '';
    width: 200px;
    height: 200px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
}

.attendance-actions {
    display: flex;
    gap: 1rem;
}

.btn-capture {
    flex: 1;
    background: #1e3a8a;
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 16px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-capture .btn-text {
    color: white !important;
}

.btn-capture:hover {
    background: #1e40af;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(30, 58, 138, 0.3);
}

.btn-capture:active {
    transform: translateY(0);
}

.btn-cancel {
    padding: 1rem 1.5rem;
    background: #f1f5f9;
    color: #64748b;
    border: none;
    border-radius: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel:hover {
    background: #e2e8f0;
    color: #475569;
}

.capture-flash {
    position: absolute;
    inset: 0;
    background: white;
    opacity: 0;
    pointer-events: none;
    z-index: 10;
}

.capture-flash.active {
    animation: flashEffect 0.5s ease-out;
}

@keyframes flashEffect {
    0% { opacity: 0; }
    10% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
    display: none;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.btn-capture.loading .loading-spinner {
    display: block;
}

.btn-capture.loading .btn-text {
    display: none;
}

.btn-capture.loading .btn-icon {
    display: none;
}
