/*
 * Larry Jewell Memorial Archive
 * Southern Utah / Dixie State Radio Theme
 * Colors inspired by St. George red rocks, Dixie State red, and vintage radio
 */

:root {
    /* Dixie/Southern Utah Color Palette */
    --dixie-red: #D42E12;
    --sandstone: #C89F7B;
    --desert-sand: #E8D5C4;
    --canyon-shadow: #8B4513;
    --radio-gold: #D4AF37;
    --vintage-cream: #F5F1E8;
    --deep-charcoal: #2C2416;
    --slate-gray: #4A4A4A;
    --accent-blue: #1B4965;

    /* Spacing */
    --container-width: 1200px;
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
}

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    line-height: 1.6;
    color: var(--deep-charcoal);
    background: linear-gradient(135deg, var(--vintage-cream) 0%, var(--desert-sand) 100%);
    min-height: 100vh;
    overflow-x: hidden;
    width: 100%;
}

/* ================================== */
/* SVG Icon and UI Text Replacement Fix */
/* ================================== */

/* General SVG Container */
.search-icon, .play-icon, .download-icon, .control-icon, .volume-btn, .player-download-btn, .close-player {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1; /* Ensure no extra spacing around icons */
}

/* General SVG Styling */
.search-icon svg,
.play-icon svg,
.download-icon svg,
.control-icon svg,
.volume-btn svg,
.player-download-btn svg,
.close-player svg {
    display: block;
    width: 1.2rem;
    height: 1.2rem;
    fill: currentColor; /* Use parent element's text color */
}

/* Adjust sizes for specific contexts */
.play-icon svg,
.download-icon svg {
    width: 1.1rem;
    height: 1.1rem;
}

.control-icon svg {
    width: 1.3rem;
    height: 1.3rem;
}

.volume-btn svg {
    width: 1.5rem;
    height: 1.5rem;
    fill: var(--vintage-cream);
}

.player-download-btn svg {
    width: 1.3rem;
    height: 1.3rem;
    fill: var(--deep-charcoal);
}

.close-player svg {
    width: 1.5rem;
    height: 1.5rem;
    fill: var(--vintage-cream);
}

/* Search Icon Positioning */
.search-icon {
    /* Restore original position */
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--canyon-shadow);
    pointer-events: none;
}
/* End SVG Fix */

/* Header Styles */
.site-header {
    background: linear-gradient(180deg, var(--deep-charcoal) 0%, var(--slate-gray) 100%);
    color: var(--vintage-cream);
    padding: var(--spacing-md) 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    border-bottom: 4px solid var(--dixie-red);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.logo-section {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.header-portrait {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 3px solid var(--radio-gold);
    object-fit: cover;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
}

.logo-text h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--radio-gold);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    margin-bottom: 0.25rem;
}

.tagline {
    font-size: 0.9rem;
    color: var(--desert-sand);
    font-style: italic;
    letter-spacing: 0.5px;
}

/* Navigation */
.main-nav ul {
    list-style: none;
    display: flex;
    gap: var(--spacing-md);
}

.main-nav a {
    color: var(--vintage-cream);
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    background: rgba(212, 46, 18, 0.2);
    border: 2px solid transparent;
    transition: all 0.3s ease;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.main-nav a:hover {
    background: var(--dixie-red);
    border-color: var(--radio-gold);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.main-nav a.active {
    background: var(--dixie-red);
    border-color: var(--radio-gold);
}

/* Main Content */
.main-content {
    max-width: var(--container-width);
    margin: var(--spacing-xl) auto;
    padding: 0 var(--spacing-md);
}

/* Archive Container */
.archive-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    padding: var(--spacing-xl);
    border: 1px solid var(--sandstone);
}

.archive-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-lg);
    border-bottom: 3px solid var(--dixie-red);
}

.archive-header h2 {
    font-size: 2.5rem;
    color: var(--dixie-red);
    margin-bottom: var(--spacing-md);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.archive-description {
    font-size: 1.1rem;
    color: var(--slate-gray);
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
}

/* Search Container */
.search-container {
    position: relative;
    max-width: 600px;
    margin: 0 auto var(--spacing-lg);
}

.search-container input {
    width: 100%;
    padding: 1rem 3rem 1rem 1.5rem;
    font-size: 1.1rem;
    border: 2px solid var(--sandstone);
    border-radius: 50px;
    background: var(--vintage-cream);
    transition: all 0.3s ease;
    font-family: inherit;
}

.search-container input:focus {
    outline: none;
    border-color: var(--dixie-red);
    box-shadow: 0 0 0 3px rgba(212, 46, 18, 0.1);
}

/* .search-icon definition moved to general SVG section */

.search-icon {
    /* Overriding original emoji style */
    font-size: 1rem;
}

/* Sort Container */
.sort-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin: 0 auto var(--spacing-lg);
    max-width: 600px;
}

.sort-container label {
    font-weight: 600;
    color: var(--slate-gray);
    font-size: 1rem;
}

.sort-container select {
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--sandstone);
    border-radius: 8px;
    background: var(--vintage-cream);
    color: var(--deep-charcoal);
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238B4513' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 12px;
}

.sort-container select:hover {
    border-color: var(--dixie-red);
    background-color: white;
}

.sort-container select:focus {
    outline: none;
    border-color: var(--dixie-red);
    box-shadow: 0 0 0 3px rgba(212, 46, 18, 0.1);
}

/* Audio Count */
.audio-count {
    text-align: center;
    font-size: 1.1rem;
    color: var(--slate-gray);
    margin-bottom: var(--spacing-lg);
    font-weight: 600;
}

.audio-count span {
    color: var(--dixie-red);
    font-size: 1.3rem;
    font-weight: 700;
}

/* Audio Grid */
.audio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(350px, 100%), 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.audio-card {
    background: linear-gradient(135deg, var(--vintage-cream) 0%, white 100%);
    border: 2px solid var(--sandstone);
    border-radius: 10px;
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
}

.audio-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(212, 46, 18, 0.2);
    border-color: var(--dixie-red);
}

.audio-info {
    flex: 1;
}

.audio-title {
    font-size: 1.2rem;
    color: var(--accent-blue);
    margin-bottom: var(--spacing-xs);
    font-weight: 700;
}

.recording-link {
    color: var(--accent-blue);
    text-decoration: none;
    transition: color 0.2s ease;
}

.recording-link:hover {
    color: var(--dixie-red);
    text-decoration: underline;
}

.audio-description {
    font-size: 0.95rem;
    color: var(--slate-gray);
    line-height: 1.5;
    margin-bottom: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    max-height: 4.5em;
}

.audio-filename {
    font-size: 0.8rem;
    color: var(--canyon-shadow);
    font-family: 'Courier New', monospace;
    margin-top: 0.5rem;
}

.search-match-indicator {
    margin-top: 0.75rem;
    padding: 0.85rem 1rem;
    background: rgba(27, 73, 101, 0.08);
    border-left: 4px solid var(--accent-blue);
    border-radius: 8px;
}

.search-match-badge {
    display: inline-block;
    margin-bottom: 0.45rem;
    padding: 0.2rem 0.6rem;
    background: var(--accent-blue);
    color: white;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.search-match-snippet {
    margin: 0;
    color: var(--slate-gray);
    font-size: 0.92rem;
    line-height: 1.55;
}

.card-actions {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.download-link {
    color: var(--radio-gold);
    background: var(--deep-charcoal);
    text-decoration: none;
    font-weight: 600;
    padding: 0.75rem 0.5rem;
    border: 2px solid var(--radio-gold);
    border-radius: 50px;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    flex: 0 0 calc(33.333% - 0.25rem);
}

.download-link:hover {
    background: var(--radio-gold);
    color: var(--deep-charcoal);
    transform: translateY(-2px);
}

.download-link:hover svg {
    fill: var(--deep-charcoal);
}

.download-icon {
    /* font-size: 1.1rem; replaced by SVG */
}

.play-button {
    flex: 0 0 calc(66.666% - 0.25rem);
    background: linear-gradient(135deg, var(--dixie-red) 0%, #B82510 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 12px rgba(212, 46, 18, 0.3);
}

.play-button:hover {
    background: linear-gradient(135deg, #B82510 0%, var(--dixie-red) 100%);
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(212, 46, 18, 0.4);
}

.play-button:active {
    transform: scale(0.98);
}

.play-icon {
    /* font-size: 1.1rem; replaced by SVG */
}

/* No Results */
.no-results {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--slate-gray);
    font-size: 1.2rem;
    font-style: italic;
}

/* Audio Player (Fixed Bottom) */
.audio-player {
    position: fixed;
    bottom: -200px;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, var(--deep-charcoal) 0%, #1a1612 100%);
    padding: var(--spacing-md);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.4);
    transition: bottom 0.3s ease;
    z-index: 1000;
    border-top: 3px solid var(--radio-gold);
}

.audio-player.active {
    bottom: 0;
}

.player-container {
    max-width: var(--container-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(200px, 2fr) auto minmax(300px, 3fr) 120px 40px 40px;
    gap: var(--spacing-md);
    align-items: center;
    position: relative;
}

.player-info {
    min-width: 0;
}

.now-playing {
    font-size: 0.75rem;
    color: var(--sandstone);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.25rem;
}

.player-title {
    color: var(--radio-gold);
    font-weight: 600;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.control-btn {
    background: var(--dixie-red);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(212, 46, 18, 0.4);
}

.control-btn:hover:not(:disabled) {
    background: #B82510;
    transform: scale(1.1);
}

.control-btn:disabled {
    background: var(--slate-gray);
    cursor: not-allowed;
    opacity: 0.5;
}

.control-icon {
    /* font-size: 1.3rem; replaced by SVG */
}

.time-display {
    color: var(--vintage-cream);
    font-size: 0.9rem;
    font-family: 'Courier New', monospace;
    white-space: nowrap;
}

.time-separator {
    margin: 0 0.25rem;
}

.progress-container {
    position: relative;
}

.progress-bar {
    height: 6px;
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--dixie-red) 0%, var(--radio-gold) 100%);
    width: 0%;
    transition: width 0.1s linear;
    border-radius: 3px;
}

.progress-slider {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    width: 100%;
    height: 20px;
    opacity: 0;
    cursor: pointer;
}

.progress-slider:disabled {
    cursor: not-allowed;
}

.volume-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.volume-btn {
    background: transparent;
    border: none;
    /* font-size: 1.5rem; replaced by SVG */
    cursor: pointer;
    transition: transform 0.2s ease;
}

.volume-btn:hover {
    transform: scale(1.2);
}

.volume-slider {
    width: 80px;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
    outline: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--radio-gold);
    cursor: pointer;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--radio-gold);
    cursor: pointer;
    border-radius: 50%;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.player-download-btn {
    background: var(--radio-gold);
    border: none;
    color: var(--deep-charcoal);
    /* font-size: 1.3rem; replaced by SVG */
    cursor: pointer;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.4);
}

.player-download-btn:hover {
    background: var(--canyon-shadow);
    color: white;
    transform: scale(1.1);
}

.player-download-btn:hover svg {
    fill: white;
}

.close-player {
    background: transparent;
    border: none;
    color: var(--vintage-cream);
    /* font-size: 1.5rem; replaced by SVG */
    cursor: pointer;
    transition: all 0.2s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.close-player:hover {
    background: rgba(212, 46, 18, 0.3);
    transform: rotate(90deg);
}

/* About Page Styles */
.about-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    overflow: hidden;
    border: 1px solid var(--sandstone);
}

.about-hero {
    background: linear-gradient(135deg, var(--dixie-red) 0%, var(--canyon-shadow) 100%);
    padding: var(--spacing-xl);
    color: white;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
    align-items: center;
}

.hero-images {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
}

.about-portrait,
.about-action {
    width: 200px;
    height: 250px;
    object-fit: cover;
    border-radius: 8px;
    border: 4px solid var(--radio-gold);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.hero-text h2 {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-sm);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    color: var(--radio-gold);
}

.life-dates {
    font-size: 1.3rem;
    margin-bottom: var(--spacing-sm);
    color: var(--vintage-cream);
}

.subtitle {
    font-size: 1.2rem;
    font-style: italic;
    color: var(--desert-sand);
}

.biography-section {
    padding: var(--spacing-xl);
}

.biography-section h3 {
    font-size: 2rem;
    color: var(--dixie-red);
    margin: var(--spacing-lg) 0 var(--spacing-md);
    border-bottom: 2px solid var(--sandstone);
    padding-bottom: var(--spacing-sm);
}

.biography-section h3:first-child {
    margin-top: 0;
}

.bio-content p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: var(--spacing-md);
    color: var(--deep-charcoal);
}

.newspaper-section {
    margin: var(--spacing-xl) 0;
    text-align: center;
}

.newspaper-image {
    max-width: 100%;
    height: auto;
    border: 4px solid var(--sandstone);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    margin-top: var(--spacing-md);
}

.family-section {
    background: var(--vintage-cream);
    padding: var(--spacing-lg);
    border-radius: 8px;
    margin: var(--spacing-lg) 0;
}

.family-section h3 {
    color: var(--accent-blue);
    margin-top: 0 !important;
}

.family-section p {
    font-size: 1rem;
    line-height: 1.7;
}

.links-section {
    background: var(--desert-sand);
    padding: var(--spacing-lg);
    border-radius: 8px;
}

.links-section h3 {
    margin-top: 0 !important;
    color: var(--accent-blue);
}

.links-section ul {
    list-style: none;
    padding-left: 0;
}

.links-section li {
    margin-bottom: var(--spacing-sm);
}

.links-section a {
    color: var(--dixie-red);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.2s ease;
    display: inline-block;
}

.links-section a:hover {
    color: var(--canyon-shadow);
    transform: translateX(5px);
}

/* Admin Panel Styles */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
}

.login-box {
    background: white;
    padding: var(--spacing-xl);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    border: 2px solid var(--sandstone);
    max-width: 400px;
    width: 100%;
}

.login-box h1 {
    color: var(--dixie-red);
    margin-bottom: var(--spacing-lg);
    text-align: center;
    font-size: 2rem;
}

.login-box input {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--sandstone);
    border-radius: 6px;
    font-size: 1rem;
    margin-bottom: var(--spacing-md);
}

.login-box input:focus {
    outline: none;
    border-color: var(--dixie-red);
}

.login-box button {
    width: 100%;
    padding: 1rem;
    background: var(--dixie-red);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.login-box button:hover {
    background: #B82510;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 46, 18, 0.3);
}

.admin-container {
    min-height: 100vh;
    background: var(--vintage-cream);
}

.admin-header {
    background: var(--deep-charcoal);
    color: white;
    padding: var(--spacing-lg);
    border-bottom: 3px solid var(--dixie-red);
}

.admin-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.admin-logo-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.admin-icon {
    width: 50px;
    object-fit: contain;
}

.admin-logo-section h1 {
    color: var(--radio-gold);
    font-size: 1.75rem;
    margin: 0;
    line-height: 1;
    white-space: nowrap;
}

.admin-nav {
    display: flex;
    gap: var(--spacing-md);
    margin-left: auto;
    align-items: center;
    flex-wrap: wrap;
}

.admin-nav-links {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.admin-nav-links a {
    color: white;
    text-decoration: none;
    padding: 0.7rem 1rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-weight: 600;
    transition: all 0.2s ease;
}

.admin-nav-links a:hover,
.admin-nav-links a.active {
    background: var(--dixie-red);
    border-color: var(--radio-gold);
    transform: translateY(-1px);
}

.admin-site-link {
    background: rgba(212, 175, 55, 0.18) !important;
    border-color: rgba(212, 175, 55, 0.35) !important;
}

.admin-logout-form {
    margin: 0;
}

.admin-user-label {
    margin: 0;
    color: var(--desert-sand);
    font-size: 0.95rem;
}

.btn-primary,
.btn-secondary,
.btn-logout,
.btn-edit,
.btn-delete,
.btn-preview {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--dixie-red);
    color: white;
}

.btn-primary:hover {
    background: #B82510;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 46, 18, 0.3);
}

.btn-secondary {
    background: var(--slate-gray);
    color: white;
}

.btn-secondary:hover {
    background: #3a3a3a;
}

.btn-logout {
    background: var(--canyon-shadow);
    color: white;
}

.btn-logout:hover {
    background: #6d3510;
}

.btn-edit {
    background: var(--accent-blue);
    color: white;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-edit:hover {
    background: #153950;
}

.btn-delete {
    background: #8B0000;
    color: white;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-delete:hover {
    background: #660000;
}

.btn-preview {
    background: var(--radio-gold);
    color: var(--deep-charcoal);
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-preview:hover {
    background: var(--canyon-shadow);
    color: white;
}

.admin-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-xl) var(--spacing-md);
}

.admin-section {
    background: white;
    padding: var(--spacing-xl);
    border-radius: 12px;
    margin-bottom: var(--spacing-xl);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: 1px solid var(--sandstone);
}

.admin-section h2 {
    color: var(--dixie-red);
    font-size: 1.8rem;
    margin-bottom: var(--spacing-lg);
    border-bottom: 2px solid var(--sandstone);
    padding-bottom: var(--spacing-sm);
}

.admin-overview-copy {
    color: var(--slate-gray);
    font-size: 1.05rem;
    margin-bottom: var(--spacing-lg);
}

.admin-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--spacing-md);
}

.admin-overview-card {
    display: block;
    padding: var(--spacing-lg);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    background: linear-gradient(135deg, var(--vintage-cream) 0%, white 100%);
    border: 2px solid var(--sandstone);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: all 0.25s ease;
}

.admin-overview-card:hover {
    border-color: var(--dixie-red);
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(212, 46, 18, 0.12);
}

.admin-overview-card h3 {
    color: var(--accent-blue);
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.admin-overview-card p {
    color: var(--slate-gray);
    margin: 0;
}

.upload-form,
.edit-form form {
    max-width: 600px;
}

body.modal-open {
    overflow: hidden;
}

.form-group {
    margin-bottom: var(--spacing-md);
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--deep-charcoal);
    margin-bottom: var(--spacing-xs);
}

.form-group input[type="text"],
.form-group input[type="file"],
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--sandstone);
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--dixie-red);
}

.form-actions {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

.recordings-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.recording-item {
    background: var(--vintage-cream);
    padding: var(--spacing-md);
    border-radius: 8px;
    border: 1px solid var(--sandstone);
}

.recording-info h3 {
    color: var(--accent-blue);
    font-size: 1.3rem;
    margin-bottom: var(--spacing-xs);
}

.recording-description {
    color: var(--slate-gray);
    margin-bottom: var(--spacing-xs);
}

.recording-filename {
    font-size: 0.9rem;
    color: var(--canyon-shadow);
    font-family: 'Courier New', monospace;
}

.recording-actions {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
    flex-wrap: wrap;
}

.edit-form {
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 2px solid var(--sandstone);
}

.recording-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1200;
}

.recording-modal.is-open {
    display: flex;
}

.recording-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(21, 34, 42, 0.68);
    backdrop-filter: blur(3px);
}

.recording-modal-dialog {
    position: relative;
    width: min(1100px, calc(100vw - 2rem));
    height: min(92vh, 900px);
    background: linear-gradient(180deg, #fffdf8 0%, #ffffff 100%);
    border: 1px solid rgba(150, 101, 58, 0.35);
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1;
}

.recording-modal-header,
.recording-modal-footer {
    padding: 1.25rem 1.5rem;
    background: linear-gradient(180deg, rgba(244, 230, 205, 0.85) 0%, rgba(255, 255, 255, 0.96) 100%);
}

.recording-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid rgba(150, 101, 58, 0.2);
}

.recording-modal-header h3 {
    margin: 0;
    color: var(--accent-blue);
    font-size: 1.6rem;
}

.recording-modal-eyebrow {
    margin: 0 0 0.35rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--dixie-red);
    font-weight: 700;
}

.recording-modal-close {
    border: none;
    background: transparent;
    color: var(--slate-gray);
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.recording-modal-close:hover {
    color: var(--dixie-red);
}

.recording-modal-form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.recording-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
    min-height: 0;
}

.recording-modal-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.recording-meta-card {
    background: rgba(244, 230, 205, 0.45);
    border: 1px solid rgba(150, 101, 58, 0.25);
    border-radius: 12px;
    padding: 0.9rem 1rem;
}

.recording-meta-label {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--canyon-shadow);
    margin-bottom: 0.35rem;
    font-weight: 700;
}

.recording-meta-card code,
.recording-meta-card a {
    word-break: break-word;
}

.form-group-transcript {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 320px;
}

.form-group-transcript textarea {
    flex: 1;
    min-height: 320px;
    resize: vertical;
    overflow-y: auto;
    line-height: 1.5;
}

.recording-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-sm);
    border-top: 1px solid rgba(150, 101, 58, 0.2);
}

/* Admin Analytics */
.admin-analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.analytics-card {
    background: linear-gradient(135deg, var(--vintage-cream) 0%, var(--desert-sand) 100%);
    border: 1px solid var(--sandstone);
    border-radius: 6px;
    padding: var(--spacing-sm);
    text-align: center;
    transition: all 0.3s ease;
}

.analytics-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-color: var(--dixie-red);
}

.analytics-card-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--dixie-red);
    margin-bottom: 0.25rem;
}

.analytics-card-label {
    font-size: 0.75rem;
    color: var(--slate-gray);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.top-downloads-list {
    background: white;
    border-radius: 8px;
    padding: var(--spacing-md);
    border: 1px solid var(--sandstone);
}

.admin-analytics-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}

.top-download-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm);
    border-bottom: 1px solid var(--desert-sand);
    transition: background 0.2s ease;
}

.top-download-item:last-child {
    border-bottom: none;
}

.top-download-item:hover {
    background: var(--vintage-cream);
}

.download-title {
    font-weight: 600;
    color: var(--deep-charcoal);
    flex: 1;
}

.download-count {
    color: var(--dixie-red);
    font-weight: bold;
    font-size: 0.9rem;
}

.success-message,
.error-message {
    padding: var(--spacing-md);
    border-radius: 6px;
    margin-bottom: var(--spacing-md);
    font-weight: 600;
}

.success-message {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Footer */
footer {
    background: var(--deep-charcoal);
    color: var(--vintage-cream);
    padding: var(--spacing-lg);
    text-align: center;
    margin-top: var(--spacing-xl);
}

.footer-content {
    max-width: var(--container-width);
    margin: 0 auto;
}

.footer-content p {
    margin-bottom: var(--spacing-xs);
    color: var(--desert-sand);
}

.footer-content a {
    color: var(--radio-gold);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-content a:hover {
    color: var(--dixie-red);
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Mobile header: portrait left, title right, nav buttons side by side */
    .header-content {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .logo-section {
        flex-direction: row;
        align-items: center;
        gap: var(--spacing-sm);
        justify-content: flex-start;
        text-align: left;
    }

    .header-portrait {
        width: 50px;
        height: 50px;
    }

    .logo-text h1 {
        font-size: 1.3rem;
    }

    .tagline {
        font-size: 0.75rem;
    }

    .main-nav ul {
        flex-direction: row;
        gap: 0.5rem;
        justify-content: flex-start;
    }

    .main-nav a {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
        white-space: nowrap;
    }

    /* Remove padding/margin on mobile */
    .main-content {
        padding: 0;
        margin: 0 auto;
    }

    .archive-container {
        padding: var(--spacing-md);
    }

    .archive-header {
        margin-bottom: var(--spacing-md);
        padding-bottom: var(--spacing-md);
    }

    .archive-header h2 {
        font-size: 1.8rem;
    }

    .archive-description {
        font-size: 0.95rem;
    }

    .audio-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }

    .audio-card {
        padding: var(--spacing-sm);
    }

    /* FIX: Download button to be a circle with just an icon on mobile */
    .card-actions {
        flex-direction: row;
        gap: 0.5rem;
        align-items: center;
        min-width: 0;
        width: 100%;
    }

    .play-button {
        /* Let play button take up remaining space */
        flex: 1 1 auto;
        font-size: 0.9rem;
        padding: 0.75rem 1rem;
        min-width: 0;
        overflow: hidden;
        max-width: 100%;
    }

    .download-link {
        flex: 0 0 44px; /* Slightly smaller fixed size for mobile */
        height: 44px;
        padding: 0;
    }
    
    .download-link svg {
        /* Ensure the icon itself is visible */
        width: 1.3rem;
        height: 1.3rem;
    }

    /* Mobile player adjustments */
    .audio-player {
        padding: var(--spacing-sm);
    }

    .audio-player:not(.active) {
        bottom: -200px;
    }

    .player-container {
        grid-template-columns: 1fr;
        gap: var(--spacing-xs);
        padding: var(--spacing-xs);
    }

    .player-download-btn {
        display: none !important;
    }

    .player-controls {
        justify-content: center;
    }

    .volume-container {
        display: none;
    }

    .close-player {
        position: absolute;
        top: 0.5rem;
        right: 0.5rem;
        z-index: 10;
        pointer-events: auto;
    }

    /* About page mobile */
    .about-hero {
        grid-template-columns: 1fr;
        text-align: center;
        padding: var(--spacing-md);
    }

    .hero-images {
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
    }

    .about-portrait,
    .about-action {
        width: 150px;
        height: 180px;
    }

    /* Recording actions in admin */
    .recording-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .recording-actions button {
        width: 100%;
    }

    .recording-modal-dialog {
        width: calc(100vw - 1rem);
        height: calc(100vh - 1rem);
        border-radius: 14px;
    }

    .recording-modal-header,
    .recording-modal-body,
    .recording-modal-footer {
        padding: 1rem;
    }

    .recording-modal-footer {
        flex-direction: column-reverse;
    }

    .recording-modal-footer .btn-primary,
    .recording-modal-footer .btn-secondary {
        width: 100%;
    }

    .form-group-transcript {
        min-height: 260px;
    }

    .form-group-transcript textarea {
        min-height: 260px;
    }

    .admin-header-content,
    .admin-nav {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-nav-links {
        width: 100%;
    }
}

@media (max-width: 540px) {
    .archive-container {
        padding: var(--spacing-sm);
    }

    .audio-card {
        padding: var(--spacing-xs);
    }

    .card-actions {
        min-width: 0;
    }

    .play-button {
        padding: 0.75rem 0.75rem;
        font-size: 0.85rem;
        min-width: 0;
    }
}

@media (max-width: 480px) {
    .logo-text h1 {
        font-size: 1.3rem;
    }

    .archive-header h2 {
        font-size: 1.5rem;
    }

    .about-portrait,
    .about-action {
        width: 150px;
        height: 200px;
    }
}

/* Recording Page Styles */
.recording-page {
    max-width: 900px;
    margin: 0 auto;
}

.recording-container {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    border: 1px solid var(--sandstone);
}

/* New style for the action bar below the standalone player */
.recording-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-top: -0.5rem;
    margin-bottom: var(--spacing-lg);
}

.recording-toolbar .download-link {
    flex: 0 0 auto;
    min-width: 170px;
    padding-inline: 1.25rem;
}

.breadcrumb {
    margin-bottom: 1.5rem;
}

.breadcrumb a {
    color: var(--dixie-red);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: var(--canyon-shadow);
}

.recording-header {
    border-bottom: 3px solid var(--dixie-red);
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
}

.recording-header h2 {
    font-size: 2.5rem;
    color: var(--dixie-red);
    margin-bottom: 0.5rem;
}

.recording-meta {
    color: var(--slate-gray);
    font-size: 0.95rem;
}

.standalone-player {
    background: linear-gradient(135deg, var(--vintage-cream) 0%, white 100%);
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    border: 2px solid var(--sandstone);
}

.standalone-player audio {
    width: 100%;
    height: 54px;
}

.recording-details {
    margin-bottom: 2rem;
}

.recording-details h3 {
    color: var(--accent-blue);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.recording-description-full {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--deep-charcoal);
}

.share-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.recording-share-buttons {
    margin-bottom: 0;
}

.share-btn {
    background: var(--dixie-red);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
}

.share-btn:hover {
    background: var(--canyon-shadow);
    transform: translateY(-2px);
}

.share-url-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--sandstone);
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    margin-bottom: 2rem;
    background: white;
}

.recording-transcript {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--deep-charcoal);
    white-space: normal;
}

.transcript-empty {
    color: var(--slate-gray);
    font-style: italic;
}

.related-recordings {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--sandstone);
}

.related-recordings h3 {
    color: var(--dixie-red);
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.related-card {
    background: var(--vintage-cream);
    padding: 1.5rem;
    border-radius: 8px;
    border: 2px solid var(--sandstone);
    transition: all 0.3s ease;
}

.related-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(212, 46, 18, 0.2);
    border-color: var(--dixie-red);
}

.related-card h4 {
    color: var(--accent-blue);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.related-card p {
    color: var(--slate-gray);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.related-link {
    color: var(--dixie-red);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.related-link:hover {
    color: var(--canyon-shadow);
}

/* Recording Page Mobile */
@media (max-width: 768px) {
    .recording-container {
        padding: 1.5rem;
    }

    .recording-header h2 {
        font-size: 1.8rem;
    }

    .recording-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .recording-toolbar .download-link {
        width: 100%;
        min-width: 0;
    }

    .share-buttons {
        flex-direction: column;
    }

    .related-grid {
        grid-template-columns: 1fr;
    }
}

/* ================================== */
/* Page Analytics */
/* ================================== */

.page-analytics {
    padding: var(--spacing-md);
    margin-top: var(--spacing-lg);
    text-align: center;
}

.analytics-container {
    max-width: var(--container-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-lg);
}

.analytics-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--slate-gray);
    font-family: 'Georgia', serif;
    line-height: 1;
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--slate-gray);
    font-weight: 500;
}

.analytics-divider {
    width: 1px;
    height: 30px;
    background: var(--sandstone);
}

@media (max-width: 768px) {
    .analytics-container {
        gap: var(--spacing-md);
    }

    .stat-value {
        font-size: 1.25rem;
    }

    .stat-label {
        font-size: 0.7rem;
    }

    .analytics-divider {
        height: 25px;
    }
}
