/* Traktor DJ App Style Overrides */

body {
    background-color: #1a1a1a;
    color: #ffffff;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

h1, h2, h3, h4, h5, h6 {
    color: #ff6600;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Loading indicator */
.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

.loading-progress circle {
    fill: none;
    stroke: #ff6600;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: #30363d;
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
    color: #ff6600;
}

.loading-progress-text::after {
    content: var(--blazor-load-percentage-text, "Loading");
}

/* Error UI */
#blazor-error-ui {
    background: #21262d;
    border: 2px solid #ff6600;
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

#blazor-error-ui .reload {
    color: #ff6600;
    text-decoration: none;
    font-weight: bold;
}

#blazor-error-ui .reload:hover {
    color: #ffaa44;
    text-shadow: 0 0 8px rgba(255, 102, 0, 0.5);
}

/* Custom scrollbar for Traktor look */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #ff6600 0%, #ff8833 100%);
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #ffaa44 0%, #ff6600 100%);
    box-shadow: 0 0 8px rgba(255, 102, 0, 0.5);
}

/* Selection colors */
::selection {
    background-color: rgba(255, 102, 0, 0.3);
    color: #ffffff;
}

::-moz-selection {
    background-color: rgba(255, 102, 0, 0.3);
    color: #ffffff;
}

/* Shared page states --------------------------------------------------- */

.app-booting,
.state-message {
    padding: 1.5rem 0;
    color: #8b949e;
}

.state-message.error {
    color: #ff7b72;
}

.state-message.subtle {
    font-size: 12px;
    padding-top: 0.5rem;
}

.empty-state {
    padding: 4rem 0;
    text-align: center;
    color: #8b949e;
}

.empty-state .empty-icon {
    display: block;
    font-size: 2.5rem;
    color: #ff6600;
    opacity: 0.6;
    margin-bottom: 0.5rem;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* Login ---------------------------------------------------------------- */

.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: radial-gradient(circle at 50% 0%, #24201d 0%, #141414 55%, #101010 100%);
}

.login-card {
    width: 100%;
    max-width: 380px;
    padding: 2.5rem 2rem;
    text-align: center;
    background: #1c2128;
    border: 1px solid #30363d;
    border-top: 3px solid #ff6600;
    border-radius: 10px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}

.login-brand {
    margin-bottom: 1.5rem;
}

.login-logo {
    display: block;
    color: #ff6600;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 5px;
}

.login-sub {
    display: block;
    margin-top: 2px;
    color: #8b949e;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.login-lead {
    color: #c9d1d9;
    font-size: 14px;
    margin-bottom: 1.5rem;
}

.login-notice {
    margin-bottom: 1rem;
    padding: 0.6rem 0.75rem;
    border-radius: 6px;
    font-size: 13px;
    background: rgba(255, 102, 0, 0.1);
    border: 1px solid rgba(255, 102, 0, 0.35);
    color: #ffb877;
}

.login-notice.error {
    background: rgba(248, 81, 73, 0.1);
    border-color: rgba(248, 81, 73, 0.4);
    color: #ff9d95;
}

.btn-google {
    width: 100%;
    padding: 0.7rem 1rem;
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    background: linear-gradient(135deg, #ff8833 0%, #ff6600 100%);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: filter 0.15s ease;
}

.btn-google:hover:not(:disabled) {
    filter: brightness(1.1);
}

.btn-google:disabled {
    opacity: 0.6;
    cursor: progress;
}

.login-scope {
    margin: 1rem 0 0;
    color: #6e7681;
    font-size: 11px;
}

/* Error banner ---------------------------------------------------------- */

.error-banner {
    margin: 0.75rem 1.5rem 0;
    background: #2d1b1b;
    border: 1px solid #a03b32;
    border-left: 4px solid #f85149;
    border-radius: 6px;
    color: #ffd7d3;
    font-size: 13px;
}

.error-banner-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid rgba(248, 81, 73, 0.25);
}

.error-banner-title {
    font-weight: 600;
    color: #ff9d95;
    margin-right: auto;
}

.error-banner-toggle,
.error-banner-close {
    background: none;
    border: 1px solid rgba(248, 81, 73, 0.4);
    border-radius: 4px;
    color: #ffb3ad;
    font-size: 12px;
    padding: 2px 8px;
    cursor: pointer;
}

.error-banner-toggle:hover,
.error-banner-close:hover {
    background: rgba(248, 81, 73, 0.15);
    color: #ffffff;
}

.error-list {
    list-style: none;
    margin: 0;
    padding: 0.5rem 0.75rem;
}

.error-list li + li {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(248, 81, 73, 0.15);
}

.error-time {
    color: #b98b87;
    font-variant-numeric: tabular-nums;
    margin-right: 0.5rem;
}

.error-summary {
    color: #ffd7d3;
}

/* Wraps and scrolls: Drive error bodies and .NET exception chains are long,
   and truncating them defeats the point of showing them at all. */
.error-detail {
    margin: 0.4rem 0 0;
    padding: 0.5rem;
    max-height: 12rem;
    overflow: auto;
    background: #1a1010;
    border: 1px solid rgba(248, 81, 73, 0.25);
    border-radius: 4px;
    color: #e6b3ae;
    font-size: 12px;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Informational variant of the banner --------------------------------- */

.error-banner.level-info {
    background: #1c2230;
    border-color: #2f4a6b;
    border-left-color: #58a6ff;
    color: #cfe4ff;
}

.error-banner.level-info .error-banner-title { color: #79c0ff; }

.error-banner.level-info .error-banner-head { border-bottom-color: rgba(88, 166, 255, 0.25); }

.error-banner.level-info .error-banner-toggle,
.error-banner.level-info .error-banner-close {
    border-color: rgba(88, 166, 255, 0.4);
    color: #a5d0ff;
}

.error-banner.level-info .error-detail {
    background: #10161f;
    border-color: rgba(88, 166, 255, 0.25);
    color: #a9c9ea;
}

.error-banner.level-info .error-time { color: #7d95b0; }

/* Collection picker ---------------------------------------------------- */

.collection-picker {
    margin: 2rem auto 0;
    max-width: 640px;
    text-align: left;
    padding: 1rem;
    background: #1c2128;
    border: 1px solid #30363d;
    border-radius: 8px;
}

.collection-picker label {
    display: block;
    margin-bottom: 0.35rem;
    color: #ff9d4d;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.collection-picker select {
    width: 100%;
    padding: 0.45rem 0.6rem;
    background: #0d1117;
    color: #e6e6e6;
    border: 1px solid #30363d;
    border-radius: 5px;
    font-size: 13px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.collection-picker .hint {
    margin: 0.5rem 0 0;
    color: #8b949e;
    font-size: 12px;
}

/* Player bar ----------------------------------------------------------- */

.player-bar {
    position: sticky;
    bottom: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.6rem 1.5rem;
    margin-top: 1.5rem;
    background: #14181d;
    border-top: 2px solid #ff6600;
    box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.5);
}

/* Leave room so the last table row is never hidden behind the bar. */
.content { padding-bottom: 5rem; }

.player-toggle {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 13px;
    background: #30363d;
    border: 1px solid #444c56;
    color: #e6e6e6;
    cursor: pointer;
}

.player-toggle:hover { background: #ff6600; border-color: #ff6600; color: #1a1a1a; }
.player-toggle.playing { background: #ff6600; border-color: #ff8833; color: #1a1a1a; }

.player-toggle .spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-top-color: #ff6600;
    border-radius: 50%;
    animation: play-spin 0.7s linear infinite;
}

.player-body { flex: 1 1 auto; min-width: 0; }

.player-title {
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-seek {
    width: 100%;
    height: 16px;
    accent-color: #ff6600;
    cursor: pointer;
}

.player-time {
    flex: 0 0 auto;
    color: #8b949e;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.player-time-sep { opacity: 0.5; margin: 0 2px; }

/* Waveform ------------------------------------------------------------- */

.waveform { position: relative; height: 40px; }

.waveform-canvas {
    display: block;
    width: 100%;
    height: 40px;
    cursor: pointer;
}

.waveform.failed .waveform-canvas { cursor: default; }

.waveform-status {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #8b949e;
    pointer-events: none;
}

@media (max-width: 640px) {
    .player-bar { padding: 0.5rem 0.8rem; gap: 0.6rem; }
    .player-time { font-size: 11px; }
}

.player-output {
    margin-left: 0.5rem;
    padding: 1px 6px;
    border-radius: 3px;
    background: rgba(255, 102, 0, 0.15);
    border: 1px solid rgba(255, 102, 0, 0.4);
    color: #ffb877;
    font-size: 10.5px;
    font-weight: 600;
    vertical-align: middle;
}
