/* ==========================================
   Guerrilla Ed Podcast Player Styles
   ========================================== */

:root {
    --ged-primary: #5B2C6F;
    --ged-secondary: #F4A900;
    --ged-dark: #2C1E3E;
    --ged-light: #F8F5FA;
    --ged-gray: #666;
    --ged-border: #ddd;
    --ged-shadow: rgba(91, 44, 111, 0.1);
}

/* Main Container */
.ged-podcast-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Podcast Header */
.ged-podcast-header {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 40px;
    padding: 30px;
    background: linear-gradient(135deg, var(--ged-primary) 0%, var(--ged-dark) 100%);
    border-radius: 12px;
    color: white;
}

.ged-podcast-cover {
    width: 150px;
    height: 150px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.ged-podcast-info {
    flex: 1;
}

.ged-podcast-title {
    margin: 0 0 10px 0;
    font-size: 32px;
    font-weight: bold;
    color: white;
}

.ged-podcast-description {
    margin: 0;
    font-size: 16px;
    opacity: 0.9;
    line-height: 1.6;
}

/* Controls Bar */
.ged-podcast-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
    padding: 20px;
    background: var(--ged-light);
    border-radius: 8px;
    align-items: center;
}

.ged-search-box {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.ged-search-input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: 2px solid var(--ged-border);
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s;
}

.ged-search-input:focus {
    outline: none;
    border-color: var(--ged-primary);
    box-shadow: 0 0 0 3px var(--ged-shadow);
}

.ged-search-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--ged-primary);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.ged-search-btn:hover {
    background: var(--ged-dark);
}

.ged-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.ged-filter-select {
    padding: 10px 15px;
    border: 2px solid var(--ged-border);
    border-radius: 8px;
    background: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.ged-filter-select:hover {
    border-color: var(--ged-primary);
}

.ged-filter-select:focus {
    outline: none;
    border-color: var(--ged-primary);
    box-shadow: 0 0 0 3px var(--ged-shadow);
}

.ged-view-toggle {
    display: flex;
    gap: 5px;
    background: white;
    padding: 4px;
    border-radius: 8px;
    border: 2px solid var(--ged-border);
}

.ged-view-btn {
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: var(--ged-gray);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ged-view-btn:hover {
    background: var(--ged-light);
    color: var(--ged-primary);
}

.ged-view-btn.active {
    background: var(--ged-primary);
    color: white;
}

/* Episodes Container */
.ged-episodes-container {
    margin-bottom: 100px; /* Space for fixed player */
}

/* List View */
.ged-view-list .ged-episode-card {
    display: flex;
    gap: 20px;
    padding: 20px;
    margin-bottom: 20px;
    background: white;
    border: 2px solid var(--ged-border);
    border-radius: 12px;
    transition: all 0.3s;
}

.ged-view-list .ged-episode-card:hover {
    border-color: var(--ged-primary);
    box-shadow: 0 8px 24px var(--ged-shadow);
    transform: translateY(-2px);
}

.ged-view-list .ged-episode-artwork {
    position: relative;
    width: 120px;
    height: 120px;
    flex-shrink: 0;
}

/* Grid View */
.ged-view-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.ged-view-grid[data-columns="1"] {
    grid-template-columns: 1fr;
}

.ged-view-grid[data-columns="2"] {
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
}

.ged-view-grid[data-columns="3"] {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.ged-view-grid[data-columns="4"] {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.ged-view-grid .ged-episode-card {
    display: flex;
    flex-direction: column;
    background: white;
    border: 2px solid var(--ged-border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s;
}

.ged-view-grid .ged-episode-card:hover {
    border-color: var(--ged-primary);
    box-shadow: 0 8px 24px var(--ged-shadow);
    transform: translateY(-4px);
}

.ged-view-grid .ged-episode-artwork {
    position: relative;
    width: 100%;
    padding-bottom: 100%; /* 1:1 aspect ratio */
}

/* Episode Artwork */
.ged-episode-artwork img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.ged-view-grid .ged-episode-artwork img {
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 0;
}

.ged-play-episode-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--ged-primary);
    color: white;
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.ged-episode-artwork:hover .ged-play-episode-btn {
    opacity: 1;
}

.ged-play-episode-btn:hover {
    background: var(--ged-secondary);
    transform: translate(-50%, -50%) scale(1.1);
}

/* Episode Content */
.ged-episode-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ged-view-grid .ged-episode-content {
    padding: 20px;
}

.ged-episode-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    color: var(--ged-gray);
}

.ged-episode-date,
.ged-episode-duration,
.ged-episode-season {
    padding: 4px 10px;
    background: var(--ged-light);
    border-radius: 4px;
    font-weight: 500;
}

.ged-episode-season {
    background: var(--ged-secondary);
    color: white;
}

.ged-episode-title {
    margin: 0;
    font-size: 20px;
    font-weight: bold;
    color: var(--ged-dark);
    line-height: 1.3;
}

.ged-episode-subtitle {
    margin: 0;
    font-size: 15px;
    color: var(--ged-primary);
    font-weight: 500;
}

.ged-episode-description {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--ged-gray);
    flex: 1;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
}

.ged-episode-description a {
    color: var(--ged-primary);
    text-decoration: underline;
    transition: color 0.3s;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-all;
}

.ged-episode-description a:hover {
    color: var(--ged-secondary);
}

.ged-description-toggle {
    background: none;
    border: none;
    color: var(--ged-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 5px 0 0 0;
    margin-top: 5px;
    transition: color 0.3s;
    display: inline-block;
}

.ged-description-toggle:hover {
    color: var(--ged-secondary);
    text-decoration: underline;
}

.ged-description-toggle:focus {
    outline: 2px solid var(--ged-secondary);
    outline-offset: 2px;
    border-radius: 2px;
}

.ged-description-short,
.ged-description-full {
    margin-bottom: 5px;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* Episode Actions */
.ged-episode-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: auto;
}

.ged-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.ged-btn-play {
    background: var(--ged-primary);
    color: white;
}

.ged-btn-play:hover {
    background: var(--ged-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--ged-shadow);
}

.ged-btn-download,
.ged-btn-link {
    background: transparent;
    color: var(--ged-primary);
    border: 2px solid var(--ged-primary);
}

.ged-btn-download:hover,
.ged-btn-link:hover {
    background: var(--ged-primary);
    color: white;
}

/* Audio Player (Fixed) */
.ged-audio-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 3px solid var(--ged-primary);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.1);
    padding: 15px 20px;
    z-index: 9999;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.ged-audio-player .ged-player-episode-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.ged-player-artwork {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    object-fit: cover;
}

.ged-player-text {
    flex: 1;
    min-width: 0;
}

.ged-player-title {
    margin: 0;
    font-size: 16px;
    font-weight: bold;
    color: var(--ged-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ged-player-date {
    margin: 4px 0 0 0;
    font-size: 13px;
    color: var(--ged-gray);
}

.ged-player-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.ged-player-btn {
    background: var(--ged-primary);
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
}

.ged-player-btn:hover {
    background: var(--ged-dark);
    transform: scale(1.05);
}

#ged-play-pause-btn {
    width: 52px;
    height: 52px;
}

.ged-player-progress {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 200px;
}

.ged-time-current,
.ged-time-duration {
    font-size: 13px;
    font-weight: 600;
    color: var(--ged-gray);
    min-width: 45px;
    text-align: center;
}

.ged-progress-bar {
    flex: 1;
    height: 6px;
    background: var(--ged-light);
    border-radius: 3px;
    position: relative;
    cursor: pointer;
}

.ged-progress-fill {
    height: 100%;
    background: var(--ged-primary);
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s linear;
    position: relative;
}

.ged-progress-handle {
    position: absolute;
    top: 50%;
    left: 0%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    background: var(--ged-secondary);
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: opacity 0.3s;
}

.ged-progress-bar:hover .ged-progress-handle {
    opacity: 1;
}

.ged-player-extra {
    display: flex;
    gap: 8px;
    align-items: center;
}

.ged-speed-btn {
    width: auto;
    padding: 0 16px;
    font-size: 13px;
    font-weight: bold;
    border-radius: 20px;
}

.ged-volume-btn,
.ged-close-btn {
    background: transparent;
    color: var(--ged-gray);
    width: 36px;
    height: 36px;
}

.ged-volume-btn:hover,
.ged-close-btn:hover {
    background: var(--ged-light);
    color: var(--ged-primary);
}

/* No Episodes */
.ged-no-episodes {
    text-align: center;
    padding: 60px 20px;
    font-size: 18px;
    color: var(--ged-gray);
}

/* Responsive Design */
@media (max-width: 968px) {
    .ged-view-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .ged-podcast-header {
        flex-direction: column;
        text-align: center;
    }
    
    .ged-podcast-title {
        font-size: 24px;
    }
}

@media (max-width: 768px) {
    .ged-podcast-container {
        padding: 10px;
    }
    
    .ged-podcast-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .ged-search-box {
        width: 100%;
    }
    
    .ged-filters {
        width: 100%;
        justify-content: space-between;
    }
    
    .ged-view-list .ged-episode-card {
        flex-direction: column;
    }
    
    .ged-view-list .ged-episode-artwork {
        width: 100%;
        height: auto;
        padding-bottom: 100%;
    }
    
    .ged-view-list .ged-episode-artwork img {
        position: absolute;
        top: 0;
        left: 0;
        border-radius: 8px 8px 0 0;
    }
    
    .ged-view-grid {
        grid-template-columns: 1fr;
    }
    
    .ged-audio-player {
        padding: 12px 15px;
    }
    
    .ged-player-progress {
        min-width: 150px;
    }
    
    .ged-player-extra .ged-speed-btn {
        display: none;
    }
}

@media (max-width: 480px) {
    .ged-episode-actions {
        flex-direction: column;
    }
    
    .ged-btn {
        width: 100%;
        justify-content: center;
    }
    
    .ged-player-controls {
        flex-wrap: wrap;
    }
    
    .ged-player-progress {
        order: 3;
        width: 100%;
        margin-top: 10px;
    }
}

/* Loading State */
.ged-loading {
    text-align: center;
    padding: 40px;
}

.ged-loading:after {
    content: '';
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid var(--ged-light);
    border-top-color: var(--ged-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Accessibility */
.ged-btn:focus,
.ged-player-btn:focus,
.ged-search-input:focus,
.ged-filter-select:focus {
    outline: 3px solid var(--ged-secondary);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .ged-audio-player,
    .ged-podcast-controls,
    .ged-episode-actions {
        display: none !important;
    }
}
