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

body {
    font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, "Apple Color Emoji", Arial, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol";
    background: #191919;
    color: #e0e0e0;
    padding: 0;
    margin: 0;
    transition: background-color 0.3s, color 0.3s;
    min-height: 100vh;
}

body.light-mode {
    background: #ffffff;
    color: #37352f;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

.sticky-top {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #191919;
    padding: 20px;
    border-bottom: 1px solid #2a2a2a;
}

body.light-mode .sticky-top {
    background: #ffffff;
    border-bottom-color: #e3e2df;
}

.scrollable-content {
    padding: 20px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

h1 {
    font-size: 24px;
    color: #ffffff;
}

body.light-mode h1 {
    color: #37352f;
}

.settings-container {
    position: relative;
}

.settings-button {
    padding: 8px 16px;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.settings-button:hover {
    background: #333;
}

body.light-mode .settings-button {
    background: #f7f6f3;
    border-color: #e3e2df;
    color: #37352f;
}

body.light-mode .settings-button:hover {
    background: #efeeeb;
}

.settings-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    min-width: 240px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow: hidden;
}

.settings-menu.hidden {
    display: none;
}

body.light-mode .settings-menu {
    background: #ffffff;
    border-color: #e3e2df;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.settings-menu-item {
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: #e0e0e0;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
    user-select: none;
}

.settings-menu-item:hover {
    background: #333;
}

body.light-mode .settings-menu-item {
    color: #37352f;
}

body.light-mode .settings-menu-item:hover {
    background: #f7f6f3;
}

.settings-menu-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #4a9eff;
}

.settings-menu-item:hover span {
    color: #4a9eff;
}

body.light-mode .settings-menu-item:hover span {
    color: #2383e2;
}

.settings-branch-name {
    padding: 8px 16px;
    text-align: right;
    font-size: 10px;
    color: #666666;
    font-family: ui-monospace, SFMono-Regular, 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
    border-top: 1px solid #3a3a3a;
    margin-top: 4px;
}

body.light-mode .settings-branch-name {
    color: #999999;
    border-top-color: #e3e2df;
}

.scroll-to-top {
    position: fixed;
    top: 180px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    background: #2a2a2a;
    border: 2px solid #4a9eff;
    border-radius: 8px;
    color: #4a9eff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 200;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.scroll-to-top:hover {
    background: #333;
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6);
}

.scroll-to-top.hidden {
    display: none;
}

body.light-mode .scroll-to-top {
    background: #ffffff;
    border-color: #2383e2;
    color: #2383e2;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

body.light-mode .scroll-to-top:hover {
    background: #f7f6f3;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.filters-section {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    border: 1px solid #2a2a2a;
    display: flex;
    gap: 30px;
    transition: background-color 0.3s, border-color 0.3s;
}

body.light-mode .filters-section {
    background: #ffffff;
    border-color: #e3e2df;
}

.filter-group {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.filter-group.double-width {
    flex: 2;
}

.filter-label {
    font-size: 14px;
    font-weight: 600;
    color: #888;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

body.light-mode .filter-label {
    color: #9b9a97;
}

.filter-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-buttons.two-columns {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.filter-btn {
    padding: 0;
    border-radius: 6px;
    border: 3px solid transparent;
    margin: 3px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0;
    height: 29px;
    overflow: hidden;
}

.filter-btn:hover {
    transform: translateY(-1px);
}

.filter-btn.active {
    border-color: #4ade80;
}

.filter-btn.exclude {
    border-color: #ef4444;
}

.filter-btn-symbol {
    width: 29px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    border-radius: 3px;
    transition: all 0.2s;
    flex-shrink: 0;
    cursor: pointer;
    user-select: none;
    line-height: 1;
    background: transparent;
    position: relative;
    z-index: 1;
}

.filter-btn-symbol:hover {
    background: rgba(0, 0, 0, 0.15);
}

body.light-mode .filter-btn-symbol:hover {
    background: rgba(0, 0, 0, 0.08);
}

.filter-btn-symbol.active {
    background: #4ade80;
    color: #ffffff;
}

.filter-btn-symbol.exclude {
    background: #ef4444;
    color: #ffffff;
}

.filter-btn-text {
    flex: 1;
    text-align: center;
    cursor: pointer;
    padding: 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    overflow: visible;
    min-width: 0;
    position: relative;
    z-index: 0;
}

/* Notion-inspired colors */
.intensity-slightly { background: #E8D67A; color: #5C4A1A; }
.intensity-quite { background: #DFC896; color: #533D1F; }
.mood-warm { background: #DFC896; color: #533D1F; }
.mood-relief { background: #DFC896; color: #533D1F; }
.mood-hopeful { background: #DFC896; color: #533D1F; }
.inst-orchestral { background: #DFC896; color: #533D1F; }
.inst-beats { background: #DFC896; color: #533D1F; }
.inst-drums { background: #DFC896; color: #533D1F; }
.inst-abstract { background: #DFC896; color: #533D1F; }
.pace-medium { background: #DFC896; color: #533D1F; }

.mood-intrigue { background: #F5C896; color: #6B4423; }
.mood-mysterious { background: #F5C896; color: #6B4423; }
.mood-suspenseful { background: #F5C896; color: #6B4423; }

.mood-tense { background: #D4BCA4; color: #5A4A3A; }

.intensity-very { background: #EDBDD0; color: #5A2E3A; }
.mood-bittersweet { background: #EDBDD0; color: #5A2E3A; }
.mood-dramatic { background: #EDBDD0; color: #5A2E3A; }
.mood-bombshell { background: #EDBDD0; color: #5A2E3A; }
.inst-vocal { background: #EDBDD0; color: #5A2E3A; }
.inst-minimal { background: #EDBDD0; color: #5A2E3A; }
.inst-zips { background: #EDBDD0; color: #5A2E3A; }
.pace-high { background: #EDBDD0; color: #5A2E3A; }

.mood-sad { background: #B8D9EC; color: #244A62; }
.mood-guilty { background: #B8D9EC; color: #244A62; }
.inst-synthetic { background: #B8D9EC; color: #244A62; }
.pace-low { background: #B8D9EC; color: #244A62; }

.mood-humorous { background: #C9BDDF; color: #3E2A56; }
.inst-epiano { background: #C9BDDF; color: #3E2A56; }
.inst-piano { background: #C9BDDF; color: #3E2A56; }
.inst-mallets { background: #C9BDDF; color: #3E2A56; }

.mood-heroic { background: #B0D9BF; color: #1F4530; }
.mood-revelation { background: #B0D9BF; color: #1F4530; }
.inst-acoustic { background: #B0D9BF; color: #1F4530; }
.inst-clean { background: #B0D9BF; color: #1F4530; }
.inst-dirty { background: #B0D9BF; color: #1F4530; }
.inst-amb { background: #B0D9BF; color: #1F4530; }

.mood-multiple { background: #D3D1CC; color: #37352F; }
.mood-neutral { background: #D3D1CC; color: #37352F; }
.mood-ominous { background: #D3D1CC; color: #37352F; }
.inst-organic { background: #D3D1CC; color: #37352F; }
.inst-ordinary { background: #D3D1CC; color: #37352F; }
.pace-free { background: #D3D1CC; color: #37352F; }

.active-filters {
    background: #151515;
    border-radius: 8px;
    padding: 10px 15px;
    border: 1px solid #2a2a2a;
    transition: background-color 0.3s, border-color 0.3s;
    flex: 1;
    text-align: right;
}

body.light-mode .active-filters {
    background: #f7f6f3;
    border-color: #e3e2df;
}

.active-filters-title {
    font-size: 11px;
    color: #666;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

body.light-mode .active-filters-title {
    color: #9b9a97;
}

.active-filters-list {
    color: #4a9eff;
    font-size: 13px;
}

body.light-mode .active-filters-list {
    color: #2383e2;
}

.clear-all-btn {
    padding: 10px 20px;
    background: #252525;
    border: 1px solid #333;
    border-radius: 8px;
    color: #888;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    flex: 0 0 auto;
    height: fit-content;
}

.clear-all-btn:hover {
    background: #2a2a2a;
    border-color: #444;
    color: #aaa;
}

body.light-mode .clear-all-btn {
    background: #f7f6f3;
    border-color: #e3e2df;
    color: #787774;
}

body.light-mode .clear-all-btn:hover {
    background: #efeeeb;
    border-color: #d3d1cc;
    color: #37352f;
}

.progress-dropdown {
    padding: 10px 15px;
    background: #151515;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 14px;
    transition: all 0.2s;
    flex: 1;
    cursor: pointer;
    font-variant-numeric: tabular-nums;
    appearance: none;
    -webkit-appearance: none;
    -moz-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='%23666' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 35px;
}

.progress-dropdown:focus {
    outline: none;
    border-color: #4a9eff;
    background-color: #1a1a1a;
}

body.light-mode .progress-dropdown {
    background: #ffffff;
    border-color: #e3e2df;
    color: #37352f;
    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='%239b9a97' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
}

body.light-mode .progress-dropdown:focus {
    border-color: #2383e2;
    background-color: #f7f6f3;
}

.progress-dropdown option {
    background: #1a1a1a;
    color: #e0e0e0;
}

body.light-mode .progress-dropdown option {
    background: #ffffff;
    color: #37352f;
}

.cue-search-box {
    padding: 10px 15px;
    background: #151515;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 14px;
    transition: all 0.2s;
    flex: 1;
    font-variant-numeric: tabular-nums;
}

.cue-search-box:focus {
    outline: none;
    border-color: #4a9eff;
    background: #1a1a1a;
}

.cue-search-box::placeholder {
    color: #666;
}

body.light-mode .cue-search-box {
    background: #ffffff;
    border-color: #e3e2df;
    color: #37352f;
}

body.light-mode .cue-search-box:focus {
    border-color: #2383e2;
    background: #f7f6f3;
}

body.light-mode .cue-search-box::placeholder {
    color: #9b9a97;
}

.results-count {
    background: #151515;
    border-radius: 8px;
    padding: 10px 15px;
    border: 1px solid #2a2a2a;
    transition: background-color 0.3s, border-color 0.3s;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

body.light-mode .results-count {
    background: #f7f6f3;
    border-color: #e3e2df;
    color: #9b9a97;
}

.results-count-title {
    font-size: 11px;
    color: #666;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

body.light-mode .results-count-title {
    color: #9b9a97;
}

.results-count-text {
    font-size: 13px;
    color: #888;
    white-space: nowrap;
}

body.light-mode .results-count-text {
    color: #787774;
}

.results-count-text strong {
    color: #4a9eff;
}

body.light-mode .results-count-text strong {
    color: #2383e2;
}

.bottom-row {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-top: 15px;
}

.track {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    border: 2px solid #2a2a2a;
    transition: all 0.2s;
    cursor: pointer;
}

.track.hidden-no-audio {
    display: none;
}

body.light-mode .track {
    background: #ffffff;
    border-color: #e3e2df;
}

.track:hover {
    border-color: #3a3a3a;
}

body.light-mode .track:hover {
    border-color: #d3d1cc;
}

.track.active {
    border-color: #4a9eff;
    background: #1a1f2a;
    box-shadow: 0 0 20px rgba(74, 158, 255, 0.2);
}

body.light-mode .track.active {
    background: #f0f7ff;
    box-shadow: 0 0 20px rgba(35, 131, 226, 0.15);
}

.track-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.track-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.track-title {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
}

body.light-mode .track-title {
    color: #37352f;
}

.track-episode {
    font-size: 14px;
    color: #888;
}

body.light-mode .track-episode {
    color: #9b9a97;
}

.track-description-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    gap: 20px;
}

.track-description {
    font-size: 14px;
    color: #888;
    flex: 0 1 auto;
}

body.light-mode .track-description {
    color: #9b9a97;
}

.track-duration {
    color: #888;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

body.light-mode .track-duration {
    color: #9b9a97;
}

.metadata {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

body.hide-tags .metadata {
    display: none;
}

.metadata-item {
    padding: 3px 7px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.waveform-container {
    margin-bottom: 0;
    background: #151515;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    position: relative;
    height: 125px;
    user-select: none;
    transition: height 0.2s, padding 0.2s;
}

body.hide-waveforms .waveform-container {
    height: 0;
    padding: 0;
    overflow: hidden;
    margin-bottom: 0;
}

body.hide-waveforms .track.active .waveform-container {
    height: 125px;
    padding: 10px;
    margin-bottom: 0;
}

body.light-mode .waveform-container {
    background: #f7f6f3;
}

.waveform-container:hover {
    background: #1a1a1a;
}

body.light-mode .waveform-container:hover {
    background: #efeeeb;
}

canvas {
    width: 100%;
    height: 105px;
    border-radius: 4px;
}

.progress-line {
    position: absolute;
    top: 10px;
    bottom: 10px;
    width: 2px;
    background: #ffffff;
    pointer-events: none;
    z-index: 10;
}

body.light-mode .progress-line {
    background: #37352f;
}

.loading-indicator {
    text-align: center;
    padding: 30px;
    color: #666;
    font-size: 14px;
}

body.light-mode .loading-indicator {
    color: #9b9a97;
}

.loading-indicator.hidden {
    display: none;
}

.audio-missing {
    background: #2a1a1a;
    border: 2px dashed #664444;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    color: #cc6666;
    font-size: 14px;
}

body.light-mode .audio-missing {
    background: #fff5f5;
    border-color: #ffcccc;
    color: #cc0000;
}

.last-used {
    margin-top: 15px;
    font-size: 13px;
    color: #888;
}

body.light-mode .last-used {
    color: #9b9a97;
}

.last-used a {
    color: #4a9eff;
    text-decoration: underline;
}

.last-used a:hover {
    color: #6ab9ff;
}

body.light-mode .last-used a {
    color: #2383e2;
}

body.light-mode .last-used a:hover {
    color: #1a6ec0;
}

.last-used a.proximity-warning {
    color: #ef4444;
}

.last-used a.proximity-warning:hover {
    color: #dc2626;
}

body.light-mode .last-used a.proximity-warning {
    color: #dc2626;
}

body.light-mode .last-used a.proximity-warning:hover {
    color: #b91c1c;
}
