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

:root {
    --action-button-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --action-button-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

body {
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #364795 0%, #40245f 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    flex: 1 0 auto;
    max-width: 100%;
    margin: 0;
    padding: 8px;
}

header {
    width: 100%;
    margin: 0 0 18px;
    padding: 12px 8px 0;
    text-align: left;
    color: white;
}

header h1 {
    font-size: 2.25em;
    margin-bottom: 4px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1em;
    opacity: 0.9;
}

main {
    display: grid;
    gap: 8px;
}

.form-section,
.status-section,
.queue-section,
.log-section {
    background: rgba(255, 255, 255, 0.9);
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.form-section h2,
.status-section h2,
.queue-section h2,
.log-section h2 {
    color: #4a5568;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.authentication-panel {
    width: min(100%, 560px);
    margin: 24px auto;
}

.authentication-panel .form-group small,
#spotify-settings-form .form-group small {
    display: block;
    margin-top: 6px;
    color: #4a5568;
    line-height: 1.4;
}

.spotify-connection-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: -8px 0 16px;
    font-weight: 600;
}

.spotify-connection-dot {
    width: 10px;
    height: 10px;
    flex: 0 0 10px;
    border-radius: 50%;
    background: #718096;
}

.spotify-connection-indicator.is-connected .spotify-connection-dot {
    background: #38a169;
}

.spotify-connection-indicator.is-disconnected .spotify-connection-dot {
    background: #e53e3e;
}

#authentication-status.status-error,
#spotify-settings-status.status-error {
    margin-top: 12px;
}

.music-note {
    color: inherit;
}

.log-details {
    width: 100%;
}

.log-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    cursor: pointer;
    list-style: none;
}

.log-summary::-webkit-details-marker {
    display: none;
}

.log-summary::before {
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 6px solid currentColor;
    content: '';
    transition: transform 0.15s ease;
}

.log-details[open] > .log-summary::before {
    transform: rotate(90deg);
}

.log-summary:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 3px;
}

.log-summary h2 {
    margin-bottom: 0;
}

.log-details > .clear-btn {
    display: block;
    margin: 12px 0 0 auto;
}

.clear-btn {
    background: #e53e3e;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.clear-btn:hover {
    background: #c53030;
}

.clear-btn:active {
    transform: translateY(1px);
}

.jellyfin-settings-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.jellyfin-settings-actions .download-btn {
    margin: 0;
}

.jellyfin-settings-actions .clear-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 0;
    border-bottom: 2px solid #e2e8f0;
}

.tab-button {
    padding: 10px 22px;
    border: 2px solid transparent;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    background: transparent;
    color: #4a5568;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: -2px;
}

.tab-button:hover {
    background: #edf2f7;
}

.tab-button.active {
    background: rgba(255, 255, 255, 0.9);
    border-color: #e2e8f0;
    color: #2d3748;
    border-bottom: 2px solid rgba(255, 255, 255, 0.9);
}

.tab-panel {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 4px 4px;
    padding: 12px;
    margin-bottom: 8px;
}

.form-group {
    margin-bottom: 20px;
}

.output-dir-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.output-dir-line-break {
    flex-basis: 100%;
    height: 0;
}

.output-dir-button {
    padding: 10px 14px;
    border: 2px solid #cbd5e0;
    border-radius: 6px;
    background: #fff;
    color: #2d3748;
    font-size: 15px;
    cursor: pointer;
}

.output-dir-button:hover,
.output-dir-button.selected {
    border-color: #4a5568;
    background: #edf2f7;
}

.output-dir-button.selected {
    box-shadow: inset 0 0 0 1px #4a5568;
}

.media-root-trigger {
    background: var(--action-button-gradient);
    border-color: transparent;
    color: white;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.media-root-trigger:hover {
    background: var(--action-button-gradient);
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: var(--action-button-shadow);
}

.media-root-trigger:active {
    transform: translateY(0);
}

.media-root-display {
    font-family: monospace;
    font-size: 1.05em;
    margin-bottom: 8px;
    word-break: break-all;
}

.media-root-controls {
    margin-top: 10px;
}

.media-root-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.media-root-editor {
    margin-top: 10px;
}

.media-root-editor input[type="text"] {
    margin-bottom: 8px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #4a5568;
}

input[type="url"],
input[type="text"],
input[type="password"],
input[type="number"],
input[type="time"],
select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #2d3748;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.url-input-group {
    display: flex;
    gap: 8px;
}

.url-input-group input[type="url"] {
    flex: 1;
    min-width: 0;
}

.url-clear-btn {
    min-width: 64px;
    min-height: 48px;
    padding: 8px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    background: #f7fafc;
    color: #2d3748;
    font-size: 14px;
    cursor: pointer;
}

.url-clear-btn:hover {
    background: #edf2f7;
}

input[type="url"]:focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="time"]:focus,
select:focus {
    outline: none;
    border-color: #667eea;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin-right: 10px;
    transform: scale(1.2);
}

.download-btn {
    width: 100%;
    padding: 15px;
    background: var(--action-button-gradient);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.download-btn .audio-download-icon {
    font-size: 1.3em;
}

.download-btn .video-download-icon {
    font-size: 0.9em;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--action-button-shadow);
}

.download-btn:active {
    transform: translateY(0);
}

.download-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

#status-container {
    text-align: center;
}

#status-message {
    font-size: 18px;
    color: #4a5568;
    margin-bottom: 20px;
}

#progress-container {
    margin-top: 20px;
}

#progress-bar {
    width: 100%;
    height: 20px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

#progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    width: 0%;
    transition: width 0.3s ease;
}

#progress-text {
    font-weight: 600;
    color: #4a5568;
}

#log-container {
    width: 100%;
    height: 300px;
    margin-top: 14px;
    overflow-y: auto;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
}

#log-content {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    color: #2d3748;
}

.hidden {
    display: none !important;
}

.panel-hidden-by-preference {
    display: none !important;
}

.status-success {
    color: #38a169 !important;
}

.status-error {
    color: #e53e3e !important;
}

.status-warning {
    color: #d69e2e !important;
}

.log-entry {
    margin-bottom: 5px;
    padding: 5px;
    border-radius: 4px;
}

.log-entry.success {
    background: #f0fff4;
    color: #38a169;
}

.log-entry.error {
    background: #fed7d7;
    color: #e53e3e;
}

.log-entry.warning {
    background: #fefcbf;
    color: #d69e2e;
}

.log-entry.info {
    background: #ebf8ff;
    color: #3182ce;
}

.dashboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    align-items: start;
}

.left-column {
    display: grid;
    grid-template-rows: none;
    align-content: start;
    gap: 8px;
}

.right-column {
    display: grid;
    grid-template-rows: none;
    align-content: start;
    gap: 8px;
}

.dashboard.settings-mode .left-column {
    grid-template-rows: auto;
}

.dashboard.settings-mode .right-column {
    grid-template-rows: auto;
    align-content: start;
}

.dashboard.settings-mode .download-view-panel {
    display: none;
}

.panel-visibility-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 8px;
}

.panel-visibility-option {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    min-height: 42px;
    padding: 8px;
    border: 1px solid rgba(74, 85, 104, 0.08);
    border-radius: 5px;
    background: rgba(74, 85, 104, 0.07);
    color: #2d3748;
    cursor: grab;
    user-select: none;
}

.panel-visibility-option:active {
    cursor: grabbing;
}

.notification-preference-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 8px;
}

.browser-notification-controls {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 16px;
}

.notification-preference-option,
.notification-preference-option:active {
    cursor: pointer;
}

.panel-visibility-option.is-dragging {
    opacity: 0.45;
}

.panel-visibility-drag-handle {
    color: #718096;
    font-size: 19px;
    line-height: 1;
}

.panel-visibility-option label {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    cursor: pointer;
}

.panel-visibility-option label span {
    overflow-wrap: anywhere;
}

.panel-visibility-option input[type="checkbox"] {
    appearance: none;
    position: relative;
    flex: 0 0 44px;
    width: 44px;
    height: 24px;
    margin: 0;
    border: 1px solid #a0aec0;
    border-radius: 999px;
    background: #a0aec0;
    cursor: pointer;
    transition: background-color 0.18s ease, border-color 0.18s ease;
}

.panel-visibility-option input[type="checkbox"]::before {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    content: '';
    transition: transform 0.18s ease;
}

.panel-visibility-option input[type="checkbox"]:checked {
    border-color: #3182ce;
    background: #3182ce;
}

.panel-visibility-option input[type="checkbox"]:checked::before {
    transform: translateX(20px);
}

.panel-visibility-option input[type="checkbox"]:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 3px;
}

body.dark-mode .panel-visibility-option {
    color: #b8c0cc;
    border-color: rgba(184, 192, 204, 0.08);
    background: rgba(184, 192, 204, 0.06);
}

body.dark-mode .panel-visibility-drag-handle {
    color: #9ca8b8;
}

.notification-container {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1000;
    display: grid;
    gap: 10px;
    width: min(420px, calc(100vw - 32px));
    pointer-events: none;
}

.notification-toast {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border-left: 4px solid #3182ce;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    color: #2d3748;
    pointer-events: auto;
    overflow-wrap: anywhere;
    animation: notification-appear 0.18s ease-out;
}

.notification-check_failed,
.notification-download_attention {
    border-left-color: #e53e3e;
}

.notification-dismiss {
    flex: 0 0 auto;
    padding: 0 2px;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

body.dark-mode .notification-toast {
    background: #2d3748;
    color: #e2e8f0;
}

@keyframes notification-appear {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Download queue section */
.queue-section {
    background: rgba(255, 255, 255, 0.9);
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    min-height: 100px;
}

#download-queue {
    display: grid;
    gap: 6px;
    margin: 0 0 10px;
    padding: 0;
    list-style: none;
}

.queue-item {
    min-width: 0;
    border-radius: 4px;
    background: #f7fafc;
    color: #2d3748;
    font-size: 14px;
}

.queue-item-details {
    min-width: 0;
}

.queue-item-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    min-height: 38px;
    padding: 8px 10px;
    cursor: pointer;
    list-style: none;
}

.queue-item-summary::-webkit-details-marker {
    display: none;
}

.queue-item-summary::before {
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 6px solid currentColor;
    content: '';
    transition: transform 0.15s ease;
}

.queue-item-details[open] > .queue-item-summary::before {
    transform: rotate(90deg);
}

.queue-item-name {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
}

.queue-item-status {
    flex: 0 0 auto;
    color: #4a5568;
    font-size: 12px;
    text-transform: capitalize;
}

.watched-channel-summary-status {
    flex: none;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: none;
    white-space: nowrap;
}

.watched-channel-details > .queue-item-summary {
    display: grid;
    grid-template-columns: 6px minmax(0, 1fr) minmax(0, 35%) auto;
}

.queue-item-downloading .queue-item-status {
    color: #2b6cb0;
}

.queue-item-paused .queue-item-status {
    color: #b7791f;
}

.queue-item-failed .queue-item-status {
    color: #c53030;
}

.queue-item-completed .queue-item-status {
    color: #2f855a;
}

.queue-item-completed_with_errors .queue-item-status {
    color: #b7791f;
}

.queue-item-remove-btn {
    flex: 0 0 auto;
    border: none;
    background: none;
    padding: 0 2px;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.7;
}

.queue-item-retry-btn {
    flex: 0 0 auto;
    width: 24px;
    border: none;
    background: none;
    padding: 0 2px;
    color: #2b6cb0;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.8;
}

.queue-item-retry-btn:hover {
    opacity: 1;
}

.queue-item-remove-btn:hover {
    opacity: 1;
}

.queue-track-list {
    display: grid;
    gap: 5px;
    margin: 0;
    padding: 0 8px 8px 24px;
    list-style: none;
}

.queue-track-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.04);
    color: #2d3748;
    font-size: 13px;
}

.queue-track-list .track-icon {
    flex: 0 0 22px;
}

.queue-track-info {
    min-width: 0;
    overflow-wrap: anywhere;
}

.queue-track-empty {
    margin: 0;
    padding: 0 10px 10px 24px;
    color: #718096;
    font-size: 13px;
}

.queue-empty {
    padding: 8px 0;
    color: #718096;
    font-size: 14px;
}

#watched-channel-list {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.watched-channel-check {
    padding-bottom: 6px;
}

.watched-channel-error {
    margin: 0 10px 8px 24px;
    overflow-wrap: anywhere;
    font-size: 13px;
}

.watched-channel-edit {
    padding: 6px 10px;
    font-size: 13px;
}

.watched-channel-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 10px 10px 24px;
}

.watched-channel-paused .watched-channel-summary-status {
    color: #718096;
}

.watched-channel-check-now {
    padding: 6px 10px;
    font-size: 13px;
}

.watched-channel-active-toggle {
    padding: 6px 10px;
    font-size: 13px;
}

.watcher-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.watcher-help {
    margin: 0 0 16px;
    color: #718096;
    font-size: 13px;
}

.watcher-filter-section {
    display: grid;
    gap: 4px 12px;
    margin: 16px 0;
    padding: 12px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.025);
}

.watcher-filter-section legend {
    padding: 0 6px;
    color: #4a5568;
    font-weight: 600;
}

.watcher-label-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.watcher-label-row label {
    margin: 0;
}

.watcher-tooltip {
    position: relative;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    border: 1px solid #718096;
    border-radius: 50%;
    background: transparent;
    color: #4a5568;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.watcher-tooltip::after {
    position: absolute;
    z-index: 20;
    top: calc(100% + 6px);
    left: 0;
    display: none;
    width: max-content;
    max-width: min(280px, calc(100vw - 48px));
    padding: 8px 10px;
    border-radius: 5px;
    background: #1a202c;
    color: #fff;
    content: attr(data-tooltip);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    text-align: left;
    white-space: normal;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}

.watcher-tooltip:hover::after,
.watcher-tooltip:focus-visible::after {
    display: block;
}

.watcher-tooltip:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.watcher-date-range {
    gap: 8px;
}

.watcher-content-flags {
    align-items: center;
    gap: 18px;
}

.watcher-checkbox-field {
    display: flex;
    align-items: center;
    gap: 6px;
}

.watcher-checkbox-field .checkbox-label {
    margin: 0;
}

body.dark-mode .watcher-filter-section {
    border-color: #4a5568;
    background: rgba(0, 0, 0, 0.14);
}

body.dark-mode .watcher-filter-section legend {
    color: #e2e8f0;
}

body.dark-mode .watcher-tooltip {
    border-color: #a0aec0;
    color: #e2e8f0;
}

.watcher-form-actions .download-btn {
    margin: 0;
}

.clear-queue-btn {
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    background: #fff;
    color: #2d3748;
    cursor: pointer;
}

.clear-queue-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.queue-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.queue-actions .clear-queue-btn {
    flex: 1 1 120px;
}


/* Responsivo */
@media (max-width: 768px) {
    .container {
        padding: 8px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    header h1 {
        font-size: 1.8em;
    }
    
    .form-section,
    .status-section,
    .queue-section,
    .log-section {
        padding: 12px;
    }

    .dashboard {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .notification-preference-options {
        grid-template-columns: 1fr;
    }

    .notification-container {
        right: 12px;
        bottom: 12px;
        width: calc(100vw - 24px);
    }

    .right-column {
        grid-template-rows: auto auto;
        gap: 8px;
    }
}

/* Styles for track status icons */
.track-icon {
    display: inline-block;
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.track-state-waiting {
    opacity: 0.6;
}

.track-state-downloading {
    background-color: rgba(255, 193, 7, 0.2);
    animation: pulse 1.5s ease-in-out infinite alternate;
}

.track-state-completed {
    background-color: rgba(40, 167, 69, 0.2);
}

.track-state-error {
    background-color: rgba(220, 53, 69, 0.2);
}

@keyframes pulse {
    from {
        background-color: rgba(255, 193, 7, 0.1);
    }
    to {
        background-color: rgba(255, 193, 7, 0.3);
    }
}

.track-info {
    vertical-align: middle;
}

/* Footer Styles */
.main-footer {
    margin-top: auto;
    padding: 20px 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    border-top: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
}

.footer-content {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    color: white;
}

.footer-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.app-version {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
}

.version-label {
    font-weight: 600;
    color: #fff;
}

.version-number {
    background: rgba(255,255,255,0.2);
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    color: #fff;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.footer-links a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.footer-links a:hover {
    background: rgba(255,255,255,0.2);
    color: white;
    transform: translateY(-1px);
}

.separator {
    color: rgba(255,255,255,0.6);
    font-size: 12px;
}

.footer-badge {
    display: flex;
    align-items: center;
}

.open-source-badge {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

/* Responsive footer */
@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .footer-info {
        align-items: center;
    }
    
    .footer-links {
        justify-content: center;
    }
}

    .theme-toggle-container {
        width: 100%;
        max-width: 100%;
        margin: 0 0 12px;
        padding: 0 8px;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: flex-start;
        text-align: left;
    }

    .theme-toggle-btn {
        min-height: 44px;
        padding: 9px 14px;
        border: 1px solid rgba(255, 255, 255, 0.55);
        border-radius: 6px;
        background: rgba(0, 0, 0, 0.18);
        color: #fff;
        font-size: 14px;
        cursor: pointer;
        transition: background-color 0.2s ease;
    }

    .theme-toggle-btn:hover {
        background: rgba(0, 0, 0, 0.3);
    }

    .theme-toggle-btn[aria-pressed="true"] {
        background: rgba(0, 0, 0, 0.32);
    }

    body.dark-mode {
        --action-button-gradient: linear-gradient(135deg, #374983 0%, #37345f 100%);
        --action-button-shadow: 0 5px 15px rgba(55, 73, 131, 0.4);
        color-scheme: dark;
        background: linear-gradient(180deg, #1b222c 0%, #0c1016 100%);
        color: #b8c0cc;
    }

    body.dark-mode header {
        color: #c5ccd6;
    }

    body.dark-mode .form-section,
    body.dark-mode .status-section,
    body.dark-mode .queue-section,
    body.dark-mode .log-section {
        background: #1b222c;
        color: #b8c0cc;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
    }

    body.dark-mode .form-section h2,
    body.dark-mode .status-section h2,
    body.dark-mode .queue-section h2,
    body.dark-mode .log-section h2,
    body.dark-mode label {
        color: #b8c0cc;
    }

    body.dark-mode input[type="url"],
    body.dark-mode input[type="text"],
    body.dark-mode input[type="password"],
    body.dark-mode input[type="number"],
    body.dark-mode input[type="time"],
    body.dark-mode select {
        background: #1b222c;
        border-color: #465263;
        color: #c5ccd6;
    }

    body.dark-mode input::placeholder {
        color: #9ca3af;
    }

    body.dark-mode input[type="url"]:focus,
    body.dark-mode input[type="text"]:focus,
    body.dark-mode input[type="password"]:focus,
    body.dark-mode input[type="number"]:focus,
    body.dark-mode input[type="time"]:focus,
    body.dark-mode select:focus {
        border-color: #9aa8ff;
    }

    body.dark-mode .output-dir-button {
        border-color: #4b5868;
        background: #2b3541;
        color: #b8c0cc;
    }

    body.dark-mode .output-dir-button:hover,
    body.dark-mode .output-dir-button.selected {
        border-color: #9aa8ff;
        background: #374252;
    }

    body.dark-mode .media-root-trigger,
    body.dark-mode .media-root-trigger:hover {
        background: var(--action-button-gradient);
    }

    body.dark-mode .url-clear-btn {
        border-color: #4b5868;
        background: #2b3541;
        color: #b8c0cc;
    }

    body.dark-mode .url-clear-btn:hover {
        background: #374252;
    }

    body.dark-mode .tabs,
    body.dark-mode .tab-panel {
        border-color: #465263;
    }

    body.dark-mode .tab-panel {
        background: #1b222c;
    }

    body.dark-mode .tab-button {
        color: #b8c0cc;
    }

    body.dark-mode .tab-button:hover {
        background: #2b3541;
    }

    body.dark-mode .tab-button.active {
        background: #1b222c;
        border-color: #465263;
        border-bottom-color: #1b222c;
    }

    body.dark-mode #status-message,
    body.dark-mode #progress-text,
    body.dark-mode #log-content {
        color: #b8c0cc;
    }

    body.dark-mode #progress-bar {
        background: #3b4654;
    }

    body.dark-mode #log-container {
        background: #1b222c;
        border-color: #3b4654;
    }

    body.dark-mode .log-entry.success {
        background: #183126;
        color: #86efac;
    }

    body.dark-mode .log-entry.error {
        background: #3a2227;
        color: #fca5a5;
    }

    body.dark-mode .log-entry.warning {
        background: #3a321c;
        color: #fcd34d;
    }

    body.dark-mode .log-entry.info {
        background: #1e3448;
        color: #93c5fd;
    }

    body.dark-mode .main-footer {
        background: rgba(15, 19, 25, 0.48);
        border-top-color: rgba(255, 255, 255, 0.12);
    }

    body.dark-mode .footer-content,
    body.dark-mode .version-label,
    body.dark-mode .footer-links a {
        color: #b8c0cc;
    }

    body.dark-mode .footer-links a:hover {
        color: #c5ccd6;
    }

    body.dark-mode .download-queue-section {
        border-bottom-color: #3b4654;
    }

    body.dark-mode .download-queue-section h3,
    body.dark-mode .queue-item,
    body.dark-mode .clear-queue-btn {
        background: #1b222c;
        color: #b8c0cc;
    }

    body.dark-mode #watched-channel-list .queue-item {
        background: #181e27;
    }

    body.dark-mode .download-queue-section h3 {
        background: transparent;
    }

    body.dark-mode .queue-item-status,
    body.dark-mode .queue-empty {
        color: #aeb8c5;
    }

    body.dark-mode .queue-track-list li {
        background: rgba(255, 255, 255, 0.07);
        color: #b8c0cc;
    }

    body.dark-mode .queue-track-empty {
        color: #aeb8c5;
    }

    body.dark-mode .clear-queue-btn {
        border-color: #4b5868;
    }

    body.dark-mode .version-number {
        background: rgba(255, 255, 255, 0.12);
        color: #c5ccd6;
    }

    body.dark-mode .separator {
        color: #9ca3af;
    }

    body.dark-mode .theme-toggle-btn {
        border-color: #536173;
        background: #2b3541;
        color: #c5ccd6;
    }

    body.dark-mode .theme-toggle-btn:hover {
        background: #374252;
    }

    body.dark-mode .theme-toggle-btn[aria-pressed="true"] {
        border-color: #9aa8ff;
        background: #374252;
    }
