/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

h1 {
    color: #2c3e50;
    font-size: 1.8rem;
}

.header-right {
    display: flex;
    align-items: center;
}

.time-display {
    background-color: #2c3e50;
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    font-size: 1.2rem;
    font-weight: bold;
    margin-right: 15px;
}

.user-controls {
    display: flex;
    align-items: center;
}

#user-info {
    display: flex;
    align-items: center;
}

#user-info.hidden, 
.hidden {
    display: none !important;
}

#welcome-message {
    margin-right: 10px;
}

/* Button Styles */
.btn {
    padding: 8px 15px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
    border: none;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid #e0e0e0;
    color: #666;
}

.btn-outline:hover {
    background-color: #f5f5f5;
}

.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn + .btn {
    margin-left: 10px;
}

/* Auth View Styles */
#auth-view, #admin-view {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.auth-container {
    padding: 30px;
    max-width: 600px;
    margin: 0 auto;
}

.tabs {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 20px;
}

.tab {
    padding: 10px 20px;
    cursor: pointer;
    font-weight: 600;
    color: #666;
}

.tab.active {
    color: #3498db;
    border-bottom: 2px solid #3498db;
}

.form-container {
    padding: 20px 0;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: #3498db;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.checkbox-label input {
    margin-right: 10px;
}

.form-actions {
    margin-top: 30px;
    display: flex;
    justify-content: flex-end;
}

.error-message, .success-message {
    padding: 10px;
    border-radius: 4px;
    margin-top: 20px;
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.success-message {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Admin View Styles */
.admin-container {
    padding: 30px;
}

.admin-container .tabs {
    justify-content: center;
    margin-bottom: 30px;
}

.tab-content {
    margin-bottom: 30px;
}

.admin-container h2 {
    margin-bottom: 20px;
    color: #2c3e50;
    text-align: center;
}

.register-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

@media (min-width: 900px) {
    .register-container {
        grid-template-columns: 1fr 1fr;
    }
}

.face-capture-container {
    position: relative;
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 4/3;
}

#register-video, #register-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#register-overlay {
    z-index: 10;
}

.instructions {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    font-size: 0.9rem;
    text-align: center;
    z-index: 20;
}

.list-container {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.date-filter {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    justify-content: center;
}

.date-filter label {
    margin-right: 10px;
}

.date-filter input[type="date"] {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-right: 10px;
}

.admin-controls {
    margin-top: 20px;
    justify-content: center;
}

/* Main Content Styles */
main {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 900px) {
    main {
        grid-template-columns: 2fr 1fr;
    }
    
    .camera-container {
        grid-row: span 2;
    }
}

/* Camera Container Styles */
.camera-container {
    position: relative;
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 3 / 5;
}

#video, #overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#overlay {
    z-index: 10;
}

#loading-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 15px 20px;
    border-radius: 5px;
    z-index: 20;
}

/* Detection Status Styles */
.detection-status {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

#status-indicator {
    padding: 15px;
    border-radius: 5px;
    text-align: center;
    margin-bottom: 15px;
    font-weight: bold;
}

.status-idle {
    background-color: #f0f0f0;
    color: #666;
}

.status-detecting {
    background-color: #fff3cd;
    color: #856404;
}

.status-success {
    background-color: #d4edda;
    color: #155724;
}

#employee-info {
    text-align: center;
    padding: 15px;
    border-top: 1px solid #eee;
}

#employee-name {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 5px;
}

#capture-time {
    color: #666;
}

/* Attendance Log Styles */
.attendance-log {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.attendance-log h2 {
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 1.2rem;
}

#log-container {
    max-height: 300px;
    overflow-y: auto;
}

.log-entry {
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-name {
    font-weight: bold;
}

.log-time {
    color: #666;
    font-size: 0.9rem;
}

.log-empty {
    color: #999;
    text-align: center;
    padding: 20px 0;
}

/* Footer Styles */
footer {
    margin-top: 30px;
    text-align: center;
    color: #777;
    font-size: 0.9rem;
}

/* Animation for face detection */
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(76, 175, 80, 0); }
    100% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0); }
}

.face-detected {
    animation: pulse 1.5s infinite;
}
