* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --background: #ffffff;
    --foreground: #0a0a0a;
    --card: #ffffff;
    --card-foreground: #0a0a0a;
    --popover: #ffffff;
    --popover-foreground: #0a0a0a;
    --primary: #171717;
    --primary-foreground: #fafafa;
    --secondary: #f5f5f5;
    --secondary-foreground: #171717;
    --muted: #f5f5f5;
    --muted-foreground: #737373;
    --accent: #f5f5f5;
    --accent-foreground: #171717;
    --destructive: #dc2626;
    --destructive-foreground: #fafafa;
    --destructive-bg: rgba(220, 38, 38, 0.1);
    --border: #e5e5e5;
    --input: #e5e5e5;
    --ring: #171717;
    --radius-outer: 2.5rem;
    --radius-inner: 1.5rem;
    --success: #16a34a;
    --success-bg: rgba(22, 163, 74, 0.1);
    --warning: #ea580c;
    --warning-bg: rgba(234, 88, 12, 0.1);
    --info: #3b82f6;
}

[data-theme="dark"] {
    --background: #0a0a0a;
    --foreground: #fafafa;
    --card: #0a0a0a;
    --card-foreground: #fafafa;
    --popover: #0a0a0a;
    --popover-foreground: #fafafa;
    --primary: #fafafa;
    --primary-foreground: #171717;
    --secondary: #171717;
    --secondary-foreground: #fafafa;
    --muted: #171717;
    --muted-foreground: #a3a3a3;
    --accent: #171717;
    --accent-foreground: #fafafa;
    --destructive: #dc2626;
    --destructive-foreground: #fafafa;
    --destructive-bg: rgba(220, 38, 38, 0.1);
    --border: #404040;
    --input: #262626;
    --ring: #fafafa;
    --success: #16a34a;
    --success-bg: rgba(22, 163, 74, 0.1);
    --warning: #ea580c;
    --warning-bg: rgba(234, 88, 12, 0.1);
    --info: #3b82f6;
}

/* Always show scrollbar to prevent UI shift (PRD requirement 2.1) */
html {
    overflow-y: scroll;
    scrollbar-gutter: stable;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--background);
    color: var(--foreground);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s ease, color 0.3s ease;
    position: relative;
    overflow-x: hidden;
    min-height: 100vh; /* Ensure minimum height to always show scrollbar */
}

/* Custom scrollbar styling to match theme */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--muted);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--muted-foreground);
    border-radius: 4px;
    opacity: 0.6;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--foreground);
    opacity: 0.8;
}

[data-theme="dark"] ::-webkit-scrollbar-track {
    background: var(--muted);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: var(--muted-foreground);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: var(--foreground);
}

/* For Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--muted-foreground) var(--muted);
}

/* Animated Background */
.animated-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    opacity: 1;
}

.background-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.floating-element {
    position: absolute;
    border-radius: 50%;
    background: var(--muted-foreground);
    transition: opacity 0.3s ease;
    will-change: transform, opacity;
}

[data-theme="dark"] .floating-element {
    background: var(--muted-foreground);
}

.dot-small {
    width: 3px;
    height: 3px;
    opacity: 0.2;
}

.dot-medium {
    width: 5px;
    height: 5px;
    opacity: 0.35;
}

.dot-large {
    width: 7px;
    height: 7px;
    opacity: 0.5;
}

.dot-extra-large {
    width: 9px;
    height: 9px;
    opacity: 0.65;
}

[data-theme="dark"] .dot-small { opacity: 0.15; }
[data-theme="dark"] .dot-medium { opacity: 0.25; }
[data-theme="dark"] .dot-large { opacity: 0.4; }
[data-theme="dark"] .dot-extra-large { opacity: 0.55; }

/* Header */
.pill-header {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-outer);
    padding: 0.5rem 0;
    margin: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    width: calc(100% - 1.5rem);
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}



.pill-header h2 {
    margin: 0;
    font-size: 1rem;
    color: var(--foreground);
    text-align: center;
    font-weight: 600;
    flex-grow: 1;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.nav-left, .nav-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 1;
}

.nav-left {
    justify-content: flex-start;
    padding-left: 0.5rem;
}

.nav-right {
    justify-content: flex-end;
    padding-right: 0.5rem;
}

.nav-btn {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--foreground);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    min-width: fit-content;
    height: 2rem;
    box-sizing: border-box;
}

.external-link-icon {
    opacity: 0.85;
}

.nav-btn:hover {
    background: var(--secondary);
    border-color: var(--ring);
    color: var(--secondary-foreground);
}

.nav-btn.active {
    background: var(--primary);
    color: var(--primary-foreground);
    border-color: var(--primary);
}

.theme-toggle {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--foreground);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-sizing: border-box;
}

.theme-toggle:hover {
    background: var(--secondary);
    border-color: var(--ring);
    color: var(--secondary-foreground);
}

/* Footer */
.pill-footer {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-outer);
    padding: 0.5rem 0;
    margin: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 100;
    margin-top: 2rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    width: calc(100% - 1.5rem);
}

/* Fixed footer only when listen view is active */
.footer-fixed {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    transform: none !important;
    margin-top: 0 !important;
    max-width: 1000px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.footer-left, .footer-right {
    flex: 1;
    display: flex;
    align-items: center;
}

.footer-left {
    justify-content: flex-start;
    padding-left: 1.5rem;
}

.footer-right {
    justify-content: flex-end;
    padding-right: 1.5rem;
}

.footer-center {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

.footer-left span, .footer-right span {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    margin: 0;
}

.footer-right a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-right a:hover {
    color: var(--ring);
    text-decoration: underline;
}

.footer-link {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--foreground);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    min-width: fit-content;
    height: 2rem;
    box-sizing: border-box;
}

.footer-link:hover {
    background: var(--secondary);
    border-color: var(--ring);
    color: var(--secondary-foreground);
    text-decoration: none;
}

/* Container */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    padding-top: 5rem;
    /* Keep footer visible when there is vertical space */
    min-height: calc(100vh - 6rem);
}

/* Container adjustments when footer is fixed (listen view) */
.container-footer-fixed {
    padding-bottom: 6rem !important;
    min-height: calc(100vh - 11rem) !important;
}

/* View Sections */
.view-section {
    display: none;
}

.view-section.active {
    display: block;
}

/* Listen View Specific Styling */
#listenView.view-section.active {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: calc(100vh - 11rem);
}

.view-header {
    text-align: center;
    margin-bottom: 2rem;
}

.view-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--foreground);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.view-header p {
    color: var(--muted-foreground);
    font-size: 1.1rem;
}

/* Filter Controls */
.filter-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.domain-filter-container {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-inner);
    padding: 0.25rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.domain-filter-btn {
    background: transparent;
    border: none;
    border-radius: 0.75rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--muted-foreground);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.domain-filter-btn:hover {
    background: var(--secondary);
    color: var(--secondary-foreground);
}

.domain-filter-btn.active {
    background: var(--primary);
    color: var(--primary-foreground);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.domain-filter-btn.active:hover {
    background: var(--primary);
    opacity: 0.9;
}

/* Episodes List */
.episodes-list {
    margin-top: 2rem;
}

.month-group {
    margin-bottom: 2rem;
}

.month-header {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-inner);
    padding: 1rem;
    margin-bottom: 1rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.month-header:hover {
    background: var(--secondary);
    color: var(--secondary-foreground);
}

.month-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--foreground);
}

.collapse-icon {
    transition: transform 0.2s ease;
}

.month-group.collapsed .collapse-icon {
    transform: rotate(-90deg);
}

.month-episodes {
    display: block;
}

.month-group.collapsed .month-episodes {
    display: none;
}

.episode-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-inner);
    padding: 1rem;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    /* Make rows consistent regardless of title length */
    min-height: 88px;
}

.episode-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(22, 163, 74, 0.15);
    width: var(--progress-width, 0%);
    transition: width 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.episode-item.fully-watched {
    border-color: var(--success);
    filter: saturate(0.7);
}

.episode-item:hover {
    background: var(--secondary);
    color: var(--secondary-foreground);
}

.episode-content {
    position: relative;
    z-index: 2;
    /* Prevent overlap with the absolutely positioned delete button */
    padding-right: 3rem;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.episode-delete-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--destructive);
    color: var(--destructive);
    background: var(--destructive-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    z-index: 3;
}

.episode-delete-btn:hover {
    background: var(--destructive);
    color: var(--destructive-foreground);
    border-color: var(--destructive);
}

.episode-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 0.5rem;
    line-height: 1.3;
    /* Clamp to two lines to prevent variable row heights */
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: 2.6em; /* 1.3 line-height * 2 lines */
    min-height: 2.6em; /* ensure one-line titles reserve equal space */
}

.episode-description {
    font-size: 1rem;
    color: var(--muted-foreground);
    margin-bottom: 0.5rem;
    line-height: 1.3;
    opacity: 0.8;
}

.episode-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    margin-top: auto; /* push meta to consistent vertical position */
}



/* Scoped rule for episode cards to ensure visibility */
.episodes-list .episode-date {
    color: var(--foreground);
    font-size: 0.8rem;
}

.domain-chip {
    background: var(--primary);
    color: var(--primary-foreground);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Audio Player */
.audio-player-container {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-outer);
    padding: 2rem;
    margin: 2rem 0;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.episode-info {
    text-align: center;
    margin-bottom: 2rem;
}

.back-btn {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: var(--foreground);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 auto 1rem;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.back-btn:hover {
    background: var(--secondary);
    border-color: var(--ring);
    color: var(--secondary-foreground);
}

#currentEpisodeTitle {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

#currentEpisodeDate {
    color: var(--muted-foreground);
}

.audio-player {
    max-width: 600px;
    margin: 0 auto;
}

.progress-container {
    margin-bottom: 2rem;
}

.time-display {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

.progress-bar {
    height: 8px;
    background: var(--muted);
    border-radius: 4px;
    position: relative;
    cursor: pointer;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    width: 0%;
    transition: width 0.1s ease;
}

/* Removed - replaced with improved version below */

.player-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.control-btn {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: relative;
    color: var(--foreground);
}

.control-btn:hover {
    background: var(--secondary);
    border-color: var(--ring);
    color: var(--secondary-foreground);
}

.play-pause-btn {
    width: 80px;
    height: 80px;
    background: var(--primary);
    color: var(--primary-foreground);
    border-color: var(--primary);
}

.play-pause-btn:hover {
    background: var(--primary);
    color: var(--primary-foreground);
    opacity: 0.9;
}

.seek-btn {
    flex-direction: column;
    gap: 0.25rem;
}

.seek-label {
    font-size: 0.75rem;
    font-weight: 500;
}

.secondary-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.speed-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.speed-control label {
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

/* Removed - replaced with custom dropdown */

.action-btn {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: var(--foreground);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.action-btn:hover {
    background: var(--secondary);
    border-color: var(--ring);
    color: var(--secondary-foreground);
}

.action-btn.watched {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.action-btn.watched:hover {
    background: var(--success);
    opacity: 0.9;
}

/* Upload Form */
.upload-container {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-outer);
    padding: 2rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.upload-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--foreground);
}

/* Removed - replaced with more specific input styling above */

/* Ensure all form inputs follow theme consistently */
.form-group input[type="text"],
.form-group input[type="url"],
.form-group input[type="number"] {
    width: 100%;
    background: var(--input);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: var(--foreground);
    transition: all 0.2s ease;
}



.form-group input:focus {
    outline: none;
    border-color: var(--ring);
    box-shadow: 0 0 0 2px var(--ring)20;
}

/* Ensure all buttons have consistent theming */
button, .btn {
    font-family: inherit;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Ensure upload area follows theme */
.file-upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius-inner);
    padding: 2rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--card);
    color: var(--foreground);
    margin-bottom: 1.5rem;
}

.file-upload-area:hover {
    border-color: var(--primary);
    background: var(--secondary);
    color: var(--secondary-foreground);
}

.upload-icon {
    font-size: 2.5rem;
    color: var(--muted-foreground);
    margin-bottom: 0.75rem;
}

.upload-text {
    font-size: 1rem;
    color: var(--foreground);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.upload-subtext {
    color: var(--muted-foreground);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.selected-file {
    color: var(--success);
    font-size: 0.875rem;
    font-weight: 500;
}

.form-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

/* Buttons */
.btn {
    background: var(--primary);
    color: var(--primary-foreground);
    border: none;
    border-radius: var(--radius-inner);
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn:hover {
    background: var(--primary);
    opacity: 0.9;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--primary-foreground);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--secondary-foreground);
}

.btn-secondary:hover {
    background: var(--secondary);
    opacity: 0.9;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: var(--success);
    opacity: 0.9;
}

/* Status Messages */
.status-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: var(--radius-inner);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.status-message.success {
    background: var(--success-bg);
    border: 1px solid var(--success);
    color: var(--success);
}

.status-message.error {
    background: var(--destructive-bg);
    border: 1px solid var(--destructive);
    color: var(--destructive);
}

.status-message.warning {
    background: var(--warning-bg);
    border: 1px solid var(--warning);
    color: var(--warning);
}



/* Very small screens - show only icons to save space */
@media (max-width: 360px) {
    #projectsBtn, #listViewBtn {
        font-size: 0;
        padding: 0.5rem;
        min-width: 2rem;
    }
    
    #projectsBtn svg, #listViewBtn svg {
        margin: 0;
    }
    
    .footer-link {
        font-size: 0;
        padding: 0.375rem;
        min-width: 1.75rem;
    }
    
    .footer-link svg {
        margin: 0;
    }
}

@media (max-width: 480px) {
    .pill-header h2 {
        display: none; /* Hide header title on very small screens to prevent overlap */
    }
    
    .pill-header {
        padding: 0.5rem 0;
        margin: 0.5rem;
        width: calc(100% - 1rem);
    }
    
    .container {
        padding: 1rem;
        padding-top: 3.5rem;
        /* Slightly smaller subtraction on very small screens */
        min-height: calc(100vh - 4.5rem);
    }
    
    .container-footer-fixed {
        padding-bottom: 4.5rem !important;
        min-height: calc(100vh - 8rem) !important;
    }
    
    .nav-left {
        padding-left: 0.5rem;
    }
    
    .nav-right {
        padding-right: 0.5rem;
    }
    
    .nav-btn {
        font-size: 0.75rem;
        padding: 0.5rem 0.75rem;
        gap: 0.375rem;
        height: 2rem;
    }
    
    .theme-toggle {
        width: 2rem;
        height: 2rem;
    }
    
    .file-upload-area {
        padding: 2rem 1rem;
    }
    
    .domain-filter-container {
        gap: 0.25rem;
        padding: 0.125rem;
    }
    
    .domain-filter-btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .custom-domain-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .custom-domain-btn {
        width: 100%;
        justify-content: center;
    }
    

    
    .pill-footer {
        padding: 0.625rem 0.375rem;
        margin: 0.5rem;
    }
    
    .pill-footer.footer-fixed {
        width: calc(100% - 1rem) !important;
    }
    
    .footer-link {
        font-size: 0.65rem;
        padding: 0.25rem 0.375rem;
        height: 1.5rem;
        gap: 0.25rem;
    }
    
    .footer-left span, .footer-right span {
        font-size: 0.7rem;
    }
}

/* Animations */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
    }
    to { 
        opacity: 1; 
    }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Loading Spinner */
.spinner {
    border: 2px solid var(--muted);
    border-top: 2px solid var(--primary);
    border-radius: 50%;
    width: 1rem;
    height: 1rem;
    animation: spin 1s linear infinite;
}

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

/* Custom Dropdown Components */
.custom-dropdown {
    position: relative;
    display: inline-block;
    width: 100%;
}

.custom-dropdown-trigger {
    background: var(--input);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.5rem 2.5rem 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: var(--foreground);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
    width: 100%;
    min-height: 2.5rem;
    box-sizing: border-box;
}

.custom-dropdown-trigger:hover {
    background: var(--secondary);
    border-color: var(--ring);
    color: var(--secondary-foreground);
}

.custom-dropdown-trigger.open {
    border-color: var(--ring);
    box-shadow: 0 0 0 2px rgba(23, 23, 23, 0.1);
}

[data-theme="dark"] .custom-dropdown-trigger.open {
    box-shadow: 0 0 0 2px rgba(250, 250, 250, 0.1);
}

.custom-dropdown-arrow {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.2s ease;
    color: var(--muted-foreground);
}

.custom-dropdown-trigger.open .custom-dropdown-arrow {
    transform: translateY(-50%) rotate(180deg);
}

.custom-dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--popover);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    margin-top: 0.25rem;
    z-index: 1000;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    display: none;
}

[data-theme="dark"] .custom-dropdown-content {
    background: rgba(10, 10, 10, 0.95);
}

.custom-dropdown.open .custom-dropdown-content {
    display: block;
    animation: dropdownFadeIn 0.15s ease-out;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.custom-dropdown-option {
    padding: 0.75rem;
    font-size: 0.875rem;
    color: var(--popover-foreground);
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border);
}

.custom-dropdown-option:last-child {
    border-bottom: none;
}

.custom-dropdown-option:hover {
    background: var(--secondary);
    color: var(--secondary-foreground);
}

.custom-dropdown-option.selected {
    background: var(--primary);
    color: var(--primary-foreground);
}

.custom-dropdown-option.selected:hover {
    background: var(--primary);
    opacity: 0.9;
}

/* Speed Control Buttons */
.speed-control {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.speed-control label {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    white-space: nowrap;
}

.speed-buttons {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 0.25rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0.9;
}

[data-theme="dark"] .speed-buttons {
    background: var(--card);
    opacity: 0.9;
}

.speed-btn {
    background: transparent;
    border: none;
    border-radius: 0.625rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--muted-foreground);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-width: 2.5rem;
}

.speed-btn:hover {
    background: var(--secondary);
    color: var(--secondary-foreground);
}

[data-theme="dark"] .speed-btn:hover {
    background: var(--secondary);
    color: var(--secondary-foreground);
}

.speed-btn.active {
    background: var(--primary);
    color: var(--primary-foreground);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.speed-btn.active:hover {
    background: var(--primary);
    opacity: 0.9;
}

/* Upload Form Custom Dropdown */
.form-group .custom-dropdown-trigger {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    min-height: 2.75rem;
}

/* Custom Domain Input */
.custom-domain-input {
    margin-top: 1rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-inner);
    padding: 1rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: slideIn 0.3s ease-out;
}

.custom-domain-input input {
    width: 100%;
    background: var(--input);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: var(--foreground);
    transition: all 0.2s ease;
    margin-bottom: 1rem;
}

.custom-domain-input input:focus {
    outline: none;
    border-color: var(--ring);
    box-shadow: 0 0 0 2px rgba(23, 23, 23, 0.1);
}

[data-theme="dark"] .custom-domain-input input:focus {
    box-shadow: 0 0 0 2px rgba(250, 250, 250, 0.1);
}

.custom-domain-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.custom-domain-btn {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    min-width: 4rem;
}

.custom-domain-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.custom-domain-option svg {
    flex-shrink: 0;
}

/* Fix progress bar handle visibility in dark mode */
.progress-handle {
    width: 16px;
    height: 16px;
    background: var(--primary);
    border: 2px solid var(--background);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 0%;
    transition: left 0.1s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .progress-handle {
    border-color: var(--background);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

/* Fix any SVG icon colors that might not follow theme */
svg {
  color: inherit;
}

/* Login Page Styles */
.login-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.login-container {
    max-width: 400px;
    width: calc(100% - 2rem);
    margin: 1rem;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--foreground);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.login-header p {
    color: var(--muted-foreground);
    font-size: 1rem;
}

.login-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-outer);
    padding: 2rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    position: relative;
}

.login-form {
    margin-bottom: 1rem;
}

.login-form .form-group {
    margin-bottom: 1.5rem;
}

.login-form .form-group:last-child {
    margin-bottom: 0;
}

.login-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--foreground);
}

.login-form input {
    width: 100%;
    background: var(--input);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: var(--foreground);
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.login-form input:focus {
    outline: none;
    border-color: var(--ring);
    box-shadow: 0 0 0 2px rgba(23, 23, 23, 0.1);
}

[data-theme="dark"] .login-form input:focus {
    box-shadow: 0 0 0 2px rgba(250, 250, 250, 0.1);
}

.login-error {
    background: var(--destructive-bg);
    border: 1px solid var(--destructive);
    color: var(--destructive);
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.login-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: rgb(21, 128, 61); /* Darker green for better contrast */
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Dark mode success message */
[data-theme="dark"] .login-success {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.4);
    color: rgb(74, 222, 128); /* Lighter green for dark mode */
}

.login-form .form-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.login-form .btn {
    width: 100%;
    justify-content: center;
    position: relative;
}

.login-form .btn #loginSpinner {
    margin-left: 0.5rem;
}

/* Login Separator */
.login-separator {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    gap: 1rem;
}

.separator-line {
    flex: 1;
    height: 1px;
    background: var(--border);
    opacity: 0.5;
}

.separator-text {
    color: var(--muted-foreground);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0 0.5rem;
}

/* OAuth Section */
.oauth-section {
    margin-top: 0;
}

/* GitHub Button */
.btn-github {
    background: var(--secondary);
    color: var(--foreground);
    border: 1px solid var(--border);
    width: 100%;
    justify-content: center;
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-github:hover {
    background: var(--muted);
    border-color: var(--ring);
}

.btn-github svg {
    flex-shrink: 0;
}

.btn-github:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

[data-theme="dark"] .btn-github {
    background: var(--card);
    border-color: var(--border);
}

[data-theme="dark"] .btn-github:hover {
    background: var(--accent);
}

#githubSpinner {
    margin-left: 0.5rem;
}

/* Guest Button (similar to GitHub) */
.btn-guest {
    background: var(--secondary);
    color: var(--foreground);
    border: 1px solid var(--border);
    width: 100%;
    justify-content: center;
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-guest:hover {
    background: var(--muted);
    border-color: var(--ring);
}

.btn-guest svg {
    flex-shrink: 0;
}

.btn-guest:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

[data-theme="dark"] .btn-guest {
    background: var(--card);
    border-color: var(--border);
}

[data-theme="dark"] .btn-guest:hover {
    background: var(--accent);
}

.theme-toggle-login {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--foreground);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-sizing: border-box;
}

.theme-toggle-login:hover {
    background: var(--secondary);
    border-color: var(--ring);
    color: var(--secondary-foreground);
}

.main-app {
    width: 100%;
    height: 100%;
}

/* Responsive adjustments for login */
@media (max-width: 640px) {
    .login-container {
        margin: 0.5rem;
        width: calc(100% - 1rem);
    }
    
    .login-header h1 {
        font-size: 2rem;
    }
    
    .login-card {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .login-header h1 {
        font-size: 1.75rem;
    }
    
    .login-card {
        padding: 1rem;
    }
}

.floating-element svg,
.custom-dropdown-arrow svg,
.nav-btn svg,
.control-btn svg,
.action-btn svg {
    stroke: currentColor;
    fill: none;
} 

/* Button text responsiveness */
.btn-text-mobile {
    display: none;
}

.btn-text-full {
    display: inline;
}

/* Responsive Design */
@media (max-width: 640px) {
    /* Button text switching for mobile */
    .btn-text-full {
        display: none;
    }
    
    .btn-text-mobile {
        display: inline;
    }
    
    .container {
        padding: 1rem;
        padding-top: 4rem;
        /* Ensure footer remains visible on small/medium devices */
        min-height: calc(100vh - 5rem);
    }
    
    .container-footer-fixed {
        padding-bottom: 5rem !important;
        min-height: calc(100vh - 9rem) !important;
    }
    
    .view-header h1 {
        font-size: 2rem;
    }
    
    .pill-header {
        padding: 0.375rem 0;
        margin: 0.5rem;
        width: calc(100% - 1rem);
    }
    
    .pill-header h2 {
        font-size: 0.7rem; /* Show but smaller on medium mobile */
    }
    
    .nav-left {
        padding-left: 0.375rem;
    }
    
    .nav-right {
        padding-right: 0.375rem;
    }
    
    .nav-btn {
        font-size: 0.7rem;
        padding: 0.375rem 0.5rem;
        gap: 0.25rem;
        height: 1.75rem;
    }
    
    .theme-toggle {
        width: 1.75rem;
        height: 1.75rem;
    }
    
    .player-controls {
        gap: 1rem;
    }
    
    .control-btn {
        width: 50px;
        height: 50px;
    }
    
    .play-pause-btn {
        width: 70px;
        height: 70px;
    }
    
    .secondary-controls {
        flex-direction: column;
        gap: 1rem;
    }
    

    
    .episode-header {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .episode-meta {
        justify-content: flex-start;
    }
    
    .filter-controls {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .domain-filter-container {
        width: 100%;
        justify-content: center;
    }
    
    .domain-filter-btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .pill-footer {
        flex-direction: column;
        gap: 0.75rem;
        padding: 0.75rem 0.5rem;
        margin: 0.5rem;
    }
    
    .pill-footer.footer-fixed {
        width: calc(100% - 1rem) !important;
    }
    
    .footer-left, .footer-right {
        padding: 0;
        justify-content: center;
    }
    
    .footer-center {
        gap: 0.375rem;
    }
    
    .footer-link {
        font-size: 0.7rem;
        padding: 0.375rem 0.5rem;
        height: 1.75rem;
    }
    
    .footer-left span, .footer-right span {
        font-size: 0.75rem;
    }
}

/* Upload Method Toggle Styles */
.upload-method-toggle {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.upload-method-toggle input[type="radio"] {
    display: none;
}

.upload-method-option {
    flex: 1;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--card);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.upload-method-option:hover {
    border-color: var(--primary);
    background: var(--secondary);
}

.upload-method-toggle input[type="radio"]:checked + .upload-method-option {
    border-color: var(--primary);
    background: var(--primary);
    color: var(--primary-foreground);
}

.method-title {
    font-weight: 600;
    font-size: 0.875rem;
}

.method-description {
    font-size: 0.75rem;
    opacity: 0.7;
}

.upload-method-toggle input[type="radio"]:checked + .upload-method-option .method-description {
    opacity: 0.8;
}

/* Mobile responsiveness for upload method toggle */
@media (max-width: 768px) {
    .upload-method-toggle {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .upload-method-option {
        padding: 0.75rem;
    }
    
    .method-title {
        font-size: 0.8rem;
    }
    
    .method-description {
        font-size: 0.7rem;
    }
}

/* Duplicate Detection Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--card);
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid var(--border);
}

.duplicate-modal {
    border-top: 4px solid var(--destructive);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: var(--foreground);
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--muted-foreground);
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--secondary);
    color: var(--foreground);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.duplicate-severity {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.duplicate-severity.error {
    background: var(--destructive-bg);
    border: 1px solid var(--destructive);
    color: var(--destructive);
}

.duplicate-severity.warning {
    background: rgba(234, 179, 8, 0.1);
    border: 1px solid #eab308;
    color: #b45309;
}

.duplicate-severity.none {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid #22c55e;
    color: #166534;
}

.severity-icon {
    font-size: 1.25rem;
    line-height: 1;
}

.severity-message {
    flex: 1;
}

.duplicate-warnings,
.duplicate-suggestions {
    margin-top: 1.5rem;
}

.duplicate-warnings h4,
.duplicate-suggestions h4 {
    margin: 0 0 1rem 0;
    color: var(--foreground);
    font-size: 1rem;
    font-weight: 600;
}

.warning-item,
.suggestion-item {
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.warning-item strong {
    color: var(--destructive);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.warning-item p,
.suggestion-item p {
    margin: 0.5rem 0;
    color: var(--muted-foreground);
}

.episode-list {
    margin-top: 0.75rem;
}

.episode-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.episode-item:last-child {
    margin-bottom: 0;
}

.episode-item strong {
    color: var(--foreground);
    font-size: 0.875rem;
}

.duplicate-modal .episode-date {
    color: var(--muted-foreground);
    font-size: 0.75rem;
}

/* Dark mode adjustments for duplicate modal */
[data-theme="dark"] .duplicate-severity.warning {
    background: rgba(234, 179, 8, 0.15);
    border-color: #ca8a04;
    color: #fbbf24;
}

[data-theme="dark"] .duplicate-severity.none {
    background: rgba(34, 197, 94, 0.15);
    border-color: #16a34a;
    color: #4ade80;
}

/* Mobile responsiveness for duplicate modal */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 1rem;
        max-height: 90vh;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem;
    }
    
    .modal-footer {
        flex-direction: column-reverse;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
    
    .duplicate-severity {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .episode-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
} 