/**
 * podcast.css
 * 
 * Styles for the podcast.php page
 * Contains styles for:
 * - Filter container and form elements
 * - Podcast cards and their components
 * - Audio player integration
 * - Responsive design for various screen sizes
 */

/* Filter Section Styles */
.filter-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    background-color: var(--mainColorLight);
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    margin-bottom: 5px;
    font-weight: bold;
    color: var(--mainColor);
}

.filter-group select {
    padding: 8px;
    border-radius: 4px;
    border: 1px solid var(--mainColor);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.filter-btn {
    background-color: var(--mainColor);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    align-self: flex-end;
    display: none; /* Hide the filter button by default */
}

.filter-btn:hover {
    background-color: var(--mainColorLight);
    color: var(--mainColor);
    border: 1px solid var(--mainColor);
}

/* No results styling */
.no-results-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 5rem 0;
}

.no-results-message {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem;
    border-radius: 8px;            
    display: block;
}

.no-results-message h3 {
    margin-bottom: 1rem;
    color: #343a40;
}

.no-results-message p {
    color: #6c757d;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.no-results-message .reset-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: #f8f9fa;
    color: var(--bibblue);
    border: 1px solid var(--bibblue);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    text-decoration: none;
    font-size: 1rem;
    transition: all 0.2s ease-in-out;
    margin-top: 1rem;
}

.no-results-message .reset-filter-btn:hover {
    background-color: var(--bibblue);
    color: #fff;
    text-decoration: none;
}

.no-results-message .reset-filter-btn i {
    font-size: 1rem;
}

/* Filter status styling */
.filtering {
    opacity: 0.7;
    pointer-events: none;
    background-color: #f0f8ff;
}

/* Podcast Cards Grid */
.podcasts-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 25px;
}

.podcast-card {
    width: 100%;
    max-width: calc(33.333% - 20px);
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    background: #fff;
    position: relative;
}

.podcast-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

.card-img-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 aspect ratio */
    overflow: hidden;
}

.card-img-top {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.5s ease-in;
}

/* Image loading styles - simplified for native lazy loading */
.card-img-top {
    /* Keep the smooth transition for when images do load */
    transition: opacity 0.3s ease-in;
}

/* Play button overlay */
.podcast-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.podcast-card:hover .podcast-play-overlay {
    opacity: 1;
}

.play-circle {
    width: 60px;
    height: 60px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

/* Play triangle (default state) */
.play-triangle {
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 12px 0 12px 20px;
    border-color: transparent transparent transparent var(--mainColor);
    margin-left: 5px; /* to center visually */
}

.card-body {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: 10px;
    font-weight: bold;
    color: var(--mainColor);
}

.card-subtitle {
    font-size: 0.9rem;
    margin-bottom: 10px;
    color: #666;
}

/* Text Container and Scrollable Text */
.card-text-container {
    flex-grow: 1;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.scrollable-text {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #333;
    overflow-wrap: break-word;
    overflow-y: auto;
    max-height: 150px;
    padding-right: 10px;
    margin-bottom: 5px;
    border-left: 3px solid #f0f0f0;
    padding-left: 10px;
    position: relative;
}

/* Styling for HTML elements inside the text */
.scrollable-text a {
    color: var(--mainColor);
    text-decoration: underline;
    word-break: break-word;
}

.scrollable-text a:hover {
    text-decoration: none;
}

.scrollable-text b, 
.scrollable-text strong {
    font-weight: bold;
}

.scrollable-text i, 
.scrollable-text em {
    font-style: italic;
}

.scrollable-text font[style*="color"] {
    display: inline;
}

.scrollable-text ul, 
.scrollable-text ol {
    margin-left: 1.5em;
    margin-bottom: 0.5em;
}

.scrollable-text li {
    margin-bottom: 0.25em;
}

/* Custom scrollbar styling */
.scrollable-text::-webkit-scrollbar {
    width: 6px;
}

.scrollable-text::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 3px;
}

.scrollable-text::-webkit-scrollbar-thumb {
    background: var(--mainColor);
    border-radius: 3px;
}

/* Firefox scrollbar */
.scrollable-text {
    scrollbar-width: thin;
    scrollbar-color: var(--mainColor) #f0f0f0;
}

/* Series Badge */
.podcast-series-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--mainColor);
    color: white;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.8rem;
    z-index: 1;
}

/* Podcast metadata section */
.podcast-metadata {
    padding: 10px 15px;
    background-color: #f8f8f8;
    border-top: 1px solid #eee;
}

.podcast-controls-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.podcast-duration {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    color: #666;
}

.podcast-duration i {
    margin-right: 5px;
}

.podcast-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.podcast-control-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    text-decoration: none;
}

.podcast-control-btn i {
    font-size: 1rem;
    text-decoration: none;
}

.podcast-control-btn:hover {
    color: var(--mainColor);
    text-decoration: none;
}

/* YouTube button styling */
.podcast-control-btn.youtube-btn {
    color: #ff0000;
    text-decoration: none;
}

.podcast-control-btn.youtube-btn:hover {
    color: #cc0000;
    text-decoration: none;
}

.podcast-control-btn.youtube-btn i {
    text-decoration: none;
}

/* Podcast/Media availability indicator */
.podcast-available-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: rgba(255, 0, 0, 0.8);
    color: white;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.8rem;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Remove separate badges since we're now using a combined approach */
.video-available-badge,
.pdf-available-badge {
    display: none;
}

/* Tag system */
.podcast-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin: 8px 0;
}

.podcast-tag {
    background-color: #f0f0f0;
    color: #555;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 10px;
}

/* Format tags - make them visually distinct for easier debugging */
.podcast-tag.format-tag {
    background-color: #e6f3ff;
    color: #0066cc;
    border: 1px solid #99ccff;
    font-weight: bold;
}

/* Debug styling for empty tag containers */
.podcast-tags:empty::before {
    content: "Keine Tags verfügbar";
    font-style: italic;
    color: #999;
    font-size: 0.75rem;
    padding: 2px 8px;
}

/* Audio player panel */
.audio-player-panel {
    display: none;
    padding: 10px;
    background-color: #f0f0f0;
    border-top: 1px solid #ddd;
}

.audio-player-panel.active {
    display: block;
}

/* Now Playing Indicator */
.now-playing-indicator {
    position: fixed;
    bottom: 27px; /* Same bottom position as filter button */
    right: 80px; /* Move to the left of filter toggle button (which is at right: 20px) */
    background-color: var(--mainColor);
    color: white;
    padding: 0 15px; /* Reduce vertical padding */
    border-radius: 22px; /* Half of the height for pill shape */
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center; /* Center content vertically and horizontally */
    gap: 10px;
    opacity: 0;
    transform: translateY(0); /* Remove the transform that could cause misalignment */
    transition: opacity 0.3s ease; /* Simplify transition */
    z-index: 1000;
    max-width: 300px;
    font-size: 0.9rem;
    height: 44px; /* Match height with filter toggle button exactly */
    box-sizing: border-box; /* Ensure padding doesn't add to total height */
    margin: 0; /* Ensure no margins are affecting position */
}

.now-playing-indicator.active {
    opacity: 1;
    transform: translateY(0); /* Ensure no transform when active */
}

.now-playing-indicator .playing-icon {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 20px;
    height: 15px;
}

.now-playing-indicator .playing-icon span {
    width: 4px;
    height: 100%;
    background-color: white;
    border-radius: 2px;
    animation: sound-wave 1.2s ease-in-out infinite;
}

.now-playing-indicator .playing-icon span:nth-child(1) {
    animation-delay: 0s;
}

.now-playing-indicator .playing-icon span:nth-child(2) {
    animation-delay: 0.2s;
    height: 60%;
}

.now-playing-indicator .playing-icon span:nth-child(3) {
    animation-delay: 0.4s;
    height: 80%;
}

.now-playing-indicator .playing-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-grow: 1;
}

.now-playing-indicator .close-indicator {
    cursor: pointer;
    background: none;
    border: none;
    color: white;
    padding: 0;
    margin: 0;
    font-size: 1.2rem;
    line-height: 1;
}

@keyframes sound-wave {
    0% {
        height: 30%;
    }
    50% {
        height: 100%;
    }
    100% {
        height: 30%;
    }
}

/* Subscription section */
.subscription-options {
    margin-top: 40px;
    text-align: center;
    background-color: #f8f8f8;
    padding: 20px;
    border-radius: 8px;
}

.subscription-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
}

.subscription-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    color: #333;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.2s;
}

.subscription-btn:hover {
    background-color: var(--mainColorLight);
    color: var(--mainColor);
    border-color: var(--mainColor);
}

.subscription-btn img {
    width: 24px;
    height: 24px;
}

/* Responsive Design */
@media (max-width: 992px) {
    .podcast-card {
        max-width: calc(50% - 20px);
    }
}

@media (max-width: 767px) {
    .podcast-card {
        max-width: 100%;
    }
    
    .filter-container {
        flex-direction: column;
        padding: 10px;
    }
    
    .filter-group {
        min-width: 100%;
        width: 100%;
    }
    
    .filter-group select {
        width: 100%;
        max-width: 100%;
    }
    
    .filter-btn {
        width: 100%;
        margin-top: 10px;
    }
    
    .subscription-buttons {
        flex-wrap: wrap;
    }
}

/* Series grouping */
.podcast-series-header {
    width: 100%;
    margin: 30px 0 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
}

.podcast-series-title {
    font-size: 1.5rem;
    color: var(--mainColor);
}

.podcast-series-description {
    font-size: 1rem;
    color: #666;
    margin-top: 5px;
}

/* Image copyright information */
.image-copyright {
    position: absolute;
    bottom: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.2rem 0.3rem;
    font-size: 0.6rem;
    z-index: 2;
    max-width: 80%;
    text-align: right;
    border-top-left-radius: 3px;
}

/* Make sure PDF icons have the correct color in podcast badges */
.podcast-available-badge .fa-file-pdf {
    color: #f40f02;
}

/* Ensure PDF buttons in controls have correct styling */
.podcast-control-btn .fa-file-pdf {
    color: #f40f02;
}

.podcast-control-btn:hover .fa-file-pdf {
    color: #ffffff;
} 