.controls {
    margin-top: 24px;
    margin-bottom: 24px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #000000 0%, #999999 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    color: white;
}

.header {
    text-align: center;
    margin-bottom: 0;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 15px;
}

.instructions {
    background: rgba(255,255,255,0.1);
    padding: 10px 15px;
    border-radius: 10px;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    max-width: 500px;
    margin: 0 auto;
}

.camera-container {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    max-width: 100%;
    max-height: 80vh;
}

#videoElement {
    display: block;
    max-width: 100%;
    max-height: 70vh;
    width: auto;
    height: auto;
    transform: scaleX(-1);
}

#canvasElement {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    transform: scaleX(-1);
}

.controls {
    margin-top: 20px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    background: rgba(255,255,255,0.2);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.3);
    min-width: 120px;
}

.btn:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

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

.status {
    margin-top: 15px;
    padding: 10px 20px;
    background: rgba(0,0,0,0.2);
    border-radius: 15px;
    text-align: center;
    font-weight: 500;
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
}

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

.pose-info {
    margin-top: 15px;
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.info-card {
    background: rgba(255,255,255,0.1);
    padding: 10px 15px;
    border-radius: 10px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

.info-card .label {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-bottom: 5px;
}

.info-card .value {
    font-size: 1.2rem;
    font-weight: bold;
}

.posture-display {
    margin-top: 20px;
    background: rgba(255,255,255,0.1);
    padding: 20px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    max-width: 400px;
    width: 100%;
}

.posture-status-large {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
}

.status-icon {
    font-size: 3rem;
    transition: all 0.3s ease;
}

.status-text {
    flex: 1;
}

.status-title {
    font-size: 1.4rem;
    font-weight: bold;
    margin-bottom: 5px;
    transition: color 0.3s ease;
}

.status-subtitle {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Posture status colors */
.posture-display.good .status-title {
    color: #6bcf7f;
}

.posture-display.good .status-icon {
    filter: hue-rotate(0deg);
}

.posture-display.fair .status-title {
    color: #ffd93d;
}

.posture-display.fair .status-icon {
    filter: hue-rotate(0deg);
}

.posture-display.poor .status-title {
    color: #ff6b6b;
}

.posture-display.poor .status-icon {
    filter: hue-rotate(0deg);
    animation: shake 0.5s infinite;
}

.posture-timer {
    background: rgba(255, 107, 107, 0.2);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid rgba(255, 107, 107, 0.3);
}

.timer-label {
    font-size: 0.9rem;
    margin-bottom: 5px;
    opacity: 0.9;
}

.timer-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ff6b6b;
    margin-bottom: 10px;
}

.timer-bar {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
    overflow: hidden;
}

.timer-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffd93d, #ff6b6b);
    transition: width 0.3s ease;
    border-radius: 4px;
}

.posture-status.good .value {
    color: #6bcf7f;
}

.posture-status.fair .value {
    color: #ffd93d;
}

.posture-status.poor .value {
    color: #ff6b6b;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

.posture-alert {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 107, 107, 0.95);
    padding: 15px 20px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 30px rgba(255, 107, 107, 0.3);
    z-index: 1000;
    animation: slideIn 0.3s ease-out, pulse 2s infinite;
    max-width: 300px;
}

.alert-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.alert-icon {
    font-size: 2rem;
    animation: bounce 1s infinite;
}

.alert-title {
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.alert-message {
    font-size: 0.9rem;
    opacity: 0.9;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 10px 30px rgba(255, 107, 107, 0.3); }
    50% { box-shadow: 0 10px 30px rgba(255, 107, 107, 0.6); }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-5px); }
    60% { transform: translateY(-3px); }
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn {
        width: 100%;
        max-width: 200px;
    }

    .pose-info {
        flex-direction: column;
        gap: 10px;
    }
}