/**
 * WP Audio Tracks - Frontend Styles
 * 
 * Styles for the audio recording plugin frontend display
 */

/* Main Container */
.wp-audio-tracks-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Single Recording Styles */
.recording-single {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 30px;
}

.recording-header {
    padding: 30px 30px 20px;
    border-bottom: 1px solid #eee;
}

.recording-title {
    font-size: 2.5em;
    margin: 0 0 15px 0;
    color: #333;
    line-height: 1.2;
    font-weight: 600;
}

.recording-session,
.recording-sections {
    margin-bottom: 10px;
    color: #666;
    font-size: 1.1em;
}

.recording-session strong,
.recording-sections strong {
    color: #333;
    margin-right: 8px;
}

.recording-sections a {
    color: #0073aa;
    text-decoration: none;
    transition: color 0.3s ease;
}

.recording-sections a:hover {
    color: #005177;
    text-decoration: underline;
}

.recording-thumbnail {
    margin: 20px 30px;
}

.recording-thumbnail img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.recording-description {
    padding: 0 30px 30px;
    font-size: 1.1em;
    line-height: 1.6;
    color: #444;
}

.recording-description p {
    margin-bottom: 15px;
}

/* Audio Player Container */
.recording-player-container {
    background: #f8f9fa;
    padding: 30px;
    margin: 20px 30px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.recording-player-container h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 1.5em;
}

.secure-audio-player {
    position: relative;
}

.secure-audio-player audio {
    width: 100%;
    max-width: 600px;
    height: 54px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    background: #fff;
    border: 1px solid #ddd;
}

.audio-security-notice {
    margin-top: 10px;
    padding: 10px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    color: #856404;
    font-size: 0.9em;
}

.no-recording-message {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 20px;
    border-radius: 4px;
    margin: 20px 30px;
}

.recording-footer {
    padding: 20px 30px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
    color: #666;
}

.recording-meta {
    font-size: 0.9em;
}

/* Recording Navigation */
.recording-navigation {
    margin: 30px 0;
}

.nav-links {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.nav-previous,
.nav-next {
    flex: 1;
}

.nav-previous a,
.nav-next a {
    display: block;
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.nav-previous a:hover,
.nav-next a:hover {
    background: #f8f9fa;
    border-color: #0073aa;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.nav-subtitle {
    display: block;
    font-size: 0.8em;
    color: #666;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-title {
    display: block;
    font-size: 1.1em;
    font-weight: 600;
    color: #333;
}

/* Section Archive Styles */
.section-archive-content {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.page-header {
    padding: 40px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    text-align: center;
}

.page-title {
    font-size: 2.5em;
    margin: 0 0 15px 0;
    font-weight: 600;
}

.section-name {
    color: #ffd700;
    font-weight: 700;
}

.section-description {
    font-size: 1.1em;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Recordings Grid */
.recordings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    padding: 30px;
}

.recording-item {
    margin: 0;
}

.recording-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.recording-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #0073aa;
}

.recording-card .recording-thumbnail {
    margin: 0;
    position: relative;
    overflow: hidden;
}

.recording-card .recording-thumbnail img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
    border-radius: 0;
    box-shadow: none;
}

.recording-card:hover .recording-thumbnail img {
    transform: scale(1.05);
}

.recording-card .recording-thumbnail.no-image {
    height: 200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.default-thumbnail {
    color: #fff;
    font-size: 3em;
    opacity: 0.8;
}

.recording-card .recording-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.recording-card .recording-title {
    font-size: 1.3em;
    margin: 0 0 10px 0;
    line-height: 1.3;
}

.recording-card .recording-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.recording-card .recording-title a:hover {
    color: #0073aa;
}

.recording-card .recording-session {
    font-size: 0.9em;
    margin-bottom: 15px;
    color: #666;
}

.recording-excerpt {
    flex-grow: 1;
    margin-bottom: 20px;
    color: #555;
    line-height: 1.5;
    font-size: 0.95em;
}

.recording-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 0.85em;
    color: #666;
}

.recording-has-audio {
    display: flex;
    align-items: center;
}

.audio-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #28a745;
    font-weight: 500;
}

.audio-indicator .dashicons {
    font-size: 16px;
}

.recording-actions {
    margin-top: auto;
}

.recording-actions .button {
    width: 100%;
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 12px 20px;
    border-radius: 4px;
    text-decoration: none;
    text-align: center;
    font-size: 1em;
    transition: background-color 0.3s ease;
    display: inline-block;
}

.recording-actions .button:hover {
    background: #005177;
    color: #fff;
}

/* No Recordings Message */
.no-recordings {
    text-align: center;
    padding: 60px 30px;
    color: #666;
}

.no-recordings h2 {
    color: #333;
    margin-bottom: 15px;
}

.back-to-sections {
    margin-top: 20px;
}

/* All Sections Navigation */
.all-sections-navigation {
    background: #f8f9fa;
    padding: 30px;
    border-top: 1px solid #eee;
}

.all-sections-navigation h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 1.3em;
}

.sections-hierarchy {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.section-group {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
}

.parent-section {
    margin: 0;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.parent-section .section-link {
    font-weight: 600;
    font-size: 1.1em;
    color: #333;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.parent-section .section-link:hover,
.parent-section .section-link.current-section {
    color: #0073aa;
}

.child-sections {
    padding: 15px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.section-link {
    display: inline-block;
    padding: 6px 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 15px;
    text-decoration: none;
    color: #666;
    font-size: 0.85em;
    transition: all 0.3s ease;
}

.section-link:hover,
.section-link.current-section {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 115, 170, 0.2);
}

.child-link {
    font-size: 0.8em;
    padding: 4px 10px;
}

.section-count {
    opacity: 0.7;
    margin-left: 5px;
    font-size: 0.85em;
}

/* Responsive hierarchy */
@media (max-width: 768px) {
    .sections-hierarchy {
        gap: 15px;
    }
    
    .section-group {
        margin: 0 -5px;
    }
    
    .parent-section {
        padding: 12px 15px;
    }
    
    .child-sections {
        padding: 12px 15px;
        gap: 6px;
    }
    
    .section-link {
        font-size: 0.8em;
        padding: 5px 10px;
    }
}

/* Pagination */
.wp-audio-tracks-container .page-numbers {
    display: inline-block;
    padding: 8px 16px;
    margin: 0 4px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
}

.wp-audio-tracks-container .page-numbers:hover,
.wp-audio-tracks-container .page-numbers.current {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

/* Responsive Design */
@media (max-width: 768px) {
    .wp-audio-tracks-container {
        padding: 15px;
    }
    
    .recording-title {
        font-size: 2em;
    }
    
    .recording-header,
    .recording-description,
    .recording-player-container,
    .recording-footer {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .recordings-grid {
        grid-template-columns: 1fr;
        padding: 20px;
        gap: 20px;
    }
    
    .page-header {
        padding: 30px 20px;
    }
    
    .page-title {
        font-size: 2em;
    }
    
    .nav-links {
        flex-direction: column;
    }
    
    .sections-list {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .recording-title {
        font-size: 1.5em;
    }
    
    .page-title {
        font-size: 1.5em;
    }
    
    .recording-card .recording-thumbnail {
        height: 150px;
    }
    
    .recording-card .recording-thumbnail.no-image {
        height: 150px;
    }
    
    .default-thumbnail {
        font-size: 2em;
    }
}

/* Security Enhancements */
.secure-audio-player {
    position: relative;
}

.secure-audio-player::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    pointer-events: none;
    background: transparent;
}

/* Disable text selection on audio controls */
.secure-audio-player audio {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

/* Print Styles */
@media print {
    .recording-player-container,
    .secure-audio-player,
    .audio-security-notice {
        display: none !important;
    }
}
