/**
 * Story Audio Player Styles
 *
 * Modern, responsive audio player component for story narration
 * Matches InfoDisplay.ro brand colors and design system
 *
 * @version 1.0.0
 * @since November 2025
 */

/* Container */
.story-audio-player {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
}

.story-audio-player:hover {
    box-shadow: 0 6px 20px rgba(51, 101, 138, 0.15);
    border-color: #33658a;
}

/* Header Section */
.player-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.player-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #33658a 0%, #2c5577 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 24px;
    flex-shrink: 0;
}

.player-title-section {
    flex: 1;
}

.player-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 5px 0;
}

.player-subtitle {
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    color: #7f8c8d;
    margin: 0;
}

/* Controls Section */
.player-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.player-btn {
    background: #33658a;
    color: #ffffff;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.player-btn:hover {
    background: #2c5577;
    transform: scale(1.05);
}

.player-btn:active {
    transform: scale(0.95);
}

.player-btn-play {
    width: 55px;
    height: 55px;
    font-size: 20px;
}

.player-info {
    flex: 1;
    min-width: 0;
}

.player-segment-title {
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-progress-info {
    font-family: 'Poppins', sans-serif;
    font-size: 0.8rem;
    color: #7f8c8d;
}

.player-separator {
    margin: 0 5px;
}

.player-volume {
    flex-shrink: 0;
}

.player-btn-volume {
    width: 40px;
    height: 40px;
    font-size: 16px;
}

/* Progress Bar */
.player-progress-bar {
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    margin-bottom: 20px;
    overflow: hidden;
}

.player-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #33658a 0%, #2c5577 100%);
    border-radius: 3px;
    transition: width 0.1s linear;
}

/* Segments List */
.player-segments {
    max-height: 300px;
    overflow-y: auto;
    margin-top: 15px;
}

.player-segment {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #ffffff;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.player-segment:hover {
    background: #f8f9fa;
    border-color: #33658a;
}

.player-segment.active {
    background: linear-gradient(135deg, #e7f3ff 0%, #d4e9ff 100%);
    border-color: #33658a;
    box-shadow: 0 2px 8px rgba(51, 101, 138, 0.15);
}

.segment-number {
    width: 30px;
    height: 30px;
    background: #33658a;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    flex-shrink: 0;
}

.player-segment.active .segment-number {
    background: #2c5577;
}

.segment-text {
    flex: 1;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    color: #2c3e50;
    line-height: 1.4;
}

.segment-play-btn {
    width: 35px;
    height: 35px;
    background: transparent;
    border: 2px solid #33658a;
    color: #33658a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.segment-play-btn:hover {
    background: #33658a;
    color: #ffffff;
}

.player-segment.active .segment-play-btn {
    background: #33658a;
    color: #ffffff;
}

/* Custom Scrollbar for Segments */
.player-segments::-webkit-scrollbar {
    width: 8px;
}

.player-segments::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.player-segments::-webkit-scrollbar-thumb {
    background: #33658a;
    border-radius: 4px;
}

.player-segments::-webkit-scrollbar-thumb:hover {
    background: #2c5577;
}

/* Empty State */
.story-audio-empty,
.story-audio-error {
    background: #f8f9fa;
    padding: 40px 20px;
    text-align: center;
}

.empty-state,
.error-state {
    color: #7f8c8d;
}

.empty-state i,
.error-state i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state p,
.error-state p {
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    margin: 0;
}

.error-state {
    color: #c42c29;
}

.error-state i {
    color: #c42c29;
}

/* Responsive Design */
@media (max-width: 768px) {
    .story-audio-player {
        padding: 15px;
    }

    .player-header {
        flex-direction: column;
        text-align: center;
    }

    .player-icon {
        width: 60px;
        height: 60px;
        font-size: 28px;
    }

    .player-title {
        font-size: 1.1rem;
    }

    .player-subtitle {
        font-size: 0.85rem;
    }

    .player-controls {
        flex-wrap: wrap;
    }

    .player-info {
        order: 3;
        width: 100%;
        text-align: center;
        margin-top: 10px;
    }

    .player-segment-title {
        white-space: normal;
    }

    .player-segments {
        max-height: 250px;
    }

    .segment-text {
        font-size: 0.85rem;
    }

    .segment-number {
        width: 25px;
        height: 25px;
        font-size: 0.75rem;
    }

    .segment-play-btn {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .player-btn-play {
        width: 50px;
        height: 50px;
        font-size: 18px;
    }

    .player-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .player-btn-volume {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }

    .segment-text {
        font-size: 0.8rem;
    }
}

/* Animation for loading */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.player-loading {
    animation: pulse 1.5s ease-in-out infinite;
}
