/**
 * Frontend Playlist Styles for PSM Legacy Vault Interface
 */

/* Main Container */
.psm-lv-playlist-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Month/Year Navigation */
.psm-lv-month-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 20px;
}

.psm-lv-month-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.psm-lv-month-btn:hover {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

.psm-lv-month-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.psm-lv-current-month {
    text-align: center;
    font-size: 18px;
    color: #333;
    min-width: 150px;
}

/* Player Area */
.psm-lv-player-area {
    margin-bottom: 30px;
}

.psm-lv-player-wrapper {
    position: relative;
    width: 100%;
    min-height: 360px;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.psm-lv-player-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.psm-lv-placeholder-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Audio Player */
.psm-lv-audio-element {
    display: none;
}

.psm-lv-custom-audio-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.7) 70%, transparent 100%);
    padding: 20px;
    z-index: 10;
}

.psm-lv-audio-progress-bar {
    position: relative;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    cursor: pointer;
    margin-bottom: 10px;
}

.psm-lv-audio-progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: #2271b1;
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s linear;
}

.psm-lv-audio-progress-handle {
    position: absolute;
    top: 50%;
    left: 0%;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    transition: left 0.1s linear;
}

.psm-lv-audio-time {
    display: flex;
    justify-content: space-between;
    color: #fff;
    font-size: 12px;
    font-family: monospace;
}

/* Video Player */
.psm-lv-vimeo-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    width: 100%;
}

.psm-lv-vimeo-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Now Playing Info */
.psm-lv-now-playing {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-top: 15px;
}

.psm-lv-current-title {
    margin: 0 0 10px 0;
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

.psm-lv-current-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.psm-lv-meta-type,
.psm-lv-meta-duration {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    background: #fff;
    border-radius: 4px;
    font-size: 14px;
    color: #666;
}

.psm-lv-meta-type .dashicons {
    margin-right: 5px;
}

.psm-lv-meta-excerpt {
    width: 100%;
    margin-top: 10px;
    color: #666;
    line-height: 1.6;
}

/* Playlist Items */
.psm-lv-playlist-items {
    margin-bottom: 20px;
}

.psm-lv-playlist-title {
    margin: 0 0 15px 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.psm-lv-items-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.psm-lv-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: all 0.3s ease;
}

.psm-lv-item:last-child {
    border-bottom: none;
}

.psm-lv-item:hover {
    background: #f8f9fa;
}

.psm-lv-item.psm-lv-active {
    background: #e7f3ff;
}

.psm-lv-item.psm-lv-playing .psm-lv-item-icon .dashicons {
    color: #2271b1;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.psm-lv-item-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    border-radius: 50%;
    margin-right: 15px;
}

.psm-lv-item-icon .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: #666;
}

.psm-lv-item-content {
    flex: 1;
    min-width: 0;
}

.psm-lv-item-title {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.psm-lv-item-duration {
    font-size: 12px;
    color: #999;
}

.psm-lv-item-action {
    flex-shrink: 0;
    margin-left: 15px;
}

.psm-lv-play-btn {
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.psm-lv-play-btn:hover {
    background: #135e96;
    transform: scale(1.1);
}

.psm-lv-play-btn .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* Player Controls */
.psm-lv-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.psm-lv-control-btn {
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.psm-lv-control-btn:hover {
    background: #135e96;
    transform: scale(1.1);
}

.psm-lv-control-btn:active {
    transform: scale(0.95);
}

.psm-lv-control-btn .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.psm-lv-play-pause-btn {
    width: 60px;
    height: 60px;
}

/* Error Messages */
.psm-lv-error,
.psm-lv-empty {
    padding: 40px;
    text-align: center;
    color: #999;
}

.psm-lv-error p,
.psm-lv-empty p {
    margin: 0;
    font-size: 16px;
}

/* Single Item Display */
.psm-lv-single-item {
    max-width: 800px;
    margin: 0 auto;
}

.psm-lv-single-item h3 {
    margin: 0 0 20px 0;
    font-size: 28px;
    font-weight: 600;
}

.psm-lv-single-item audio,
.psm-lv-single-item .psm-lv-vimeo-wrapper {
    margin-bottom: 20px;
}

.psm-lv-item-description {
    line-height: 1.8;
    color: #333;
}

/* Responsive Design */
@media (max-width: 768px) {
    .psm-lv-playlist-container {
        padding: 15px;
    }

    .psm-lv-player-wrapper {
        min-height: 240px;
    }

    .psm-lv-current-title {
        font-size: 20px;
    }

    .psm-lv-item {
        padding: 12px;
    }

    .psm-lv-item-title {
        font-size: 14px;
    }

    .psm-lv-control-btn {
        width: 45px;
        height: 45px;
    }

    .psm-lv-play-pause-btn {
        width: 55px;
        height: 55px;
    }
}

@media (max-width: 480px) {
    .psm-lv-playlist-container {
        padding: 10px;
    }

    .psm-lv-player-wrapper {
        min-height: 200px;
    }

    .psm-lv-current-title {
        font-size: 18px;
    }

    .psm-lv-item-icon {
        width: 35px;
        height: 35px;
        margin-right: 10px;
    }

    .psm-lv-play-btn {
        width: 35px;
        height: 35px;
    }

    .psm-lv-control-btn {
        width: 40px;
        height: 40px;
    }

    .psm-lv-play-pause-btn {
        width: 50px;
        height: 50px;
    }
}

/* Scrollbar Styling */
.psm-lv-items-list::-webkit-scrollbar {
    width: 8px;
}

.psm-lv-items-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 8px;
}

.psm-lv-items-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 8px;
}

.psm-lv-items-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}
