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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
    background: #0a0a14;
    color: #ffffff;
    min-height: 100vh;
    padding: 40px 20px;
}

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

.settings-header {
    text-align: center;
    margin-bottom: 40px;
}

.settings-header h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #00e5ff, #ff0080, #ffcc00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.settings-header p {
    color: #808080;
    font-size: 16px;
}

.user-id-display {
    display: inline-block;
    margin-top: 12px;
    padding: 6px 12px;
    background: #12121e;
    border: 1px solid #1a1a2e;
    border-radius: 6px;
    font-size: 12px;
    color: #00e5ff;
    font-family: 'Courier New', monospace;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

@media (max-width: 900px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

.settings-card {
    background: #12121e;
    border: 1px solid #1a1a2e;
    border-radius: 12px;
    padding: 24px;
}

.settings-card h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #ffffff;
    padding-bottom: 12px;
    border-bottom: 1px solid #2a2a4a;
}

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

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #a0a0a0;
    margin-bottom: 8px;
}

.form-group input[type="text"],
.form-group input[type="number"] {
    width: 100%;
    padding: 12px 16px;
    background: #0f0f1a;
    border: 1px solid #2a2a4a;
    border-radius: 8px;
    color: #ffffff;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #00e5ff;
}

.form-group input::placeholder {
    color: #4a4a6a;
}

.optional-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #2a2a4a;
    border-radius: 4px;
    font-size: 11px;
    color: #808080;
    font-weight: 500;
    margin-left: 8px;
}

.input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.help-link {
    font-size: 12px;
    color: #ff0080;
    text-decoration: none;
}

.help-link:hover {
    text-decoration: underline;
}

.spotify-status {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    background: #2a2a4a;
    color: #808080;
}

.spotify-status.connected {
    background: rgba(29, 185, 84, 0.2);
    color: #1db954;
}

.server-status {
    display: inline-block;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    background: #2a2a4a;
    color: #808080;
    margin-bottom: 16px;
}

.server-status.connected {
    background: rgba(0, 229, 255, 0.2);
    color: #00e5ff;
}

.setup-guide {
    margin-bottom: 24px;
    padding: 16px;
    background: rgba(0, 229, 255, 0.04);
    border: 1px solid #2a2a4a;
    border-left: 3px solid #00e5ff;
    border-radius: 8px;
}

.setup-guide h3 {
    margin-bottom: 10px;
    color: #00e5ff;
    font-size: 14px;
    font-weight: 600;
}

.spotify-guide {
    background: rgba(29, 185, 84, 0.05);
    border-left-color: #1db954;
}

.spotify-guide h3 {
    color: #1db954;
}

.youtube-guide {
    background: rgba(255, 0, 0, 0.05);
    border-left-color: #ff0000;
}

.youtube-guide h3 {
    color: #ff4d4d;
}

.setup-guide ol {
    margin: 0;
    padding-left: 20px;
    color: #c0c0c0;
    font-size: 13px;
    line-height: 1.5;
}

.setup-guide li {
    margin-bottom: 7px;
}

.setup-guide li:last-child {
    margin-bottom: 0;
}

.setup-guide code {
    padding: 2px 5px;
    background: #12121e;
    border-radius: 4px;
    color: #ffcc00;
    font-size: 11px;
}

.setup-note,
.button-hint,
.field-hint {
    color: #808080;
    font-size: 12px;
    line-height: 1.5;
}

.setup-note {
    margin-top: 12px;
}

.required-badge,
.copy-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.2px;
    vertical-align: middle;
}

.required-badge {
    background: rgba(255, 0, 128, 0.15);
    color: #ff80b8;
}

.copy-badge {
    background: rgba(0, 229, 255, 0.12);
    color: #00e5ff;
}

.field-hint {
    margin-top: 8px;
}

.button-hint {
    margin-top: -12px;
    margin-bottom: 20px;
}

.api-tabs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin: 20px 0;
    padding: 4px;
    background: #0f0f1a;
    border: 1px solid #2a2a4a;
    border-radius: 8px;
}

.api-tab {
    padding: 10px 12px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: #808080;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.api-tab:hover {
    color: #ffffff;
}

.api-tab[data-api-tab="spotify"] {
    --api-tab-color: #1db954;
    --api-tab-background: rgba(29, 185, 84, 0.12);
}

.api-tab[data-api-tab="youtube"] {
    --api-tab-color: #ff0000;
    --api-tab-background: rgba(255, 0, 0, 0.12);
}

.api-tab.active {
    background: var(--api-tab-background, rgba(0, 229, 255, 0.1));
    border-color: var(--api-tab-color, #00e5ff);
    color: var(--api-tab-color, #00e5ff);
}

.api-panel[hidden] {
    display: none;
}

.api-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
}

.api-save-note {
    color: #808080;
    font-size: 12px;
}

.divider {
    border: none;
    border-top: 1px solid #2a2a4a;
    margin: 20px 0;
}

.theme-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

.theme-btn {
    padding: 10px 8px;
    background: #0f0f1a;
    border: 2px solid var(--theme-color, #2a2a4a);
    border-radius: 8px;
    color: #a0a0a0;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-btn:hover {
    border-color: #4a4a6a;
    color: #ffffff;
}

.theme-btn.active {
    border-color: var(--theme-color, #00e5ff);
    color: var(--theme-color, #00e5ff);
    background: rgba(0, 229, 255, 0.1);
}

.theme-btn[data-theme="dark"] { --theme-color: #00e5ff; }
.theme-btn[data-theme="light"] { --theme-color: #6366f1; }
.theme-btn[data-theme="neon"] { --theme-color: #00ff88; }
.theme-btn[data-theme="nord"] { --theme-color: #88c0d0; }
.theme-btn[data-theme="fallout"] { --theme-color: #00ff41; }
.theme-btn[data-theme="borderlands"] { --theme-color: #ff6600; }
.theme-btn[data-theme="7days"] { --theme-color: #cc3333; }
.theme-btn[data-theme="halflife"] { --theme-color: #ff6600; }
.theme-btn[data-theme="minecraft"] { --theme-color: #5d8c42; }
.theme-btn[data-theme="cyberpunk"] { --theme-color: #ff00ff; }
.theme-btn[data-theme="dynamic"] { --theme-color: #00e5ff; }
.theme-btn[data-theme="dynamic-advanced"] { --theme-color: #00e5ff; }

.theme-btn:hover,
.theme-btn.active {
    border-color: var(--theme-color, #00e5ff);
    color: var(--theme-color, #00e5ff);
}

.theme-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.theme-status {
    color: #808080;
    font-size: 12px;
}

.theme-status.pending {
    color: #ffcc00;
}

.theme-status.applied {
    color: #00e5ff;
}

.obs-dimensions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    margin-bottom: 20px;
    background: rgba(0, 229, 255, 0.06);
    border: 1px solid rgba(0, 229, 255, 0.25);
    border-radius: 8px;
    color: #00e5ff;
    font-size: 13px;
}

.obs-dimensions span {
    color: #808080;
    font-size: 12px;
}

.url-display {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.url-display input {
    flex: 1;
    padding: 12px 16px;
    background: #0a0a14;
    border: 1px solid #1a1a2e;
    border-radius: 8px;
    color: #00e5ff;
    font-size: 13px;
    font-family: 'Courier New', monospace;
}

.hint {
    font-size: 13px;
    color: #808080;
    line-height: 1.5;
}

.hint code {
    background: #12121e;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    color: #ffcc00;
}

.preview-heading {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #2a2a4a;
}

.preview-container {
    background: #0f0f1a;
    border: 2px dashed #2a2a4a;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    margin-bottom: 16px;
    margin-top: 12px;
    overflow: hidden;
    position: relative;
}

.preview-container iframe {
    width: 1400px;
    height: 550px;
    border: none;
    border-radius: 16px;
    background: transparent;
    overflow: hidden;
    transform: scale(0.27);
    transform-origin: center center;
    position: absolute;
    top: 50%;
    left: 50%;
    margin-left: -700px;
    margin-top: -275px;
}

.obs-section {
    margin-top: 24px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn:disabled {
    opacity: 0.5;
    cursor: default;
    transform: none;
}

.btn-primary {
    background: linear-gradient(135deg, #00e5ff, #00b8d4);
    color: #0a0a14;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #00b8d4, #0097a7);
    transform: translateY(-1px);
}

.btn-secondary {
    background: #2a2a4a;
    color: #ffffff;
}

.btn-secondary:hover {
    background: #3a3a5a;
}

.btn-spotify {
    background: #1db954;
    color: #ffffff;
}

.btn-spotify:hover {
    background: #1ed760;
}

.btn-danger {
    background: #ff4444;
    color: #ffffff;
}

.btn-danger:hover {
    background: #ff6666;
}

.btn-large {
    padding: 16px 48px;
    font-size: 16px;
}

.button-row {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.button-row .btn {
    flex: 1;
}

.readonly-input {
    background: #0a0a14 !important;
    border-color: #00e5ff !important;
    color: #00e5ff !important;
    font-family: 'Courier New', monospace;
    cursor: default;
}

.readonly-input:focus {
    outline: none;
    border-color: #00e5ff !important;
}

.settings-footer {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, #00e5ff, #00b8d4);
    color: #0a0a14;
    padding: 16px 24px;
    border-radius: 8px;
    font-weight: 600;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.error {
    background: #ff4444;
    color: #ffffff;
}
