/* Analog Wrapped Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Familjen Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    color: #111827;
    line-height: 1.6;
}

.container {
    max-width: 720px;
    margin: 3rem auto;
    padding: 1.25rem;
    min-height: auto;
    border: 1px solid #111827;
}

/* Header */
.header {
    text-align: left;
    margin-bottom: 1rem;
    color: #111827;
}

.title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.subtitle { display: block; }

/* Main Content */
.main-content { padding: 0; background: transparent; box-shadow: none; border-radius: 0; }

/* Panels (Figma-inspired) */
.panel {
    /* border: 1px solid #111827; */
    border-radius: 0;
    padding: 0.75rem 0.75rem 1rem 0.75rem;
    background: #fff;
    margin-bottom: 1.25rem;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #111827;
    margin-bottom: 1rem;
}

.panel-title {
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #111827;
}

.link-button {
    background: transparent;
    border: none;
    color: #111827;
    font-size: 0.85rem;
    cursor: pointer;
    text-transform: uppercase;
}

.panel-body {
    display: block;
}

.config-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

/* Unified hint styling */
.hint {
    font-size: 0.75rem;
    opacity: 1 !important;
}

/* Inputs - match button style */
.panel input[type="text"],
.panel input[type="number"],
.onboarding-panel input[type="text"],
.onboarding-panel input[type="number"] {
    border: 1px solid #111827;
    border-radius: 0;
    background: #ffffff;
    color: #111827;
    padding: 0.5rem 0.9rem; /* a little inner padding */
    font: inherit;
    line-height: 1;
    text-align: left;
}

.panel input[type="number"]::-webkit-outer-spin-button,
.panel input[type="number"]::-webkit-inner-spin-button {
    margin-left: 0;
}

.panel input[type="text"]::placeholder {
    color: #6b7280;
}

.panel input[type="text"]:focus,
.panel input[type="number"]:focus {
    outline: none;
    border-color: #111827;
}

/* Button system */
.btn {
    display: inline-flex;
    font-size: 0.95rem;
    align-items: center;
    justify-content: center;
    padding: 1rem 1rem;
    border-radius: 0;
    font-weight: 400;
    border: 1px solid #111827;
    background: #ffffff;
    color: #111827;
    cursor: pointer;
    text-transform: uppercase;
}

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

.btn-wide { width: 100%; margin-bottom: 12px;}

.btn-green { background: #22c55e; color: #ffffff; border-color: #22c55e; }

.btn-outline { background: #ffffff; }

.btn-gray { background: #ffffff; border-color: #111827; }

Dashboard bits
.status-legend { margin-bottom: 0.75rem; padding-bottom: 0.5rem;}
.legend-item { display: flex; align-items: center; gap: 0.5rem; color: #111827; font-size: 0.95rem; }
.legend-dot { width: 12px; height: 12px; border-radius: 0px; display: inline-block; border: 0px solid #111827; }
.legend-error { background: #ef4444; }
.legend-neutral { background: #d1d5db; }

.status-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.control-row { margin-bottom: 1.25rem; margin-top: 1.25rem; }

/* Status Section */
.status-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 12px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-dot {
    width: 12px;
    height: 12px;
    /* border-radius: 2px; */
    background: #d1d5db; /* idle */
    /* border: 1px solid #111827; */
}

.status-dot.listening { background: #22c55e; }

.status-dot.identifying { background: #f59e0b; }

.status-dot.playing { background: #2563eb; }

.status-dot.error { background: #ef4444; }

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.status-text {
    font-weight: 500;
    color: #495057;
}

.spotify-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.spotify-indicator {
    width: 12px;
    height: 12px;
    /* border-radius: 2px; */
    background: #dc3545;
    /* border: 1px solid #111827; */
}

.spotify-indicator.connected {
    background: #28a745;
}

.spotify-text {
    color: #6c757d;
}

/* Control Section */
.control-section {
    text-align: center;
    margin-bottom: 2rem;
}

.primary-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.primary-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.primary-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.secondary-button {
    background: #6c757d;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 1rem;
}

.secondary-button:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.button-icon {
    font-size: 1.2rem;
}

/* Album Section */
.album-section {
    margin-bottom: 2rem;
}

.album-card {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: #ffffff;
    border-radius: 0;
    border: 1px solid #111827;
}

.album-artwork { flex-shrink: 0; background: #d1d5db; width: 120px; height: 120px; display: grid; place-items: center; }

.album-artwork img { width: 120px; height: 120px; border-radius: 0; object-fit: cover; }

.album-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.album-title { font-size: 1rem; font-weight: 700; margin-bottom: 0.25rem; color: #111827; }

.album-artist { font-size: 0.95rem; color: #374151; margin-bottom: 0.25rem; }

.album-year { font-size: 0.85rem; color: #6b7280; margin-bottom: 0.5rem; }

.album-actions {
    margin-top: 1rem;
}

.album-actions .btn {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
}

.track-info { padding: 0.5rem 0.75rem; background: #ffffff; border-radius: 0; border: 1px solid #111827; font-size: 0.85rem; color: #111827; }

/* History Section */
.history-section {
    margin-top: 2rem;
}

.section-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #212529;
}

.history-list { max-height: 300px; overflow-y: auto; }

.history-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem; background: #ffffff; border-radius: 0; margin-bottom: 0.5rem; border: 1px solid #111827; }

.history-item:hover {
    background: #e9ecef;
}

.history-artwork { width: 48px; height: 48px; border-radius: 0; object-fit: cover; background: #d1d5db; }

.history-info {
    flex: 1;
}

.history-title { font-weight: 700; color: #111827; margin-bottom: 0.1rem; }

.history-artist { font-size: 0.85rem; color: #374151; }

.history-time { font-size: 0.85rem; color: #111827; margin-left: auto; }

.empty-state {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
    font-style: italic;
}

/* Setup Section */
.setup-section { background: transparent; border-radius: 0; padding: 0; box-shadow: none; margin-top: 2rem; }
/* .setup-box { border: 1px solid #111827; padding: 0.75rem; } */
.setup-box h3 { font-size: 0.95rem; text-transform: uppercase; margin-bottom: 0.5rem; }
.setup-box ol { margin-left: 1.25rem; margin-top: 0.5rem; }

.setup-card {
    text-align: center;
}

.setup-card h3 {
    color: #dc3545;
    margin-bottom: 1rem;
}

.setup-card ol {
    text-align: left;
    max-width: 500px;
    margin: 1rem auto;
}

.setup-card li {
    margin-bottom: 0.5rem;
}

.setup-card a { color: #111827; text-decoration: underline; }

.setup-card a:hover {
    text-decoration: underline;
}

.setup-card code {
    background: #f8f9fa;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.9rem;
}

.note {
    margin-top: 1rem;
    padding: 1rem;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    color: #856404;
    font-size: 0.9rem;
}

/* About Section */
.about-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.about-content p {
    font-size: 0.95rem;
    color: #374151;
    line-height: 1.6;
}

.about-content a {
    color: #111827;
    text-decoration: underline;
    cursor: pointer;
}

.about-content a:hover {
    opacity: 0.7;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .main-content {
        padding: 1.5rem;
    }
    
    .album-card {
        flex-direction: column;
        text-align: center;
    }
    
    .album-artwork img {
        width: 150px;
        height: 150px;
    }
    
    .status-section {
        flex-direction: column;
        gap: 1rem;
    }
    
    .control-section {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
    
    .secondary-button {
        margin-left: 0;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Onboarding */
.onboarding-prompt-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.35);
    display: grid;
    place-items: center;
    z-index: 1000;
}

/* Onboarding dim overlay for page when guide is open */
.onboarding-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.15);
    z-index: 998;
    pointer-events: none;
}

.onboarding-modal {
    background: #ffffff;
    border: 1px solid #111827;
    width: 420px;
    max-width: 92vw;
    padding: 1rem;
}

.onboarding-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #111827;
    margin-bottom: 0.75rem;
}

.onboarding-modal-header h3 {
    font-size: 1rem;
    text-transform: uppercase;
}

.onboarding-modal-body p {
    color: #374151;
    margin-bottom: 0.75rem;
}

.onboarding-modal-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.onboarding-guide {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    z-index: 999;
    width: calc(100% - 64px);
    max-width: 860px; /* wider than main container (720px) */
}

.onboarding-panel {
    position: relative;
    width: 100%;
    background: #ffffff;
    border: 1px solid #111827;
    padding: 0.75rem;
}

/* Highlight target elements during onboarding */
.onboarding-highlight {
    position: relative;
    z-index: 1001;
    /* outline: 2px solid #111827; */
    box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.35);
    transition: box-shadow 0.2s ease, outline-color 0.2s ease;
}

/* arrow removed */

.onboarding-step-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #111827;
    margin-bottom: 0.75rem;
}

.onboarding-step-body p {
    color: #111827;
    font-size: 0.95rem;
}

.onboarding-step-body ul,
.onboarding-step-body ol {
    margin-left: 36px;
    margin-top: 0.35rem;
}

.onboarding-step-body li {
    margin: 0.2rem 0;
}

.onboarding-step-body code {
    background: #f8f9fa;
    padding: 0.1rem 0.3rem;
    border: 1px solid #e5e7eb;
    font-family: 'Monaco','Menlo',monospace;
    font-size: 0.85rem;
}

.onboarding-controls {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

/* Panel list spacing */
.panel ol,
.panel ul {
    margin-left: 36px;
}
