/* Papa's Sermon Collection Player Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #000000;
    color: #333;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
header {
    text-align: center;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.portrait-container {
    flex-shrink: 0;
}

.portrait-image {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #1e3c72;
    box-shadow: 0 4px 16px rgba(30, 60, 114, 0.3);
}

.header-text {
    flex: 1;
    min-width: 300px;
}

header h1 {
    font-size: 2.5em;
    color: #1e3c72;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

header p {
    font-size: 1.2em;
    color: #666;
}

/* Main Content Layout */
.main-content {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* Sermon Selector */
.sermon-selector {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    height: fit-content;
}

.sermon-selector-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.sermon-selector-header h2 {
    color: #1e3c72;
    font-size: 1.3em;
    margin: 0;
}

.header-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.download-all-button {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.download-all-button:hover {
    background: #218838;
    transform: scale(1.05);
}

.toggle-button {
    background: none;
    border: none;
    font-size: 1.2em;
    color: #2a5298;
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.toggle-button:hover {
    background: rgba(42, 82, 152, 0.1);
}

.toggle-icon {
    transition: transform 0.3s ease;
}

.sermon-selector.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.sermon-list {
    max-height: 500px;
    overflow-y: auto;
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

.sermon-selector.collapsed .sermon-list {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
}

.sermon-item {
    padding: 12px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.sermon-item:hover {
    background: #e9ecef;
    border-left-color: #2a5298;
    transform: translateX(5px);
}

.sermon-item.active {
    background: #2a5298;
    color: white;
    border-left-color: #1e3c72;
}

.sermon-item h4 {
    font-size: 0.9em;
    margin-bottom: 5px;
}

.sermon-item p {
    font-size: 0.8em;
    opacity: 0.8;
}

/* Audio Section */
.audio-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.sermon-info h2 {
    color: #1e3c72;
    margin-bottom: 10px;
    font-size: 1.8em;
}

.sermon-info p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
}

.audio-player {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#audioPlayer {
    width: 100%;
    height: 60px;
    border-radius: 10px;
}

.player-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.player-info {
    display: flex;
    gap: 10px;
    color: #666;
    font-size: 0.9em;
}

.download-controls {
    display: flex;
    gap: 8px;
}

.download-button {
    background: #17a2b8;
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8em;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.download-button:hover:not(:disabled) {
    background: #138496;
    transform: translateY(-1px);
}

.download-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Content Tabs */
.content-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 0;
    grid-column: 1 / -1;
}

.tab-button {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.7);
    border: none;
    border-radius: 10px 10px 0 0;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    color: #666;
}

.tab-button:hover {
    background: rgba(255, 255, 255, 0.85);
    color: #333;
}

.tab-button.active {
    background: rgba(255, 255, 255, 0.95);
    color: #1e3c72;
    font-weight: 600;
}

/* Tab Content */
.tab-content {
    grid-column: 1 / -1;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 0 15px 15px 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.tab-panel {
    display: none;
    padding: 30px;
    min-height: 400px;
}

.tab-panel.active {
    display: block;
}

.tab-panel h3 {
    color: #1e3c72;
    margin-bottom: 20px;
    font-size: 1.4em;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
}

/* Transcript Display */
.transcript-display {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    line-height: 1.8;
    font-size: 1.1em;
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
}

.transcript-segment {
    margin-bottom: 15px;
    padding: 10px;
    border-radius: 5px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.transcript-segment:hover {
    background: #e9ecef;
}

.transcript-segment.active {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
}

.segment-time {
    font-size: 0.85em;
    color: #2a5298;
    font-weight: 600;
    margin-bottom: 5px;
}

.segment-text {
    color: #333;
}

/* Clickable Lists */
.clickable-list {
    max-height: 500px;
    overflow-y: auto;
}

.clickable-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.clickable-item:hover {
    background: #e9ecef;
    border-left-color: #2a5298;
    transform: translateX(5px);
}

.timecode-button {
    background: #2a5298;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.timecode-button:hover {
    background: #1e3c72;
    transform: scale(1.05);
}

.item-text {
    flex: 1;
    line-height: 1.6;
    color: #333;
}

/* Themes List */
.themes-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.theme-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid #2a5298;
    transition: all 0.3s ease;
}

.theme-item:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Progress Bar */
.progress-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    grid-column: 1 / -1;
}

.progress-bar {
    position: relative;
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2a5298, #1e3c72);
    border-radius: 4px;
    transition: width 0.1s ease;
    width: 0%;
}

.progress-markers {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.progress-marker {
    position: absolute;
    top: -2px;
    width: 3px;
    height: 12px;
    background: #ffc107;
    border-radius: 2px;
    transform: translateX(-50%);
}

.playback-controls {
    display: flex;
    justify-content: center;
}

.play-pause-button {
    background: #2a5298;
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(42, 82, 152, 0.3);
}

.play-pause-button:hover:not(:disabled) {
    background: #1e3c72;
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(30, 60, 114, 0.4);
}

.play-pause-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .sermon-selector {
        order: 1;
    }
    
    .audio-section {
        order: 2;
    }
    
    .progress-container {
        order: 3;
    }
    
    .content-tabs {
        order: 4;
    }
    
    .tab-content {
        order: 5;
    }
    
    .header-content {
        flex-direction: column;
        gap: 20px;
    }
    
    .portrait-image {
        width: 100px;
        height: 100px;
    }
    
    .header-text {
        min-width: auto;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .tab-panel {
        padding: 20px;
    }
    
    .themes-list {
        grid-template-columns: 1fr;
    }
    
    .sermon-selector {
        margin-bottom: 10px;
    }
    
    .sermon-list {
        max-height: 300px;
    }
    
    .player-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .download-controls {
        justify-content: center;
    }
    
    .header-buttons {
        flex-direction: column;
        gap: 5px;
    }
    
    .download-all-button {
        font-size: 0.8em;
        padding: 6px 10px;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #2a5298;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #1e3c72;
}

/* Loading Animation */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2a5298;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.footer {
    background: #f8f9fa;
    padding: 15px;
    border-top: 1px solid #eee;
    text-align: center;
}

.footer a {
    color: #2a5298;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}
