/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #f4f7fe;
    color: #333;
    line-height: 1.6;
    height: 100vh;
    overflow: hidden;
}

/* Application layout */
.app-container {
    display: flex;
    height: 100vh;
}

/* Logo styles */
.logo {
    display: flex;
    align-items: center;
}

.logo-icon {
    font-size: 26px;
    margin-right: 10px;
    color: #3498db;
}

.logo h1 {
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
}

.logo span {
    color: #3498db;
}

.app-version {
    font-size: 12px;
    color: #7f8c8d;
}

/* Main content styles */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Top bar styles */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.page-title {
    display: flex;
    align-items: center;
}

.subtitle {
    font-size: 14px;
    color: #7f8c8d;
    margin-left: 20px;
}

/* Dashboard content */
.dashboard-content {
    flex: 1;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    overflow-y: auto;
}

/* Video section */
.video-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.video-container {
    width: 100%;
    height: 0;
    padding-bottom: 30%; /* 16:9 aspect ratio */
    max-width: 800px;
    margin: 0 auto;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    position: relative;
    background-color: #000;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
}

.tracking-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #e74c3c;
    margin-right: 8px;
}

.tracking .dot {
    background: #2ecc71;
}

.pulse-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 2px solid rgba(52, 152, 219, 0.5);
    opacity: 0;
    pointer-events: none;
}

.tracking .pulse-circle {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0.8;
    }
    70% {
        opacity: 0;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0;
    }
}

#videoStream {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.video-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 10px;
}

.action-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 160px;
}

.action-btn i {
    font-size: 16px;
}

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

.start-btn {
    background-color: #2ecc71;
    color: white;
}

.stop-btn {
    background-color: #e74c3c;
    color: white;
}

.start-btn:hover:not(:disabled) {
    background-color: #27ae60;
}

.stop-btn:hover:not(:disabled) {
    background-color: #c0392b;
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.stat-card {
    background-color: #fff;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    display: flex;
    gap: 15px;
    align-items: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background-color: rgba(52, 152, 219, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon i {
    font-size: 22px;
    color: #3498db;
}

.stat-details {
    flex: 1;
}

.stat-title {
    font-size: 14px;
    color: #7f8c8d;
    font-weight: 500;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
}

/* Status colors */
.status-attentive {
    color: #2ecc71;
}

.status-not-attentive {
    color: #e74c3c;
}

.status-not-tracking {
    color: #7f8c8d;
}

/* Progress bar styles */
.progress-container {
    background-color: #edf2f7;
    border-radius: 8px;
    height: 10px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    text-align: center;
    color: white;
    font-weight: 500;
    font-size: 10px;
    line-height: 10px;
    transition: width 0.3s ease;
}

/* Circular progress */
.progress-ring-container {
    display: flex;
    justify-content: center;
    margin-top: 5px;
}

.progress-ring {
    position: relative;
    width: 70px;
    height: 70px;
}

.progress-circle {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(#3498db var(--progress), #edf2f7 0);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.progress-circle::before {
    content: '';
    position: absolute;
    width: 84%;
    height: 84%;
    top: 8%;
    left: 8%;
    background: white;
    border-radius: 50%;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
}

/* Summary section */
.summary-section {
    background-color: #fff;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #edf2f7;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.summary-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background-color: #f8fafc;
    border-radius: 10px;
}

.summary-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background-color: rgba(52, 152, 219, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.summary-icon i {
    font-size: 18px;
}

.summary-card:nth-child(1) .summary-icon i {
    color: #2ecc71;
}

.summary-card:nth-child(2) .summary-icon i {
    color: #e74c3c;
}

.summary-card:nth-child(3) .summary-icon i {
    color: #f39c12;
}

.summary-details h4 {
    font-size: 14px;
    color: #7f8c8d;
    font-weight: 500;
    margin-bottom: 5px;
}

.summary-details p {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

/* Responsive design */
@media (max-width: 992px) {
    .stats-grid, .summary-cards {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .video-container {
        max-width: 700px;
    }
}

@media (max-width: 768px) {
    .stats-grid, .summary-cards {
        grid-template-columns: 1fr;
    }
    
    .top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .app-version {
        width: 100%;
        text-align: right;
        margin-top: 10px;
    }
    
    .video-container {
        max-width: 100%;
        padding-bottom: 75%; /* 4:3 aspect ratio for smaller screens */
    }
    
    .subtitle {
        margin-left: 0;
        margin-top: 5px;
    }
    
    .page-title {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Animation for startup */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.dashboard-content > * {
    animation: fadeIn 0.5s ease forwards;
}

.dashboard-content > *:nth-child(1) { animation-delay: 0.1s; }
.dashboard-content > *:nth-child(2) { animation-delay: 0.2s; }
.dashboard-content > *:nth-child(3) { animation-delay: 0.3s; }

/* Add these styles to your CSS file */
.tracking #trackingStatus {
    background-color: rgba(46, 204, 113, 0.2);
    border: 1px solid rgba(46, 204, 113, 0.5);
}

.tracking #trackingStatus .dot {
    animation: blinkGreen 1.5s infinite;
}

@keyframes blinkGreen {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}