/* JukePodder Common Styles */
/* Version: 1.0.38 */
/* 
 * IMPORTANT: When updating this file, increment the version number above
 * AND update the version parameter in ALL files that reference this CSS:
 * - index.php: <link href="/styles.css?v=X.X.X" ...>
 * - favorites.php: <link href="/styles.css?v=X.X.X" ...>
 */

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.4;
    margin: 0;
    padding: 10px;
    background-color: #f5f5f5;
}

.container {
    background-color: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

h1 {
    color: #333;
    margin: 0;
    font-size: 2.5em;
}

/* Navigation Header */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.site-logo {
    text-decoration: none;
    color: #333;
}

.site-logo:hover {
    color: #555;
}

.favorites-link {
    color: #007bff;
    text-decoration: none;
    font-size: 18px;
    white-space: nowrap;
}

.favorites-link:hover {
    text-decoration: underline;
}

/* Jukepod Buttons */
.jukepod-button {
    background-color: #fff;
    color: #007bff;
    border: 1px solid #007bff;
    font-size: 15px;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    display: inline-block;
    transition: all 0.2s;
    min-width: 130px;
    text-align: center;
}

.jukepod-button:hover:not(.active) {
    background-color: #007bff;
    color: #fff;
}

.jukepod-button.active {
    background-color: #007bff !important;
    color: #fff !important;
    cursor: default;
}

.jukepod-button.active:hover {
    background-color: #0056b3;
}

/* Rerandomize Button */
.refresh-button {
    background-color: #007bff;
    color: white;
    border: 1px solid #007bff;
    font-size: 15px;
    padding: 4px 18px;
    border-radius: 4px;
    cursor: pointer;
    display: inline-block;
}

.refresh-button:hover {
    background-color: #0056b3;
}

/* Podcast Grid */
.podcast-list {
    list-style: none;
    padding: 0;
    display: grid;
    gap: 10px;
}

@media (min-width: 768px) {
    .podcast-list {
        grid-template-columns: repeat(auto-fill, minmax(370px, 1fr));
    }
}

/* Podcast Tile */
/* Total tile height = height (443px) + padding (30px) + border (2px) = 475px */
.podcast-item {
    padding: 15px;
    margin-bottom: 0;
    border: 1px solid #ddd;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    height: 443px;
    overflow: hidden;
}

.podcast-item:hover {
    background-color: #f8f9fa;
}

/* Active/Playing state - highlight with blue border */
.podcast-item.playing {
    border: 3px solid #2563eb; /* Blue accent matching bg-blue-600 */
    padding: 13px; /* Reduce padding by 2px to maintain same total size with thicker border */
}

/* Podcast Header (image + title/author/language) */
.podcast-header {
    display: flex;
    align-items: start;
    gap: 15px;
    margin-bottom: 4px;
}

.podcast-text-wrapper {
    flex: 1;
    overflow: hidden; /* Establish float context */
}

.podcast-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
}

.podcast-title {
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 1.1em;
}

.podcast-author {
    color: #666;
    font-size: 0.8em;
    margin-bottom: 5px;
}

.podcast-meta {
    color: #666;
    font-size: 0.75em;
}

/* Star Button */
.star-button {
    float: right;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    margin-left: 8px;
    margin-bottom: 4px;
    color: #007bff;
    line-height: 1;
    transition: transform 0.2s;
}

.star-button:hover {
    transform: scale(1.2);
}

.star-button:active {
    transform: scale(0.9);
}

.star-button .star-filled {
    display: none;
}

.star-button.favorited .star-empty {
    display: none;
}

.star-button.favorited .star-filled {
    display: inline;
}

/* Circle button for admin select (matches star button style) */
.select-circle-button {
    float: right;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    margin-left: 8px;
    margin-bottom: 4px;
    color: #007bff;
    line-height: 1;
}

.select-circle-button:hover {
    transform: scale(1.2);
}

.select-circle-button:active {
    transform: scale(0.9);
}

.select-circle-button .circle-filled {
    display: none;
}

.select-circle-button.selected .circle-empty {
    display: none;
}

.select-circle-button.selected .circle-filled {
    display: inline;
}

/* Episode Info Section */
.podcast-episode-info {
    margin-top: 4px;
    margin-bottom: 8px;
}

.podcast-timestamp {
    color: #666;
    font-size: 0.75em;
    margin-top: 3px;
    margin-bottom: 0;
    font-family: monospace;
    white-space: nowrap;
}

.podcast-categories {
    color: #666;
    font-size: 0.85em;
    margin-top: 6px;
    margin-bottom: 8px;
    line-height: 1.4;
}

.podcast-description {
    font-size: 0.8em;
    color: #444;
    overflow-y: auto;
    max-height: 200px;
    flex: 1;
    min-height: 0;
}

.podcast-links {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    flex-shrink: 0; /* Don't shrink */
}

.podcast-link {
    color: #007bff;
    text-decoration: none;
    font-size: 0.9em;
}

.podcast-link:hover {
    text-decoration: underline;
}

/* Sponsored Banner */
.sponsored-banner {
    width: 100%;
    padding: 2px 10px; /* Further reduced vertical padding (half of 4px) */
    background-color: #f0f9f0; /* Very light green, subtle */
    color: #155724; /* Dark green text */
    font-size: 0.75em;
    font-weight: bold;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px; /* Full border radius on all corners */
    border-left: 3px solid #155724; /* Dark green left border, matching latest episode blue border */
    margin-top: auto; /* Push to bottom of flex container */
    margin-bottom: 0; /* No space - banner and episode block touch */
    box-sizing: border-box; /* Include border in width calculation */
    flex-shrink: 0; /* Don't shrink */
}

/* Latest Episode Block */
.latest-episode {
    padding: 10px;
    background-color: #e9ecef;
    border-radius: 4px; /* Full border radius on all corners */
    border-left: 3px solid #007bff;
    box-sizing: border-box; /* Include border in width calculation */
    flex-shrink: 0; /* Don't shrink */
    margin-top: auto; /* Push to bottom if no sponsored banner above */
}

/* When sponsored banner is present, latest episode should be directly below it (no margin-top: auto) */
.podcast-item:has(.sponsored-banner) .latest-episode {
    margin-top: 0;
}

/* Fallback for browsers that don't support :has() */
.podcast-item .sponsored-banner + .latest-episode {
    margin-top: 0;
}

.episode-title {
    font-size: 0.75em;
    margin: 0 0 4px 0;  /* Explicitly set all margins */
    color: #444;
}

.episode-meta {
    font-size: 0.75em;
    color: #444;
    margin-bottom: 0;
}

.episode-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7em;
    color: #444;
    margin-bottom: 0;
    margin-top: 0;
}

.episode-meta-left {
    text-align: left;
}

/* Sample Buttons */
.sample-buttons {
    display: flex;
    gap: 8px;
    margin: 0 0 6px 0;  /* Explicitly set all margins */
}

.sample-btn {
    flex: 1;
    padding: 4px 8px;
    font-size: 0.7em;
    background-color: #fff;
    border: 1px solid #007bff;
    color: #007bff;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.sample-btn:hover:not(.playing) {
    background-color: #007bff;
    color: #fff;
}

.sample-btn.playing {
    background-color: #007bff !important;
    color: #fff !important;
    cursor: default;
}

.episode-meta-right {
    text-align: right;
}

.episode-player {
    width: 100%;
    margin: 0 0 4px 0;  /* Explicitly set all margins: top right bottom left */
    padding: 0;  /* Remove any browser default padding */
    max-height: 40px;
    display: block;  /* Ensure no inline spacing */
}

/* Spinner Animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.podcast-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.podcast-spinner .spinner {
    width: 32px;
    height: 32px;
    border: 4px solid #eee;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    h1 {
        font-size: 2em;
        margin: 0 0 8px 0;
    }
    .podcast-list {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 15px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.8em;
        margin: 0 0 6px 0;
    }
    .podcast-list {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

