/* Header Styles */
.dj-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 20px 50px 20px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease, background 0.3s ease;
    /* Don't transition padding - it causes intermediate values */
    /* Ensure it stays on top */
    will-change: transform;
    transform: translateZ(0); /* Force hardware acceleration and new stacking context */
    box-sizing: border-box; /* Include padding in width */
    width: 100%;
    max-width: 100vw; /* Prevent horizontal overflow */
}

.dj-header-shrunk {
    padding: 15px 20px !important;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2) !important;
    min-height: 50px !important;
    height: auto !important;
    overflow: hidden !important; /* Prevent scrollbar */
    overflow-x: hidden !important;
    overflow-y: hidden !important;
    /* Ensure it's visible when collapsed */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
    /* Disable transition for immediate effect */
    transition: none !important;
    box-sizing: border-box !important; /* Include padding in width */
    width: 100% !important;
    max-width: 100vw !important; /* Prevent horizontal overflow */
}

/* Only hide profile when header is shrunk - but allow JavaScript to override when needed */
.dj-header-shrunk .driver-profile-header {
    display: none !important;
}

/* Ensure profile can be shown when header is NOT shrunk */
.dj-header:not(.dj-header-shrunk) .driver-profile-header {
    display: block !important;
}

.dj-header-shrunk .logo {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 !important; /* Force margin reset */
    padding: 0; /* Remove any padding */
    height: auto;
    min-height: 20px; /* Ensure logo has space */
    max-width: 100% !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

.dj-header-shrunk .logo i {
    font-size: 24px;
    color: white;
}

.dj-header-shrunk .logo h1 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    color: white;
    line-height: 1.2; /* Ensure text doesn't get cut off */
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: calc(100vw - 80px) !important; /* Account for icon and padding */
}

.dj-header-content {
    text-align: center;
    margin-bottom: 15px;
    margin-top: 5px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 5px;
}

.logo i {
    font-size: 28px;
    color: #fff;
}

.dj-header h1 {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
}

.tagline {
    font-size: 14px;
    opacity: 0.9;
    font-weight: 300;
}

/* Driver Profile Section */
.driver-profile-header {
    position: relative;
    padding: 0 0 25px 0;
    margin-top: 10px;
    width: 100%;
    min-height: 160px;
}

.driver-photo-container {
    position: absolute;
    left: 0;
    top: 0;
    width: 100px;
    height: 100px;
}

.driver-photo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.driver-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.default-avatar {
    font-size: 48px;
    color: white;
}

.driver-profile-header .driver-info {
    position: absolute;
    left: 115px;
    top: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    height: 160px;
    padding-top: 0px;
}

.driver-name {
    font-size: 35px;
    font-weight: 600;
    color: white;
    margin: 0 0 3px 0;
    line-height: 1.2;
}

.driver-tagline {
    font-size: 20px;
    color: rgba(255, 255, 255, 0.8);
    margin: 0 0 6px 0;
    line-height: 1.3;
}

.driver-vibe {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
    margin-bottom: 10px;
}

.vibe-label {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    flex-shrink: 0;
}

.vibe-genres {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.vibe-genre-tag {
    background: white;
    color: #667eea;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 500;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Playback status + controls */
.dj-playback-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.driver-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    font-size: 13px;
    font-weight: 500;
    min-height: 36px;
}

.driver-status-pill.connected {
    background: rgba(46, 213, 115, 0.2);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #f66;
    box-shadow: 0 0 8px rgba(246, 102, 102, 0.8);
    flex-shrink: 0;
}

.driver-status-pill.connected .status-dot {
    background: #2ed573;
    box-shadow: 0 0 8px rgba(46, 213, 115, 0.8);
}

.driver-control-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.driver-control-buttons.controls-disabled {
    opacity: 0.5;
}

.driver-control-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
}

.driver-control-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.35);
}

.driver-control-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.driver-control-btn.play {
    background: rgba(76, 209, 55, 0.3);
}

.driver-control-btn.pause {
    background: rgba(255, 206, 86, 0.3);
}

.driver-control-btn.skip {
    background: rgba(72, 52, 212, 0.3);
}

@media (max-width: 600px) {
    .dj-playback-panel {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .driver-control-buttons {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 480px) {
    .driver-profile-header {
        gap: 12px;
        padding: 12px;
    }
    
    .driver-photo {
        width: 80px;
        height: 80px;
    }
    
    .default-avatar {
        font-size: 36px;
    }
    
    .driver-name {
        font-size: 28px;
    }
    
    .driver-tagline {
        font-size: 14px;
    }
    
    .vibe-genre-tag {
        font-size: 9px;
        padding: 1px 5px;
    }
}

/* Ensure header container doesn't clip fixed header */
#headerContainer {
    position: static; /* Changed from relative - allows sticky to work properly */
    z-index: 1000; /* Match the header's z-index */
    background: transparent; /* Ensure it doesn't block */
    pointer-events: none; /* Allow clicks to pass through except on header */
}

#headerContainer > * {
    pointer-events: auto; /* Re-enable pointer events on header itself */
}

.container {
    max-width: 100%;
    width: 100%;
    margin: 0;
    background: rgba(255, 255, 255, 0.95);
    min-height: 100vh;
    box-shadow: none;
    position: relative;
    backdrop-filter: blur(10px);
    overflow-x: hidden;
    overflow-y: visible;
    padding: 0;
    border-radius: 0;
    box-sizing: border-box;
    /* Removed transform: scale(0.75) - was breaking sticky positioning */
    /* Ensure content doesn't overlap header */
    z-index: 1; /* Lower than header */
}

