:root {
    --bg-primary: #121212;
    --bg-secondary: #1e1e1e;
    --bg-tertiary: #2c2c2c;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --accent-color: #bb86fc;
    --accent-hover: #9b65de;
    --danger-color: #cf6679;
    --success-color: #03dac6;
    --border-color: #333;
}

/* Icon System */
.icon {
    width: 1.25em;
    height: 1.25em;
    fill: currentColor;
    vertical-align: middle;
    display: inline-block;
    color: var(--text-secondary);
    /* Default visible color */
}

/* Accent Icons */
.logo-icon,
#midi-selector .device-icon {
    color: var(--accent-color);
}

.device-icon.error {
    color: var(--danger-color) !important;
}

.device-selector.error-pulse {
    animation: pulse-red 2s infinite;
    border: 1px solid var(--danger-color);
}

@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(207, 102, 121, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(207, 102, 121, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(207, 102, 121, 0);
    }
}

.icon.small {
    width: 1em;
    height: 1em;
}

.icon.large {
    width: 1.5em;
    height: 1.5em;
}

/* Session Player */
#session-player-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

#review-player-container.hidden {
    display: none !important;
}

.visualization-container {
    flex-grow: 1;
    background-color: #000;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    min-height: 200px;
    display: flex;
    flex-direction: column;
}

canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.timeline-controls {
    height: 80px;
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 15px;
    margin-top: 10px;
    /* Spacing from visualizer */
    border-radius: 8px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Top Bar */
.top-bar {
    height: 60px;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 20px;
    justify-content: space-between;
    z-index: 100;
    flex-shrink: 0;
}

.left-section {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-direction: row;
    /* Explicitly set row to be sure */
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent-color);
}

.logo-icon {
    font-size: 1.4rem;
}

.logo-text {
    letter-spacing: -0.5px;
}

.separator {
    width: 1px;
    height: 24px;
    background-color: var(--border-color);
}

.top-nav {
    display: flex;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 5px;
    background: transparent;
    padding: 0;
}

.nav-links li {
    padding: 6px 12px;
    cursor: pointer;
    border-radius: 6px;
    transition: background-color 0.2s;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.nav-links li:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.05);
}

.nav-links li.active {
    background-color: transparent;
    color: var(--accent-color);
    font-weight: 600;
}

/* Controls Header Area */
.view-header .controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.session-timer {
    font-family: monospace;
    font-size: 1.1rem;
    color: var(--danger-color);
    /* Simplified style for inline look */
    background: transparent;
    padding: 0;
    border: none;
    font-weight: 600;
}

.session-timer.hidden {
    display: none;
}

.devices-container {
    display: flex;
    gap: 15px;
}

/* ... Device Selectors ... */
.device-selector {
    position: relative;
    background: var(--bg-tertiary);
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    user-select: none;
    min-width: 150px;
    transition: background 0.2s;
}

.device-selector:hover {
    background: #383838;
}

.device-icon {
    font-size: 1.2em;
}

.device-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

/* ... Settings Panel (unchanged) ... */
.settings-panel {
    position: absolute;
    top: 70px;
    right: 20px;
    width: 320px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    z-index: 200;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.settings-panel.active {
    display: flex;
    animation: fadeIn 0.15s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
}

.panel-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
}

.close-btn:hover {
    color: var(--text-primary);
}

.panel-content {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 70vh;
    overflow-y: auto;
}

.section-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.device-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.device-option {
    padding: 10px;
    background: var(--bg-secondary);
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.device-option:hover {
    background: #383838;
}

.device-option.selected {
    border: 1px solid var(--accent-color);
    background: rgba(187, 134, 252, 0.05);
}

.device-option.active {
    font-weight: 500;
    color: var(--text-primary);
}

.device-option.history {
    opacity: 0.6;
}

.device-name {
    font-size: 0.95rem;
}

.device-status {
    font-size: 0.8rem;
    color: var(--success-color);
}

.device-status.disconnected {
    color: var(--text-secondary);
}

/* Main Layout */
.main-container {
    display: flex;
    flex-direction: column;
    /* Changed from default row since no sidebar */
    flex-grow: 1;
    overflow: hidden;
}

/* Sidebar Removed */

.content {
    flex-grow: 1;
    padding: 30px;
    overflow-y: auto;
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
}

#main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.view {
    display: none;
    height: 100%;
    flex-direction: column;
    flex-grow: 1;
}

.view.active {
    display: flex;
}

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.relative-header {
    position: relative;
    justify-content: center;
    /* Center content by default */
    z-index: 50;
    /* Ensure dropdowns appear above visualizer */
}

.header-left {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}

.header-center {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.abs-right {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s;
}

.btn.primary {
    background-color: var(--accent-color);
    color: #000;
}

.btn.primary[disabled] {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: not-allowed;
    opacity: 0.7;
}

.btn.primary:not([disabled]):hover {
    background-color: var(--accent-hover);
}

.btn.secondary {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn.secondary:hover {
    background-color: #383838;
}

.btn.recording {
    background-color: var(--danger-color);
    color: #000;
    animation: pulse 2s infinite;
}

.btn.danger {
    background-color: var(--danger-color);
    color: #000;
    margin-right: auto;
    /* Push to left */
}

.btn.danger:hover {
    opacity: 0.9;
}

.btn.small {
    padding: 6px 12px;
    font-size: 0.9em;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.8;
    }

    100% {
        opacity: 1;
    }
}

.visualization-container {
    background-color: var(--bg-secondary);
    border-radius: 10px;
    flex-grow: 1;
    position: relative;
    overflow: hidden;
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

#practice-visualizer,
#review-visualizer {
    width: 100%;
    height: 100%;
}

.practice-bubble {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    padding: 8px 16px;
    border-radius: 20px;
    color: var(--text-primary);
    font-size: 1rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 10;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.practice-bubble.visible {
    opacity: 1;
}

.practice-bubble .label {
    font-weight: 600;
    color: var(--accent-color);
}


.login-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    backdrop-filter: blur(5px);
}

.login-overlay.hidden {
    display: none;
}

.overlay-content {
    text-align: center;
    background: var(--bg-tertiary);
    padding: 30px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.overlay-content h2 {
    margin-bottom: 10px;
    color: var(--accent-color);
}

.overlay-content p {
    margin-bottom: 20px;
    color: var(--text-secondary);
}

/* Timeline Controls */
.timeline-controls {
    background-color: var(--bg-tertiary);
    padding: 15px;
    border-radius: 0 0 10px 10px;
    /* Match visualization container bottom rounded */
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: -5px;
    /* Merge with visualizer visually */
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 1.2rem;
    background: var(--accent-color);
    color: #000;
}

.action-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    /* color: #b0b0b0; */
    /* Handled by SVG stroke/fill now */
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-btn:hover {
    /* color: var(--text-primary); */
    /* Icon color is hardcoded in SVG */
    opacity: 0.8;
}

.icon-btn:not(.playing) {
    padding-left: 3px;
    /* Center the play triangle */
}

.icon-btn.playing {
    padding-right: 1px;
    /* Center the pause bars */
}

.icon-btn:hover {
    background: var(--accent-hover);
}

#current-time,
#total-duration {
    font-variant-numeric: tabular-nums;
    min-width: 50px;
    text-align: center;
    font-family: 'Inter', monospace;
    font-size: 0.9rem;
}

#timeline-scrub {
    flex-grow: 1;
    height: 6px;
    background: var(--bg-primary);
    border-radius: 3px;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

#timeline-scrub::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    transition: background .15s ease-in-out;
}

#timeline-scrub::-webkit-slider-thumb:hover {
    background: #fff;
}

#review-list-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#review-player-container.hidden {
    display: none;
}

.hidden {
    display: none !important;
}

.session-item {
    background: var(--bg-secondary);
    padding: 15px 15px 10px 15px;
    /* Reduced bottom padding */
    border-radius: 8px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    display: flex;
    flex-direction: column;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.session-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    /* Changed from baseline to allow multiline */
    width: 100%;
}

.session-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.session-name {
    font-weight: 500;
    color: var(--text-primary);
}

.session-id {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.3);
    font-family: monospace;
    margin-left: auto;
    /* Push to right */
    align-self: flex-start;
    /* Align with top of text */
    white-space: nowrap;
    margin-top: 4px;
    /* Align with 2nd line text baseline */
}

.session-actions {
    display: flex;
    /* Reverted to simple row since ID is moved */
    gap: 8px;
    z-index: 10;
}

.action-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
    opacity: 0.6;
    transition: opacity 0.2s, color 0.2s;
    position: relative;
    z-index: 10;
}

.action-btn:hover {
    opacity: 1;
    color: var(--danger-color);
    /* Trash turns red */
}

.action-btn.confirming {
    color: var(--danger-color);
    opacity: 1;
    font-weight: bold;
    font-size: 0.8rem;
    width: auto;
    background: rgba(207, 102, 121, 0.1);
    /* Subtle background */
    border-radius: 4px;
}

.session-segments-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    /* Gap between toggle and text */
    width: 100%;
}

/* Modal Dialog */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.modal-dialog {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    min-width: 320px;
    max-width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: slideUp 0.2s ease-out;
}

.modal-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-body {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 8px;
}

.modal-actions .btn {
    min-width: 80px;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Move toggle to left, make subtle */
.seg-expand-container {
    width: 24px;
    /* Fixed width for alignment */
    display: flex;
    justify-content: center;
    flex-shrink: 0;
}

.seg-expand-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    line-height: 1;
    transition: all 0.2s;
    opacity: 0.7;
    margin-top: -1px;
}

.seg-expand-btn:hover {
    background: transparent;
    opacity: 1;
    transform: scale(1.1);
}

.seg-expand-btn.expanded {
    transform: rotate(90deg);
    background: transparent;
    opacity: 1;
    /* color: #000; Remove this as it doesn't affect IMG */
}

/* Full view item layout */
.seg-item-block {
    display: flex;
    gap: 12px;
    padding: 2px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.seg-start-time {
    font-family: monospace;
    font-size: 0.8rem;
    color: #666;
    /* Subtle */
    /* Subtle */
    min-width: 45px;
    /* Alignment */
}

/* Interactive segments (Short View) */
.seg-short-item {
    cursor: pointer;
    border-radius: 4px;
    padding: 0 4px;
    transition: background 0.2s, color 0.2s;
}

.seg-short-item.unknown {
    opacity: 0.7;
    font-style: italic;
    color: var(--text-secondary);
}

.seg-item-block.unknown {
    opacity: 0.7;
}

.seg-item-block.unknown .seg-label {
    font-style: italic;
}

.seg-short-item:hover {
    background: rgba(187, 134, 252, 0.1);
    color: var(--accent-color);
}


/* Interactive segments (Full View) */
.seg-item-block {
    display: flex;
    gap: 12px;
    padding: 4px 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
}

.seg-item-block:hover {
    background: rgba(187, 134, 252, 0.1);
}

.seg-item-block:hover .seg-label {
    color: var(--accent-color);
}

.request-play-btn {
    /* If we kept the play button, but we removed it. Ensuring cleanup. */
    display: none;
}

.session-item:hover {
    background: var(--bg-tertiary);
    transform: translateX(4px);
}

.session-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.session-name {
    font-weight: 500;
    color: var(--text-primary);
}

.session-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding-top: 3px;
    /* Align text cap-height with chevron center */
}

/* Segment Editor Dialog */
.floating-dialog {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(30, 30, 30, 0.95);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    z-index: 50;
    /* Above visualizer canvas */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    min-width: 250px;
    backdrop-filter: blur(5px);
}

.floating-dialog h3 {
    margin-bottom: 12px;
    font-size: 1rem;
    color: var(--accent-color);
}

.dialog-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.dialog-row .val {
    font-family: monospace;
    color: var(--text-primary);
}

.dialog-input {
    width: 100%;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px;
    border-radius: 4px;
    margin-bottom: 12px;
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn.small {
    padding: 6px 12px;
    font-size: 0.85rem;
}

/* Context Menu */
.context-menu {
    position: fixed;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    min-width: 150px;
    overflow: hidden;
}

.menu-item {
    padding: 10px 15px;
    cursor: pointer;
    transition: background 0.1s;
    font-size: 0.9rem;
}

.menu-item:hover {
    background: var(--accent-color);
    color: #000;
}

/* Timeline Markers */
.timeline-wrapper {
    position: relative;
    flex-grow: 1;
    display: flex;
    align-items: center;
    height: 20px;
    margin: 0 10px;
}

.timeline-markers {
    position: absolute;
    top: 6px;
    bottom: 6px;
    left: 0;
    right: 0;
    z-index: 0;
    pointer-events: none;
    border-radius: 4px;
    overflow: hidden;
}

.timeline-marker {
    position: absolute;
    top: 0;
    bottom: 0;
    background-color: rgba(3, 218, 198, 0.4);
    border: 1px solid rgba(3, 218, 198, 0.6);
}

#timeline-scrub {
    position: relative;
    width: 100%;
    margin: 0;
    z-index: 2;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
}

#timeline-scrub::-webkit-slider-runnable-track {
    background: rgba(255, 255, 255, 0.1);
    height: 8px;
    border-radius: 4px;
}

#timeline-scrub::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    margin-top: -6px;
    height: 20px;
    width: 20px;
    background: #bb86fc;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #121212;
}

/* Context Menu Info */
.menu-info {
    padding: 8px 16px;
    font-size: 0.8rem;
    color: #bbb;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    pointer-events: none;
    background: rgba(40, 40, 40, 0.95);
    font-family: monospace;
}

/* Dropdown Header */
/* Dropdown Header */
.dropdown-container {
    position: relative;
    display: inline-block;
}

/* Header Text (List Mode) */
#review-title-btn {
    margin: 0;
    font-size: 1.5rem;
    /* Standard H1 */
}

/* Header Text (Player Mode - with dropdown) */
#review-title-btn.dropdown-trigger {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 8px;

    /* Make it button-like */
    font-size: 1rem;
    font-weight: 500;
    background-color: var(--bg-secondary);
    padding: 8px 16px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

#review-title-btn.dropdown-trigger:hover {
    border-color: var(--text-secondary);
    background-color: var(--bg-tertiary);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 4px;
    /* Slight offset */
    min-width: 350px;
    background: #252525;
    /* Explicit contrast against black visualizer */
    border: 1px solid #444;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    /* Deep shadow */
    z-index: 1000;

    max-height: 400px;
    overflow-y: auto;
    padding: 4px;
    margin-top: 8px;
}

.dropdown-menu.hidden {
    display: none;
}

.dropdown-item {
    padding: 10px 12px;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background 0.1s;
}

.dropdown-item:hover {
    background: #333;
}

.dropdown-item .seg-start-time {
    font-family: monospace;
    color: var(--accent-color);
    font-size: 0.9em;
    width: 45px;
    /* Fixed width */
    text-align: right;
    flex-shrink: 0;
}

.dropdown-item .seg-label {
    flex-grow: 1;
    font-weight: 400;
    /* Normal weight */
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-item .seg-dur {
    font-size: 0.85em;
    color: var(--text-secondary);
    white-space: nowrap;
}

.dropdown-item.unknown {
    opacity: 0.7;
}

.dropdown-item.unknown .seg-label {
    font-style: italic;
}

/* Auth & Profile Styles */

/* Profile Widget */
.profile-widget {
    position: relative;
    margin-left: 10px;
}

.profile-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--accent-color);
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
    cursor: pointer;
    user-select: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.profile-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 0 8px rgba(187, 134, 252, 0.4);
}

.profile-dropdown {
    position: absolute;
    top: 50px;
    right: 0;
    width: 200px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    z-index: 300;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.profile-dropdown.hidden {
    display: none;
}

.profile-info {
    padding: 5px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 5px;
}

.profile-email {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}

.full-width {
    width: 100%;
}

/* Auth Modal Specifics */
.auth-dialog {
    width: 400px;
    max-width: 95%;
}

.auth-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.auth-tabs {
    display: flex;
    gap: 15px;
}

.auth-tab {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    padding-bottom: 5px;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.auth-tab.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

.auth-tab:hover {
    color: var(--text-primary);
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 10px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.auth-message {
    padding: 10px;
    border-radius: 4px;
    margin-top: 15px;
    font-size: 0.9rem;
    text-align: center;
}

.auth-message.error {
    background-color: rgba(207, 102, 121, 0.1);
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
}

.auth-message.success {
    background-color: rgba(3, 218, 198, 0.1);
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

/* Share Modal Options */
.share-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 20px 0;
    text-align: left;
}

.share-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.share-option:hover {
    background: var(--bg-hover);
}

.share-option input {
    margin-top: 5px;
}

.share-option label {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    flex: 1;
}

.option-title {
    font-weight: 600;
    color: var(--text-primary);
}

.option-desc {
    font-size: 0.9em;
    color: var(--text-secondary);
}

/* Music Page Styles */
.music-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
    padding-bottom: 40px;
}

.music-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.music-section .section-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.music-section h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent-color);
}

.music-list-container {
    background-color: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.music-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    table-layout: fixed;
    /* Keep layout consistent */
}

.music-table th,
.music-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    /* Prevent wrapping */
    overflow: hidden;
    /* Hide overflow */
    text-overflow: ellipsis;
    /* Ellipsis for long text */
}

.music-table th {
    background-color: rgba(255, 255, 255, 0.05);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

.music-table tr:last-child td {
    border-bottom: none;
}

.music-table tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Specific Column Widths */
.music-table th.col-active,
.music-table td.col-active {
    width: 60px;
    text-align: center;
    padding-left: 10px;
    padding-right: 10px;
}

.music-table th.col-title,
.music-table td.col-title {
    width: 25%;
    font-weight: 600;
    color: var(--text-primary);
}

.music-table th.col-composer,
.music-table td.col-composer {
    width: 15%;
    font-weight: 400;
    color: var(--text-secondary);
    font-size: 0.9em;
}

.music-table th.col-comments,
.music-table td.col-comments {
    width: auto;
    /* Takes remaining space if possible, or percentage */
    font-weight: 400;
    color: var(--text-secondary);
    font-size: 0.9em;
}

.music-table th.col-stats,
.music-table td.col-stats {
    width: 120px;
    font-weight: 400;
    color: var(--text-secondary);
    font-size: 0.9em;
}

/* Actions Column (Overflow Menu) */
.music-table th.col-actions,
.music-table td.col-actions {
    width: 50px;
    text-align: center;
}

.action-menu-container {
    display: flex;
    justify-content: center;
}

.menu-trigger {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 5px;
    line-height: 1;
}

.menu-trigger:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.sub-text {
    font-size: 0.85em;
    color: var(--text-disabled);
}

/* Toggle Switch Updates */
.toggle-switch.small {
    width: 34px;
    height: 18px;
}

.toggle-switch.small .slider:before {
    height: 12px;
    width: 12px;
    left: 2px;
    bottom: 2px;
}

.toggle-switch.small input:checked+.slider:before {
    transform: translateX(16px);
}

/* Legacy styles kept for reference or other uses */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-tertiary);
    transition: .4s;
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background-color: var(--text-secondary);
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

input:checked+.slider:before {
    transform: translateX(20px);
    background-color: #fff;
}

input:disabled+.slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.section-footer {
    padding-top: 5px;
}

/* Header & Dropdown Styles (Restored & Fixed) */
.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    /* Removed background-color to fix shade issue */
    /* border-bottom: 1px solid var(--border-color); */
    position: relative;
    /* Ensure absolute children are relative to this */
}

.relative-header {
    position: relative;
    z-index: 10;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 20;
    /* Ensure dropdown is above center */
}

.header-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    font-size: 1.1rem;
    /* Increased from 0.9em */
    font-weight: 500;
    color: var(--text-secondary);
    /* pointer-events: none; */
    /* Let clicks pass through if empty/overlapping */
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.abs-right {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.dropdown-container {
    position: relative;
    display: flex;
    align-items: center;
}

.dropdown-trigger {
    /* Match .btn.secondary style layout */
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;

    /* Text styling */
    font-size: 0.95rem;
    /* ~15px, similar to .btn */
    font-weight: 500;
    color: var(--text-primary);

    /* Box styling */
    background-color: var(--bg-tertiary);
    /* Match btn.secondary bg */
    border: none;
    border-radius: 5px;
    /* Match btn border-radius */
    padding: 8px 12px;
    /* Match btn padding */
    transition: background-color 0.2s;
}

.dropdown-trigger:hover {
    background-color: #383838;
    /* Match btn.secondary:hover */
    color: var(--text-primary);
    /* Keep text color stable */
}

/* Dropdown Menu styling */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 5px);
    /* Offset slightly */
    left: 0;
    min-width: 250px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    /* Stronger shadow */
    z-index: 100;
    max-height: 400px;
    overflow-y: auto;
    padding: 5px 0;
}

.dropdown-menu.hidden {
    display: none;
}

.dropdown-item {
    padding: 10px 15px;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.95rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.dropdown-item .time {
    font-size: 0.8em;
    color: var(--text-secondary);
}

/* Form Styles */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group textarea {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 10px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

.form-group input[type="file"] {
    background: var(--bg-primary);
    padding: 10px;
    border-radius: 4px;
    border: 1px dashed var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
}

.help-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    opacity: 0.7;
    margin-top: 4px;
}

/* Music Table Styles */
.music-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 0.95rem;
}

.music-table th {
    text-align: left;
    padding: 12px 10px;
    color: var(--text-secondary);
    font-weight: 500;
    border-bottom: 1px solid var(--border-color);
}

.music-table td {
    padding: 12px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    vertical-align: middle;
}

.music-row:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

/* Column Widths */
.col-active {
    width: 40px;
    text-align: center;
}

.col-title {
    width: 25%;
}

.col-composer {
    width: 15%;
}

.col-comments {
    width: 20%;
}

.col-stats {
    width: 10%;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.col-actions {
    width: 80px;
    text-align: right;
}

/* Icon Button Styles */
.icon-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    opacity: 0.7;
    transition: opacity 0.2s, transform 0.1s;
    padding: 4px;
}

.icon-action-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.music-row input[type="checkbox"] {
    /* Hide native checkbox if using slider, or keep it if slider is hidden */
    /* The W3C switch pattern usually hides the input */
    opacity: 0;
    width: 0 !important;
    height: 0 !important;
    margin: 0;
}

/* Toggle Switch Styles */
.switch {
    position: relative;
    display: inline-block;
    width: 32px;
    height: 18px;
    vertical-align: middle;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #444;
    transition: .4s;
    border-radius: 18px;
    /* Default round if not specified, or match height */
}

.slider:before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.switch input:checked+.slider {
    background-color: var(--accent-color);
}

.switch input:checked+.slider:before {
    transform: translateX(14px);
}

/* Rounded variation */
.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}