/* =============================================================================
   PLAYER CONTAINER
   ============================================================================= */

.player-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 1.5rem;
    background: #1b1f26;
    border-radius: 12px;
    min-height: calc(100vh - 2rem);
}

/* =============================================================================
   AUDIO PLAYER SECTION
   ============================================================================= */

.audio-player-section {
    flex-shrink: 0;
    margin-bottom: 1rem;
    padding: 1.5rem;
    border-radius: 0.5rem;
    background: linear-gradient(135deg, var(--g-start) 0%, var(--g-mid) 50%, var(--g-end) 100%);
    border: 1px solid var(--bg-3);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

/* =============================================================================
   PLAYER HEADER
   ============================================================================= */

.player-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--bg-3);
}

.player-avatar {
    width: 5rem;
    height: 5rem;
    background: var(--bg-3);
    border-radius: 0.175rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    flex-shrink: 0;
    overflow: hidden;
    color: #9CA3AF;
    font-size: 1.25rem;
}

.player-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0.25rem;
}

.player-info {
    flex: 1;
}

.player-lecturer {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
    color: #F9FAFB;
    line-height: 1.2;
}

.player-topic {
    color: #9CA3AF;
    margin: 0 0 0.25rem 0;
    font-size: 0.875rem;
    line-height: 1.3;
}

.player-meta {
    color: #6B7280;
    font-size: 0.75rem;
}

/* =============================================================================
   NOW PLAYING TITLE
   ============================================================================= */

.now-playing {
    margin-bottom: 1.5rem;
    overflow: hidden;
    position: relative;
    width: 100%;
    height: 1.5rem;
}

.now-playing-title {
    margin: 0;
    white-space: nowrap;
    color: #F9FAFB;
    font-size: 1.125rem;
    font-weight: 500;
    line-height: 1.3;
    display: inline-block;
    position: relative;
    --move-distance: 0px;
}

.now-playing-title.scrolling {
    animation: slide-infinite 30s linear infinite;
}

@keyframes slide-infinite {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(var(--move-distance));
    }
}

/* =============================================================================
   EQUALIZER VISUALIZER
   ============================================================================= */

.equalizer-visualizer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    height: 160px;
    padding: 0;
    margin: 0.5rem 0;
    background: transparent;
    border-radius: 0;
    border: none;
    gap: 3px;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

.frequency-band {
    display: flex;
    flex-direction: column-reverse;
    justify-content: flex-start;
    align-items: center;
    height: 100%;
    flex: 1;
    gap: 2px;
    min-width: 0;
}

.eq-bar {
    width: 100%;
    height: 6px;
    border-radius: 1px;
    opacity: 0.05;
    transition: opacity 0.15s ease, background-color 0.15s ease;
}

/* Bar colors - modern player style */
.eq-bar.bar-1,
.eq-bar.bar-2,
.eq-bar.bar-3,
.eq-bar.bar-4,
.eq-bar.bar-5 {
    background: #10b981; /* Green for bass */
}

.eq-bar.bar-6,
.eq-bar.bar-7,
.eq-bar.bar-8,
.eq-bar.bar-9,
.eq-bar.bar-10,
.eq-bar.bar-11,
.eq-bar.bar-12,
.eq-bar.bar-13,
.eq-bar.bar-14,
.eq-bar.bar-15 {
    background: var(--brand); /* Orange for mids */
}

.eq-bar.bar-16,
.eq-bar.bar-17,
.eq-bar.bar-18,
.eq-bar.bar-19,
.eq-bar.bar-20 {
    background: #3b82f6; /* Blue for treble */
}

/* Active state */
.eq-bar.active {
    opacity: 1;
    /* box-shadow: 0 0 6px currentColor; */
}

/* Animation for bars */
.equalizer-visualizer.playing .eq-bar {
    animation: eq-pulse 0.15s ease-in-out;
}

@keyframes eq-pulse {
    0% { 
        transform: scaleY(0.9); 
        opacity: 0.4;
    }
    50% { 
        transform: scaleY(1.2); 
        opacity: 1;
    }
    100% { 
        transform: scaleY(1); 
        opacity: 0.7;
    }
}

/* =============================================================================
   PLAYER CONTROLS
   ============================================================================= */

.player-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.btn-control {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    border: none;
    background: var(--bg-2);
    color: #F9FAFB;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.125rem;
    transition: all 0.2s ease;
}

.btn-control:hover { 
    background: #4B5563; 
}

.btn-play-pause {
    background: var(--brand);
    width: 4rem;
    height: 4rem;
    font-size: 1.5rem;
}

.btn-play-pause.loading {
    background: var(--bg-2);
    color: #fff !important;
}

.btn-play-pause:disabled {
    color: #fff !important;
    cursor: not-allowed;
    opacity: 0.7;
}

.btn-play-pause.loading i {
    font-size: 12px !important;
    font-style: normal !important;
    color: #fff !important;
}

/* =============================================================================
   PLAYER PROGRESS
   ============================================================================= */

.player-progress {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(17, 24, 39, 0.5);
    border-radius: 0.375rem;
    border: 1px solid rgba(75, 85, 99, 0.3);
    margin-bottom: 1.5rem;
}

.time-current,
.time-total {
    color: #9CA3AF;
    font-size: 0.875rem;
    font-family: 'SF Mono', Monaco, monospace;
    min-width: 2.5rem;
}

.progress-bar {
    flex: 1;
    height: 1rem;
    background: #0f0f0f;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border: 1px solid rgba(75, 85, 99, 0.5);
}

.progress-buffer {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(107, 114, 128, 0.4);
    background-image: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.2) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.2) 75%,
        transparent 75%,
        transparent
    );
    background-size: 1rem 1rem;
    animation: progress-bar-stripes 1s linear infinite;
    width: 0%;
    z-index: 1;
    transition: width 0.3s ease-out;
}

.progress-filled {
    height: 100%;
    background: rgba(249, 115, 22, 0.8);
    background-image: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.2) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.2) 75%,
        transparent 75%,
        transparent
    );
    background-size: 1rem 1rem;
    animation: progress-bar-stripes 1s linear infinite;
    width: 0%;
    position: relative;
    z-index: 2;
    border-radius: inherit;
    transition: width 0.3s ease-out;
}

@keyframes progress-bar-stripes {
    from { background-position: 1rem 0; }
    to   { background-position: 0 0; }
}

/* =============================================================================
   PLAYER DIVIDER
   ============================================================================= */

.player-divider {
    width: 100%;
    height: 1px;
    background: var(--bg-3);
    margin: 1.5rem 0 1rem 0;
}

/* =============================================================================
   PLAYER ACTIONS SECTION
   ============================================================================= */

.player-actions-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.player-actions-section .file-size {
    color: #9CA3AF;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.player-actions-section .player-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.player-actions-section .action-btn {
    background: none;
    border: none;
    color: #6B7280;
    font-size: 14px;
    cursor: pointer;
    padding: 0.375rem;
    border-radius: 0.375rem;
    min-width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.player-actions-section .action-btn:hover {
    color: #374151;
    background: rgba(107, 114, 128, 0.1);
}

.player-actions-section .download-btn:hover {
    color: #059669;
    background: rgba(5, 150, 105, 0.1);
}

.player-actions-section .share-btn:hover {
    color: #7c3aed;
    background: rgba(124, 58, 237, 0.1);
}

.player-actions-section .favorite-btn {
    background: none;
    border: none;
    color: #6B7280;
    font-size: 16px;
    cursor: pointer;
    padding: 0.375rem;
    border-radius: 0.375rem;
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.player-actions-section .favorite-btn:hover {
    color: #dc2626;
    background: rgba(220, 38, 38, 0.1);
}

.player-actions-section .favorite-btn.active {
    color: #f97316;
}

.player-actions-section .favorite-btn.active:hover {
    color: #ea580c;
}

/* =============================================================================
   PLAYER BOTTOM CONTROLS SECTION
   ============================================================================= */

.player-bottom-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--g-start) 0%, var(--g-mid) 50%, var(--g-end) 100%);
    border: 1px solid var(--bg-3);
    border-radius: 0.5rem;
    margin-bottom: 2rem;
}

.file-size {
    color: #9CA3AF;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.player-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.action-btn {
    background: none;
    border: none;
    color: #6B7280;
    font-size: 14px;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.action-btn:hover {
    color: #374151;
    background: rgba(107, 114, 128, 0.1);
}

.download-btn:hover {
    color: #059669;
    background: rgba(5, 150, 105, 0.1);
}

.share-btn:hover {
    color: #7c3aed;
    background: rgba(124, 58, 237, 0.1);
}

.favorite-btn {
    background: none;
    border: none;
    color: #6B7280;
    font-size: 16px;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.favorite-btn:hover {
    color: #dc2626;
    background: rgba(220, 38, 38, 0.1);
}

.favorite-btn.active {
    color: #f97316;
}

.favorite-btn.active:hover {
    color: #ea580c;
}

/* =============================================================================
   MARKERS SECTION
   ============================================================================= */

.markers-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1.5rem 0 1rem 0;
}

.markers-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: #9CA3AF;
    margin: 0;
}

.add-marker-btn {
    background: var(--brand);
    border: none;
    color: white;
    padding: 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    cursor: pointer;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.add-marker-btn:hover {
    background: #ea580c;
}

.markers-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.marker-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(75, 85, 99, 0.2);
    transition: all 0.2s ease;
    cursor: pointer;
}

.marker-item:hover {
    background: rgba(17, 24, 39, 0.3);
    margin: 0 -0.5rem;
    padding: 0.5rem;
    border-radius: 0.25rem;
    border-bottom: 1px solid rgba(75, 85, 99, 0.2);
}

.marker-timestamp {
    background: var(--brand);
    color: white;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.625rem;
    font-weight: 600;
    font-family: 'SF Mono', Monaco, monospace;
    flex-shrink: 0;
    min-width: 3rem;
    text-align: center;
}

.marker-text {
    color: #F9FAFB;
    font-size: 0.75rem;
    line-height: 1.3;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.marker-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    opacity: 1;
    transition: opacity 0.2s ease;
}

.marker-item:hover .marker-actions {
    opacity: 1;
}

.marker-action-btn {
    background: none;
    border: none;
    color: #6B7280;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    font-size: 0.7rem;
    transition: all 0.2s ease;
    width: 1.25rem;
    height: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.marker-action-btn:hover {
    background: rgba(107, 114, 128, 0.2);
}

.marker-edit-btn:hover {
    color: #3b82f6;
}

.marker-delete-btn:hover {
    color: #ef4444;
}

/* =============================================================================
   MARKER INPUT STYLES
   ============================================================================= */

.marker-input {
    background: transparent;
    border: none;
    color: #F9FAFB;
    font-size: 0.75rem;
    padding: 0;
    flex: 1;
    outline: none;
}

.marker-input:focus {
    border: none;
    box-shadow: none;
}

.marker-input::placeholder {
    color: #6B7280;
}

/* Save/Cancel button styles for new/editing markers */
.marker-save-btn {
    color: #10b981 !important;
}

.marker-save-btn:hover {
    color: #059669 !important;
    background: rgba(16, 185, 129, 0.1) !important;
}

.marker-cancel-btn {
    color: #ef4444 !important;
}

.marker-cancel-btn:hover {
    color: #dc2626 !important;
    background: rgba(239, 68, 68, 0.1) !important;
}

/* Enhanced marker item styles for editing state */
.marker-item.editing {
    background: rgba(17, 24, 39, 0.5);
    margin: 0 -0.5rem;
    padding: 0.5rem;
    border-radius: 0.25rem;
    border-bottom: 1px solid rgba(75, 85, 99, 0.2);
}

/* =============================================================================
   MOBILE RESPONSIVE STYLES
   ============================================================================= */

@media (max-width: 768px) {
    /* Player Container */
    .player-container {
        margin: 0;
        padding: 0.75rem;
    }

    /* Audio Player Section */
    .audio-player-section {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
    }

    /* Player Header */
    .player-header {
        margin-bottom: 1rem;
    }
    
    .player-avatar {
        width: 4rem;
        height: 4rem;
        font-size: 1.125rem;
    }
    
    .player-lecturer {
        font-size: 1.125rem;
    }
    
    .player-topic {
        font-size: 0.75rem;
    }
    
    .player-meta {
        font-size: 0.625rem;
    }

    /* Now Playing */
    .now-playing {
        margin-bottom: 1rem;
        height: 1.25rem;
    }
    
    .now-playing-title {
        font-size: 1rem;
    }

    /* Player Controls */
    .player-controls { 
        gap: 0.5rem; 
        margin-bottom: 0.75rem; 
    }
    
    .btn-control { 
        width: 2.75rem; 
        height: 2.75rem; 
        font-size: 1rem; 
    }
    
    .btn-play-pause { 
        width: 2.75rem; 
        height: 2.75rem; 
        font-size: 1.125rem; 
    }

    /* Player Progress */
    .player-progress { 
        gap: 0.5rem; 
        padding: 0.5rem;
        margin-bottom: 1rem;
    }
    
    .time-current, .time-total { 
        font-size: 0.75rem; 
        min-width: 2rem; 
    }
    
    .progress-bar { 
        height: 0.625rem; 
    }

    /* Player Divider */
    .player-divider {
        margin: 1rem 0 0.75rem 0;
    }

    /* Player Actions Section */
    .player-actions-section {
        gap: 0.75rem;
    }

    .player-actions-section .file-size {
        font-size: 0.75rem;
    }

    .player-actions-section .player-actions {
        gap: 0.125rem;
    }

    .player-actions-section .action-btn {
        font-size: 12px;
        min-width: 24px;
        height: 24px;
        padding: 0.25rem;
    }

    .player-actions-section .favorite-btn {
        font-size: 14px;
        min-width: 28px;
        height: 28px;
        padding: 0.25rem;
    }

    /* Player Bottom Controls */
    .player-bottom-controls {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 0.75rem;
        padding: 0.75rem;
        margin-bottom: 1.5rem;
    }

    .file-size {
        font-size: 0.75rem;
    }

    .player-actions {
        gap: 0.375rem;
        flex-wrap: wrap;
    }

    .action-btn {
        font-size: 12px;
        padding: 0.375rem;
    }

    .action-btn span {
        display: none;
    }

    .favorite-btn {
        font-size: 14px;
        padding: 0.375rem;
    }

    .favorite-btn span {
        display: none;
    }

    /* Markers Section Mobile */
    .markers-header {
        margin: 1rem 0 0.75rem 0;
    }

    .markers-title {
        font-size: 0.75rem;
    }

    .add-marker-btn {
        width: 1.25rem;
        height: 1.25rem;
        font-size: 0.625rem;
    }

    .markers-list {
        gap: 0.375rem;
        margin-bottom: 0.75rem;
    }

    .marker-item {
        gap: 0.5rem;
        padding: 0.375rem 0;
    }

    .marker-item:hover {
        margin: 0 -0.375rem;
        padding: 0.375rem;
    }

    .marker-timestamp {
        font-size: 0.6rem;
        padding: 0.125rem 0.25rem;
        min-width: 2.5rem;
        border-radius: 0;
    }

    .marker-text {
        font-size: 0.625rem;
    }

    .marker-action-btn {
        width: 1rem;
        height: 1rem;
        font-size: 0.7rem;
        padding: 0.125rem;
    }

    .marker-actions {
        opacity: 1;
    }

    /* Marker Input Mobile */
    .marker-input {
        font-size: 0.625rem;
        padding: 0.125rem 0.25rem;
    }
    
    .marker-item {
        gap: 0.375rem;
        padding: 0.25rem 0;
    }
    
    .marker-item.editing {
        margin: 0 -0.375rem;
        padding: 0.375rem;
    }
}
