/* Stream Alerts Customizer Styles */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;600;700&family=Roboto:wght@300;400;500;700&family=Open+Sans:wght@300;400;600;700&family=Montserrat:wght@300;400;500;600&family=Poppins:wght@300;400;500;600&family=Oswald:wght@300;400;500&display=swap');

@font-face {
    font-family: 'GamestationDisplay';
    src: url('../fonts/GamestationDisplay.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

/* Base Styles */
:root {
    --primary-color: #FF4D00;
    --secondary-color: #FFB703;
    --accent-color: #FFF0C2;
    --background-dark: #121212;
    --background-darker: #0d0d0d;
    --background-light: #1a1a1a;
    --text-light: #ffffff;
    --text-gray: #b3b3b3;
    --border-color: #333333;
    --success-color: #4ade80;
    --warning-color: #fbbf24;
    --error-color: #f87171;
    --border-radius: 10px;
}

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

html {
    height: 100%;
}

body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, var(--background-darker), #2b1200);
    color: var(--text-light);
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-sizing: border-box;
}

/* Header Styles */
.header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 16px;
    flex-wrap: nowrap;
    flex-shrink: 0;
    margin-bottom: 0;
    padding: 8px 14px;
    background: rgba(26, 26, 26, 0.7);
    border-radius: var(--border-radius);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.header-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.header-logo {
    width: 160px;
}

.header-divider {
    width: 2px;
    align-self: stretch;
    background: linear-gradient(to bottom, rgba(255,255,255,0.1), rgba(255,255,255,0));
    border-radius: 999px;
    flex-shrink: 0;
}

.header h1 {
    font-size: 0.95rem;
    margin-bottom: 0;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
}

.header-overlay-url {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

.header-overlay-url h3 {
    font-size: 0.95rem;
    margin: 0;
    flex-shrink: 0;
    white-space: nowrap;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-overlay-url h3 i {
    background: none;
    -webkit-background-clip: border-box;
    background-clip: border-box;
    -webkit-text-fill-color: var(--primary-color);
    color: var(--primary-color);
}


/* Main Container */
.container {
    display: flex;
    gap: 12px;
    max-width: 100%;
    margin: 0 auto;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    overflow: hidden;
}

/* Settings Panel - Left Side */
.settings-panel {
    flex: 1;
    max-width: 30%;
    background: rgba(26, 26, 26, 0.8);
    border-radius: var(--border-radius);
    padding: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-height: none;
    height: 100%;
    min-height: 0;
    overflow-y: auto;
}

/* Preview Panel - Right Side */
.preview-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(26, 26, 26, 0.8);
    border-radius: var(--border-radius);
    padding: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-height: none;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

/* Shared customizer chrome (shoutout-style layout; colors via CSS vars) */
.header-logo {
    width: 160px;
    max-width: 100%;
    height: auto;
    display: block;
}

.header h1,
.header-overlay-url h3 {
    font-family: 'Orbitron', sans-serif;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.panel-header-main {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px 16px;
    min-width: 0;
    flex: 1;
}

.panel-header h2 {
    font-size: 1.35rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    margin: 0;
}

.panel-header h2 i {
    color: var(--primary-color);
}

.preview-support-note {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    margin: 0;
    max-width: none;
    padding: 5px 10px;
    font-size: 0.78rem;
    line-height: 1.35;
    color: var(--text-gray);
    background: color-mix(in srgb, var(--primary-color) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--primary-color) 22%, transparent);
    border-radius: 999px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.preview-support-note i {
    color: var(--primary-color);
    font-size: 0.78rem;
    opacity: 0.9;
}

.preview-support-note a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.preview-support-note a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.preview-support-note strong {
    color: var(--text-light);
    font-weight: 600;
}

.panel-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.panel-header-actions .connection-indicator {
    position: static;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    background: rgba(0, 0, 0, 0.45);
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    color: #aaa;
    border: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
}

.panel-header-actions .connection-indicator .sb-logo {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: block;
    object-fit: contain;
}

.panel-header-actions .connection-indicator .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #666;
    flex-shrink: 0;
}

.panel-header-actions .connection-indicator.connecting .status-dot {
    background: var(--warning-color, #fbbf24);
    animation: preview-pulse-dot 1s infinite;
}

.panel-header-actions .connection-indicator.connected .status-dot {
    background: var(--success-color, #4ade80);
    box-shadow: 0 0 8px var(--success-color, #4ade80);
}

.panel-header-actions .connection-indicator.disconnected .status-dot {
    background: var(--error-color, #f87171);
}

@keyframes preview-pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}


.panel-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Settings Sections */
.settings-section {
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(30, 30, 30, 0.6);
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.settings-section h3 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-light);
}

.settings-section h3 i {
    color: var(--accent-color);
}

/* Setting Groups */
.setting-group {
    margin-bottom: 20px;
    position: relative;
}

.setting-group::after {
    content: "";
    position: absolute;
    inset: -9px;
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 77, 0, 0.15);
    box-shadow: 0 0 18px rgba(255, 77, 0, 0.25);
    opacity: 0;
    transition: opacity 0.2s ease, border-color 0.2s ease;
    pointer-events: none;
}

.setting-group:hover::after {
    opacity: 1;
    border-color: rgba(255, 77, 0, 0.35);
}

.setting-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-gray);
}

.style-select, input[type="color"], input[type="range"], input[type="number"], input[type="text"].text-input {
    width: 100%;
    padding: 12px;
    border-radius: var(--border-radius);
    background: rgba(40, 40, 40, 0.8);
    border: 1px solid var(--border-color);
    color: var(--text-light);
    font-size: 1rem;
}

input[type="number"], input[type="text"].text-input {
    transition: all 0.3s ease;
}

input[type="number"]:focus, input[type="text"].text-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 77, 0, 0.1);
}

input[type="color"] {
    height: 50px;
    cursor: pointer;
}

input[type="range"] {
    padding: 0;
}

.value-display {
    display: inline-block;
    margin-top: 5px;
    padding: 5px 10px;
    background: var(--primary-color);
    border-radius: var(--border-radius);
    font-weight: 500;
}

/* Checkbox Group */
.checkbox-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.checkbox-item label {
    cursor: pointer;
    font-weight: 400;
}

/* Buttons */
.save-button, .reset-button, .refresh-button, .alert-button {
    padding: 12px 20px;
    border-radius: var(--border-radius);
    border: none;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.save-button {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color, #FFB703));
    color: white;
    box-shadow: 0 4px 15px rgba(255, 77, 0, 0.3);
}

.reset-button {
    background: transparent;
    color: var(--text-gray);
    border: 1px solid var(--border-color);
}

.refresh-button {
    padding: 8px 14px;
    font-size: 0.9rem;
    background: rgba(40, 40, 40, 0.8);
    color: var(--text-light);
    border: 1px solid var(--border-color);
}

.alert-button {
    background: rgba(40, 40, 40, 0.8);
    color: var(--text-light);
    border: 1px solid var(--border-color);
    flex: 1;
    justify-content: center;
}

.save-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 77, 0, 0.4);
}

.reset-button:hover, .refresh-button:hover, .alert-button:hover {
    background: rgba(60, 60, 60, 0.8);
    transform: translateY(-2px);
}

.settings-section .settings-section {
    display: flex;
    gap: 15px;
}

/* Preview Container */
.preview-container {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    background: linear-gradient(135deg, var(--background-darker), #2b1200);
    border-radius: var(--border-radius);
    overflow: hidden;
}

#alerts-preview,
#chat-overlay-preview {
    width: 100%;
    height: 100%;
    min-height: 0;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    background: transparent;
}

/* Preview Controls — collapsible accordion */
.preview-controls {
    padding: 0;
    background: rgba(30, 30, 30, 0.65);
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
    overflow: hidden;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.preview-controls.is-open {
    border-color: color-mix(in srgb, var(--primary-color) 42%, transparent);
    box-shadow:
        0 0 0 1px color-mix(in srgb, var(--primary-color) 10%, transparent),
        0 8px 24px rgba(0, 0, 0, 0.2);
}

.test-controls-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    background: transparent;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font: inherit;
    text-align: left;
    transition: background 0.2s ease;
}

.test-controls-toggle:hover {
    background: rgba(255, 255, 255, 0.04);
}

.test-controls-toggle:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: -2px;
}

.test-controls-toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    font-weight: 500;
}

.test-controls-toggle-label > i {
    color: var(--accent-color);
    font-size: 1rem;
}

.test-controls-meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.test-controls-hint {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-gray);
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.preview-controls.is-open .test-controls-hint {
    color: var(--text-light);
    background: color-mix(in srgb, var(--primary-color) 24%, transparent);
    border-color: color-mix(in srgb, var(--primary-color) 40%, transparent);
}

.test-controls-hint-open {
    display: none;
}

.preview-controls.is-open .test-controls-hint-closed {
    display: none;
}

.preview-controls.is-open .test-controls-hint-open {
    display: inline;
}

.test-controls-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    font-size: 0.7rem;
    color: var(--text-gray);
    background: rgba(255, 255, 255, 0.05);
    transition: transform 0.28s ease, color 0.2s ease, background 0.2s ease;
}

.preview-controls.is-open .test-controls-chevron {
    transform: rotate(180deg);
    color: var(--primary-color);
    background: color-mix(in srgb, var(--primary-color) 18%, transparent);
}

.test-controls-body {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.32s ease;
}

.preview-controls.is-open .test-controls-body {
    grid-template-rows: 1fr;
}

.test-controls-body-inner {
    overflow: hidden;
    min-height: 0;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.22s ease, transform 0.22s ease, padding 0.32s ease;
    padding: 0 12px;
}

.preview-controls.is-open .test-controls-body-inner {
    opacity: 1;
    transform: translateY(0);
    padding: 2px 12px 12px;
}

.alert-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* Responsive Design */
@media (max-width: 1200px) {
    body {
        height: auto;
        max-height: none;
        overflow: auto;
    }
    .container {
        flex-direction: column;
        overflow: visible;
        flex: none;
    }
    .settings-panel, .preview-panel {
        width: 100%;
        max-width: 100%;
        height: auto;
        max-height: none;
    }
    .preview-panel {
        min-height: 60vh;
    }
    .preview-container {
        min-height: 420px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px; overflow: auto; height: auto; max-height: none;
    }

    .header {
        flex-direction: column;
        align-items: stretch;
    }

    .header-overlay-url {
            }

    .alert-buttons {
        flex-direction: column;
    }

    .alert-button {
        width: 100%;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(30, 30, 30, 0.5);
    border-radius: var(--border-radius);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: var(--border-radius);
}

::-webkit-scrollbar-thumb:hover {
    background: #CC3D00;
}

/* Custom Scrollbar for Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) rgba(30, 30, 30, 0.5);
}

/* Overlay URL Section Styles */
.url-container {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 0;
}

.url-buttons {
    display: flex;
    gap: 8px;
    margin-top: 0;
    flex-shrink: 0;
}

.url-input {
    flex: 1;
    padding: 8px 12px;
    background: rgba(30, 30, 30, 0.8);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-light);
    font-size: 13px;
    font-family: 'Courier New', monospace;
    transition: all 0.3s ease;
    min-width: 0;
}

.url-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 77, 0, 0.1);
}

.generate-button, .copy-button {
    padding: 8px 12px;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    white-space: nowrap;
}

.generate-button {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color, #FFB703));
    color: white;
    box-shadow: 0 4px 15px rgba(255, 77, 0, 0.3);
}

.generate-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 77, 0, 0.4);
}

.copy-button {
    background: linear-gradient(90deg, var(--success-color), #22c55e);
    color: white;
    box-shadow: 0 4px 15px rgba(74, 222, 128, 0.3);
}

.copy-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 222, 128, 0.4);
}

.copy-button:disabled {
    background: rgba(100, 100, 100, 0.5);
    color: rgba(255, 255, 255, 0.5);
    cursor: not-allowed;
    box-shadow: none;
}

.copy-button.copied {
    background: linear-gradient(90deg, var(--success-color), #16a34a);
    animation: pulse 0.3s ease;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.url-help {
    margin-top: 0;
    margin-bottom: 0;
    font-size: 11px;
    color: var(--text-gray);
    font-style: italic;
}

.header-overlay-url .url-help {
    font-size: 11px;
    line-height: 1.3;
}

/* Range Slider Styles */
input[type="range"].range-input {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 5px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    outline: none;
    opacity: 0.8;
    transition: opacity 0.2s;
}

input[type="range"].range-input:hover {
    opacity: 1;
}

input[type="range"].range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--text-light);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: all 0.2s;
}

input[type="range"].range-input::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 3px 10px rgba(255, 77, 0, 0.5);
}

input[type="range"].range-input::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--text-light);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: all 0.2s;
}

input[type="range"].range-input::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 3px 10px rgba(255, 77, 0, 0.5);
}

.range-value {
    font-weight: 500;
    color: var(--text-light);
}

/* Responsive adjustments for URL container */
@media (max-width: 768px) {
    .url-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .url-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .generate-button, .copy-button {
        justify-content: center;
    }
}

.footer-changelog { position: relative; }
