/* Custom Styles for Smart Attendance System */

/* General Styles */
body {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
}

main {
    flex: 1 0 auto;
}

/* Header Adjustments */
nav .brand-logo {
    font-size: 1.5rem;
}

nav .brand-logo i {
    vertical-align: middle;
    margin-right: 5px;
}

/* Cards */
.card {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.card-title i {
    vertical-align: middle;
}

/* Stat Cards */
.card h3 {
    margin: 10px 0;
    font-weight: 300;
}

/* Camera Feed */
#video-container {
    position: relative;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

#camera-feed {
    display: none;
    width: 100%;
    height: auto;
}

#face-overlay {
    border: 3px solid #2196F3;
    border-radius: 50%;
}

/* Buttons */
.btn, .btn-large, .btn-small {
    border-radius: 4px;
    text-transform: none;
    font-weight: 500;
}

.btn i, .btn-large i, .btn-small i {
    vertical-align: middle;
}

/* Collection */
.collection .collection-item {
    display: flex;
    align-items: center;
}

.collection .collection-item i {
    margin-right: 10px;
}

/* Badges */
.badge {
    border-radius: 12px;
    padding: 4px 12px;
}

/* Progress Bar */
.progress {
    background-color: rgba(33, 150, 243, 0.2);
}

.progress .indeterminate {
    background-color: #2196F3;
}

.progress .determinate {
    background-color: #4CAF50;
}

/* Messages */
.card-panel.success {
    background-color: #4CAF50;
}

.card-panel.error {
    background-color: #F44336;
}

.card-panel.warning {
    background-color: #FF9800;
}

.card-panel.info {
    background-color: #2196F3;
}

/* HTMX Loading States */
.htmx-request {
    opacity: 0.7;
    pointer-events: none;
}

.htmx-swapping {
    opacity: 0;
    transition: opacity 0.2s;
}

.htmx-settling {
    opacity: 1;
    transition: opacity 0.2s;
}

/* Responsive Video */
@media only screen and (max-width: 600px) {
    #video-container {
        max-width: 100%;
    }

    nav .brand-logo {
        font-size: 1.2rem;
        left: 50%;
        transform: translateX(-50%);
    }

    .card h3 {
        font-size: 2rem;
    }
}

/* Status Indicators */
.status-online {
    color: #4CAF50;
}

.status-offline {
    color: #F44336;
}

.status-pending {
    color: #FF9800;
}

/* Chip Styles */
.chip {
    border-radius: 16px;
    font-size: 0.9em;
}

/* Table Responsive */
@media only screen and (max-width: 992px) {
    table.responsive-table {
        font-size: 0.9em;
    }
}

/* Footer Adjustments */
.page-footer {
    padding-top: 20px;
}

.page-footer ul {
    list-style: none;
    padding: 0;
}

.page-footer ul li {
    margin-bottom: 8px;
}

/* Animation for Success/Error Messages */
@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.card-panel.success,
.card-panel.error,
.card-panel.warning,
.card-panel.info {
    animation: slideInDown 0.3s ease-out;
}

/* Liveness Check Animations */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.liveness-active {
    animation: pulse 1s infinite;
}

/* Loading Spinner Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    background: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

/* PWA Install Button */
.install-pwa-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #2196F3;
    color: white;
    padding: 16px;
    display: none;
    z-index: 1000;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.2);
}

.install-pwa-banner.show {
    display: block;
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus Styles */
a:focus, button:focus, input:focus {
    outline: 2px solid #2196F3;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    nav, footer, .no-print {
        display: none;
    }

    .card {
        break-inside: avoid;
    }
}
