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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #f5f5f7;
    color: #1d1d1f;
    min-height: 100vh;
    -webkit-tap-highlight-color: transparent;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    gap: 20px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    padding: 24px;
    overflow: hidden;
}

/* Header */
.header {
    text-align: center;
    padding: 10px 0;
}

h1 {
    font-size: 28px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 4px;
}

.subtitle {
    font-size: 16px;
    color: #86868b;
    font-weight: 400;
}

/* Service Selector */
.service-selector,
.audio-controls {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e9ecef;
}

h2 {
    font-size: 18px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 16px;
}

.service-buttons,
.audio-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.service-btn,
.audio-btn {
    padding: 16px 20px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
    color: #1d1d1f;
    border: 1px solid #e1e5e9;
    -webkit-appearance: none;
    appearance: none;
}

.service-btn:hover,
.audio-btn:hover {
    background: #f1f3f4;
    border-color: #d1d5d9;
    transform: translateY(-1px);
}

.service-btn.active,
.audio-btn.active {
    background: linear-gradient(135deg, #007AFF 0%, #0056CC 100%);
    color: white;
    border-color: #007AFF;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.2);
}

/* Video Container */
.video-container {
    position: relative;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    background: black;
    aspect-ratio: 16/9;
}

#ab-video-player {
    width: 100%;
    height: 100%;
    background: #000;
}

/* Status Display */
.status-display {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #e9ecef;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.status-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.status-label {
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-value {
    font-size: 18px;
    font-weight: 600;
    color: #1d1d1f;
}

.status-separator {
    color: #6c757d;
    margin: 0 6px;
}

/* Video.js customizations */
.video-js {
    font-size: 16px;
}

.video-js .vjs-big-play-button {
    background: rgba(0, 122, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 80px;
    height: 80px;
    line-height: 80px;
    margin-left: -40px;
    margin-top: -40px;
    font-size: 35px;
    transition: all 0.2s ease;
}

.video-js .vjs-big-play-button:hover {
    background: rgba(0, 122, 255, 1);
    transform: scale(1.05);
}

.video-js .vjs-control-bar {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    height: 48px;
    padding: 0 12px;
}

.video-js .vjs-progress-control {
    height: 28px;
    padding-top: 6px;
}

/* Loading state */
.video-js.vjs-waiting .vjs-loading-spinner {
    display: block;
}

.video-js .vjs-loading-spinner {
    border-color: rgba(0, 122, 255, 0.7);
}

.video-js .vjs-loading-spinner:before,
.video-js .vjs-loading-spinner:after {
    border-color: rgba(0, 122, 255, 0.7);
}

/* ===== RESPONSIVE DESIGN ===== */

/* Desktop (1024px and up) */
@media (min-width: 1024px) {
    .container {
        max-width: 1000px;
        padding: 32px;
        gap: 24px;
    }
    
    h1 {
        font-size: 32px;
    }
    
    .subtitle {
        font-size: 18px;
    }
    
    h2 {
        font-size: 20px;
    }
    
    .service-buttons,
    .audio-buttons {
        gap: 20px;
    }
    
    .service-btn,
    .audio-btn {
        padding: 18px 24px;
        font-size: 17px;
    }
    
    .status-display {
        grid-template-columns: repeat(4, 1fr);
        gap: 24px;
        padding: 28px;
    }
    
    .status-label {
        font-size: 13px;
    }
    
    .status-value {
        font-size: 20px;
    }
    
    .video-container {
        border-radius: 16px;
        box-shadow: 0 12px 48px rgba(0,0,0,0.15);
    }
}

/* Tablet (768px to 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    body {
        padding: 16px;
    }
    
    .container {
        max-width: 800px;
        padding: 24px;
    }
    
    h1 {
        font-size: 26px;
    }
    
    .subtitle {
        font-size: 15px;
    }
    
    .status-display {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile (767px and below) - FULL WIDTH */
@media (max-width: 767px) {
    body {
        padding: 0;
        background: white;
        align-items: stretch;
    }
    
    .container {
        max-width: 100%;
        margin: 0;
        border-radius: 0;
        box-shadow: none;
        padding: 16px;
        gap: 16px;
        min-height: 100vh;
    }
    
    h1 {
        font-size: 22px;
    }
    
    .subtitle {
        font-size: 14px;
    }
    
    h2 {
        font-size: 16px;
        margin-bottom: 12px;
    }
    
    .service-selector,
    .audio-controls {
        padding: 16px;
        border-radius: 10px;
    }
    
    .service-buttons,
    .audio-buttons {
        gap: 12px;
    }
    
    .service-btn,
    .audio-btn {
        padding: 14px;
        font-size: 15px;
    }
    
    .video-container {
        border-radius: 10px;
        aspect-ratio: 16/9;
    }
    
    .status-display {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 20px;
        border-radius: 10px;
    }
    
    .status-label {
        font-size: 11px;
    }
    
    .status-value {
        font-size: 16px;
    }
    
    .video-js .vjs-big-play-button {
        width: 70px;
        height: 70px;
        line-height: 70px;
        margin-left: -35px;
        margin-top: -35px;
        font-size: 30px;
    }
    
    .video-js .vjs-control-bar {
        height: 44px;
        padding: 0 10px;
    }
}

/* Small Mobile (480px and below) */
@media (max-width: 480px) {
    .container {
        padding: 12px;
        gap: 12px;
    }
    
    h1 {
        font-size: 20px;
    }
    
    .service-selector,
    .audio-controls {
        padding: 14px;
    }
    
    .service-btn,
    .audio-btn {
        padding: 12px;
        font-size: 14px;
    }
    
    .status-display {
        padding: 16px;
    }
    
    .video-js .vjs-big-play-button {
        width: 60px;
        height: 60px;
        line-height: 60px;
        margin-left: -30px;
        margin-top: -30px;
        font-size: 25px;
    }
    
    .video-js .vjs-control-bar {
        height: 40px;
    }
}

/* iOS safe areas for mobile only */
@media (max-width: 767px) {
    @supports (padding: max(0px)) {
        .container {
            padding-left: max(16px, env(safe-area-inset-left));
            padding-right: max(16px, env(safe-area-inset-right));
            padding-top: max(16px, env(safe-area-inset-top));
            padding-bottom: max(16px, env(safe-area-inset-bottom));
        }
    }
}

/* Touch-friendly controls for mobile */
@media (max-width: 767px) {
    .video-js .vjs-slider {
        height: 6px;
    }
    
    .video-js .vjs-progress-control {
        height: 30px;
    }
    
    .video-js .vjs-progress-holder {
        margin: 0 10px;
    }
    
    .service-btn,
    .audio-btn {
        min-height: 52px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Hover effects only on desktop */
@media (min-width: 768px) {
    .service-btn:hover:not(.active),
    .audio-btn:hover:not(.active) {
        background: #f1f3f4;
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    }
    
    .service-btn.active:hover,
    .audio-btn.active:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(0, 122, 255, 0.3);
    }
}
