/* --- Google Font Import --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

/* --- THEMES: Color Properties --- */
:root, :root[data-theme="twitch"] {
    --background-start: #0f0c29;
    --background-mid: #302b63;
    --background-end: #24243e;
    --primary-glow: rgba(145, 70, 255, 0.4);
    --primary-color: #9146ff;
    --primary-light: #bf94ff;
    --surface-color: rgba(24, 24, 27, 0.75);
    --surface-border: rgba(145, 70, 255, 0.2);
    --surface-border-hover: rgba(145, 70, 255, 0.5);
    --text-color: #efeff1;
    --text-muted: rgba(239, 239, 241, 0.6);
}

:root[data-theme="kick"] {
    --background-start: #0b1e1a;
    --background-mid: #1A2E29;
    --background-end: #0c1815;
    --primary-glow: rgba(82, 255, 0, 0.3);
    --primary-color: #53FC18;
    --primary-light: #b0ff97;
    --surface-color: rgba(15, 36, 31, 0.75);
    --surface-border: rgba(83, 252, 24, 0.2);
    --surface-border-hover: rgba(83, 252, 24, 0.5);
    --text-color: #efeff1;
    --text-muted: rgba(239, 239, 241, 0.6);
}


/* --- General Layout & Animated Background --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-color);
    background: linear-gradient(-45deg, var(--background-start), var(--background-mid), var(--background-end), var(--background-mid));
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    transition: background 0.5s ease;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* --- Main "Glassmorphism" Container --- */
.container {
    width: 100%;
    max-width: 700px;
    background: var(--surface-color);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--surface-border);
    border-radius: 24px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 0 0 0 1px var(--surface-border);
    transition: all 0.3s ease;
    position: relative; /* For settings icon positioning */
}

/* --- Typography --- */
h1 {
    font-size: 2.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 20px;
    text-shadow: 0 0 40px var(--primary-glow);
}

/* --- Mode Toggle Styles --- */
.mode-toggle-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 30px;
}

.toggle-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.toggle-switch input { opacity: 0; width: 0; height: 0; }

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #3a3a3c;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider { background-color: var(--primary-color); }
input:focus + .slider { box-shadow: 0 0 1px var(--primary-color); }
input:checked + .slider:before { transform: translateX(26px); }


/* --- Prompt Buttons --- */
.prompt-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 25px;
    min-height: 38px;
}

.prompt-button {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--surface-border);
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    font-weight: 600;
    transition: all 0.2s ease-in-out;
}

.prompt-button:hover {
    background: rgba(145, 70, 255, 0.15);
    color: var(--primary-light);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* --- Form Elements --- */
.input-container, .selector-container {
    margin-bottom: 20px;
    text-align: left;
}

.selector-container label {
    display: block;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
}

textarea, select {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    font-family: inherit;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text-color);
    outline: none;
    transition: all 0.3s ease;
}

textarea { min-height: 140px; resize: vertical; }

select {
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23efeff1' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}

textarea::placeholder { color: var(--text-muted); }

textarea:focus, select:focus {
    border-color: var(--primary-color);
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.5), 0 0 0 3px var(--primary-glow);
}

.char-counter {
    text-align: right;
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 8px;
    padding-right: 4px;
}

.play-button {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border: none;
    color: white;
    font-size: 18px;
    font-weight: 600;
    padding: 18px 32px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--primary-glow);
    margin-top: 20px;
}

.play-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px var(--primary-glow);
}

/* --- Status & Watermark --- */
.status {
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-muted);
    min-height: 20px;
    transition: color 0.3s ease;
}
.status.error { color: #ff6b6b; font-weight: 600; }

.watermark-footer {
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-muted);
    text-align: center;
}
.watermark-footer a { color: var(--primary-color); text-decoration: none; font-weight: 600; }

/* --- NEW: Settings Icon --- */
.settings-icon {
    position: absolute;
    top: 25px;
    right: 25px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    transition: all 0.3s ease;
}
.settings-icon:hover { color: var(--text-color); background: rgba(255, 255, 255, 0.1); }

/* --- NEW: Modal Styles --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.modal-content {
    background: var(--surface-color);
    border: 1px solid var(--surface-border);
    border-radius: 16px;
    padding: 25px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    color: var(--text-color);
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-header h2 { color: var(--text-color); }
.close-button { background: none; border: none; font-size: 2rem; color: var(--text-muted); cursor: pointer; }

/* --- NEW: Settings Section Styles --- */
.settings-section { margin-bottom: 25px; }
.settings-section h3 { margin-bottom: 15px; color: var(--primary-light); border-bottom: 1px solid var(--surface-border); padding-bottom: 10px; }
.theme-selector { display: flex; gap: 10px; }
.theme-button {
    flex-grow: 1;
    padding: 10px;
    border-radius: 8px;
    border: 2px solid var(--surface-border);
    background: none;
    color: var(--text-color);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}
.theme-button.active, .theme-button:hover { background: var(--primary-color); border-color: var(--primary-color); color: white; }

/* --- NEW: Custom List Styles (Names & Prompts) --- */
#custom-names-container, #custom-prompts-container { max-height: 150px; overflow-y: auto; padding-right: 10px; }
.list-item { display: flex; justify-content: space-between; align-items: center; background: rgba(0,0,0,0.2); padding: 10px; border-radius: 8px; margin-bottom: 8px; }
.list-item span { flex-grow: 1; }
.delete-item-btn { background: #ff4d4d; border: none; color: white; border-radius: 50%; width: 24px; height: 24px; cursor: pointer; }
.add-item-form { display: flex; gap: 10px; margin-top: 15px; }
.add-item-form input { flex-grow: 1; background: rgba(0,0,0,0.4); border: 1px solid var(--surface-border); padding: 10px; border-radius: 8px; color: var(--text-color); }
.add-item-form button { background: var(--primary-color); border: none; color: white; font-weight: bold; border-radius: 8px; width: 40px; cursor: pointer; }

/* --- NEW: Import/Export Styles --- */
.import-export p { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 15px; }
.io-buttons { display: flex; gap: 10px; }
.io-btn { flex-grow: 1; padding: 12px; border: 2px solid var(--surface-border-hover); background: none; color: var(--text-color); font-weight: 600; border-radius: 8px; cursor: pointer; }

/* --- NEW: Cookie Banner --- */
.cookie-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface-color);
    border: 1px solid var(--surface-border);
    padding: 15px 25px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 20px;
    z-index: 2000;
}
.cookie-banner p { margin: 0; }
.cookie-banner button { background: var(--primary-color); color: white; border: none; padding: 10px 20px; border-radius: 8px; cursor: pointer; }
