/* DTR Podcast Plugin Styles
   Matches theme variables
*/

:root {
    --electric-aqua: #40E3FE;
    --dark-amethyst: #181249;
    --periwinkle: #C5B4EC;
    --dark-ultramarine: #221488;
    --medium-slate-blue: #9A57F3;
    --glass-bg: rgba(24, 18, 73, 0.7);
    --border-glow: 1px solid rgba(64, 227, 254, 0.3);
}

/* --- Archive Grid --- */
.podcast-archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

.dtr-podcast-card {
    background: var(--glass-bg);
    border: var(--border-glow);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.dtr-podcast-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 15px rgba(64, 227, 254, 0.2);
    border-color: var(--electric-aqua);
}

.dtr-card-thumb {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid var(--medium-slate-blue);
}

.dtr-card-body {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.dtr-card-title {
    color: var(--periwinkle);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.dtr-card-meta {
    font-size: 0.8rem;
    color: var(--electric-aqua);
    margin-bottom: 1rem;
    font-family: monospace;
}

.dtr-card-excerpt {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.dtr-card-actions {
    display: flex;
    gap: 1rem;
}

.dtr-btn {
    flex: 1;
    padding: 0.75rem;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    font-weight: bold;
    font-size: 0.8rem;
    border-radius: 4px;
    transition: 0.2s;
    cursor: pointer;
}

.dtr-btn-video {
    background: var(--dark-ultramarine);
    border: 1px solid var(--medium-slate-blue);
    color: var(--electric-aqua);
}

.dtr-btn-video:hover {
    background: var(--electric-aqua);
    color: var(--dark-amethyst);
}

.dtr-btn-audio {
    background: transparent;
    border: 1px solid var(--periwinkle);
    color: var(--periwinkle);
}

.dtr-btn-audio:hover {
    border-color: var(--electric-aqua);
    color: white;
}

/* --- Single Page Layouts --- */

/* Video Layout */
.dtr-video-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.dtr-video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    border: var(--border-glow);
    border-radius: 8px;
    background: #000;
    margin-bottom: 1.5rem;
}

/* oEmbed standard sizing */
.dtr-video-wrapper iframe {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
}

/* CUSTOM VIDEO PLAYER STYLES */
.dtr-custom-video-player {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: #000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden; /* Hide download menu overflow */
}

/* Hide context menu and pointer events on video to prevent download (basic) */
.dtr-video-element {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Glassmorphic Controls Bar */
.dtr-video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    background: rgba(24, 18, 73, 0.6); /* Semi-transparent dark amethyst */
    backdrop-filter: blur(12px); /* Frosted Glass Effect */
    border-top: 1px solid rgba(64, 227, 254, 0.2); /* Subtle glow border */
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: opacity 0.3s ease;
    opacity: 0; /* Hidden by default until hover or pause */
}

/* Show controls on hover or if paused */
.dtr-custom-video-player:hover .dtr-video-controls,
.dtr-custom-video-player.paused .dtr-video-controls {
    opacity: 1;
}

/* Scrubber & Sliders (Shared Bar Style) */
.dtr-video-scrubber-row {
    width: 100%;
}

/* Base style for Video Progress, Video Volume, and Audio Volume */
.dtr-video-progress,
.dtr-vid-volume-slider,
.dtr-volume-control input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.2); /* Track Background */
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    /* The Fill Effect */
    background-image: linear-gradient(var(--electric-aqua), var(--electric-aqua));
    background-size: 0% 100%; /* JS updates this width */
    background-repeat: no-repeat;
    transition: background-size 0.1s linear;
}

/* Chrome/Safari - Hide Thumb */
.dtr-video-progress::-webkit-slider-thumb,
.dtr-vid-volume-slider::-webkit-slider-thumb,
.dtr-volume-control input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 0; 
    height: 0;
    background: transparent;
    box-shadow: none;
}

/* Firefox - Hide Thumb */
.dtr-video-progress::-moz-range-thumb,
.dtr-vid-volume-slider::-moz-range-thumb,
.dtr-volume-control input[type=range]::-moz-range-thumb {
    width: 0;
    height: 0;
    border: none;
    background: transparent;
}

/* Specific Widths */
.dtr-vid-volume-slider,
.dtr-volume-control input[type=range] {
    width: 80px;
}

/* Hover Effect for Better Usability */
.dtr-video-progress:hover,
.dtr-vid-volume-slider:hover,
.dtr-volume-control input[type=range]:hover {
    height: 8px; /* Slightly thicker on hover */
}

/* Video Buttons Row */
.dtr-video-btn-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dtr-video-left, .dtr-video-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.dtr-vid-btn {
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.dtr-vid-btn:hover {
    color: var(--electric-aqua);
}

/* Video Volume Container */
.dtr-vid-volume-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dtr-vid-time {
    font-family: monospace;
    font-size: 0.8rem;
    color: #ddd;
}

.dtr-meta-sidebar {
    background: rgba(0,0,0,0.3);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--medium-slate-blue);
    height: fit-content;
}

.dtr-meta-block {
    margin-bottom: 1.5rem;
}

.dtr-meta-label {
    display: block;
    color: var(--electric-aqua);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
    margin-bottom: 0.25rem;
}

.dtr-meta-value {
    color: var(--periwinkle);
    font-size: 0.95rem;
}

/* Audio Layout Styles */
.dtr-audio-layout { margin-top: 2rem; }

.dtr-waveform-player {
    background: rgba(0,0,0,0.4);
    border: 1px solid var(--medium-slate-blue);
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 0 20px rgba(64, 227, 254, 0.1);
    position: relative; 
    overflow: hidden;
}

#dtr-bg-visualizer {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 0;
    opacity: 0.15;
    pointer-events: none;
}

/* Shared Loader Styles */
.dtr-wave-loader, .dtr-video-loader {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0; /* Cover full area */
    background: rgba(24, 18, 73, 0.85);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    color: var(--electric-aqua);
    font-family: monospace;
    text-transform: uppercase;
}

/* Show loader when class 'loading' is present */
.dtr-waveform-player.loading .dtr-wave-loader,
.dtr-custom-video-player.loading .dtr-video-loader {
    opacity: 1;
    pointer-events: all;
}

.dtr-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(64, 227, 254, 0.3);
    border-top: 4px solid var(--electric-aqua);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#waveform {
    position: relative;
    z-index: 5;
    width: 100%;
    margin-bottom: 1.5rem;
}

.dtr-player-controls {
    position: relative;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.dtr-play-big {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--medium-slate-blue);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.dtr-play-big:disabled {
    background: #444;
    color: #888;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.dtr-play-big:hover:not(:disabled) {
    transform: scale(1.1);
    background: var(--electric-aqua);
    color: var(--dark-amethyst);
}

.dtr-volume-control {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--electric-aqua);
}

.dtr-speed-control select {
    background: rgba(0,0,0,0.3);
    color: var(--electric-aqua);
    border: 1px solid var(--periwinkle);
    padding: 5px;
    border-radius: 4px;
    font-family: monospace;
}

.dtr-audio-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

/* --- DESCRIPTION LINKS & CREDITS STYLING --- */
.dtr-desc-container {
    font-family: 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: #e0e0e0;
}

.dtr-desc-intro {
    margin-bottom: 2rem;
    font-size: 1.1rem;
    color: #C5B4EC; /* Periwinkle */
}

.dtr-section-title {
    color: #40E3FE; /* Electric Aqua */
    border-bottom: 1px solid #9A57F3; /* Medium Slate Blue */
    padding-bottom: 0.5rem;
    margin-top: 2rem;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.dtr-link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.dtr-social-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: rgba(34, 20, 136, 0.3); /* Dark Ultramarine low opacity */
    border: 1px solid #9A57F3;
    border-radius: 4px;
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.dtr-social-btn:hover {
    background: #40E3FE;
    color: #181249; /* Dark Amethyst */
    border-color: #40E3FE;
    transform: translateY(-2px);
}

.dtr-social-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.dtr-credits-list {
    list-style: none;
    padding: 0;
}

.dtr-credit-item {
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dtr-credit-label {
    color: #9A57F3;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.8rem;
    min-width: 120px;
}

.dtr-credit-link {
    color: #C5B4EC;
    text-decoration: none;
    border-bottom: 1px dotted #40E3FE;
}

.dtr-credit-link:hover {
    color: #40E3FE;
}

/* --- Post Navigation --- */
.dtr-post-navigation {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem; /* Replaced top margin with bottom since it's above content */
    border-bottom: 1px solid var(--medium-slate-blue);
    padding-bottom: 1.5rem;
}

.dtr-nav-btn {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    max-width: 45%;
}

/* Swapped Alignment Logic */
.dtr-nav-btn.prev {
    text-align: right;
    margin-left: auto; /* Pushes to the right */
}

.dtr-nav-btn.next {
    text-align: left;
    margin-right: auto; /* Stays on the left */
}

.dtr-nav-label {
    font-size: 0.75rem;
    color: var(--electric-aqua);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.dtr-nav-title {
    color: var(--periwinkle);
    font-weight: bold;
    font-size: 0.95rem;
    margin-bottom: 4px;
    transition: color 0.2s;
    line-height: 1.3;
}

.dtr-nav-btn:hover .dtr-nav-title {
    color: var(--electric-aqua);
}

.dtr-nav-runtime {
    font-size: 0.75rem;
    opacity: 0.6;
    font-family: monospace;
    color: #fff;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .dtr-video-layout, .dtr-audio-grid {
        grid-template-columns: 1fr;
    }
    .dtr-player-controls {
        gap: 1rem;
    }
    .dtr-volume-control {
        display: none;
    }
    .dtr-vid-volume-container {
        display: none; /* Hide intricate video volume on mobile */
    }
}