﻿/* CSS Variables and Custom Properties */

:root {
    --chomsky-font: 'Poppins', system-ui;
    --font-size: 16px;
}

body[data-font-size="12"] {
    --font-size: 12px;
}

body[data-font-size="14"] {
    --font-size: 14px;
}

body[data-font-size="16"] {
    --font-size: 16px;
}

body[data-font-size="18"] {
    --font-size: 18px;
}

body[data-font-size="20"] {
    --font-size: 20px;
}

body[data-font-size="24"] {
    --font-size: 24px;
}

body[data-theme="dark"] {
    --bg-primary: #162a54;
    --bg-secondary: #1e3872;
    --bg-tertiary: #2563eb;
    --bg-muted: #294083;
    --border-color: #2d4b8f;
    --text-primary: #fff;
    --text-secondary: #a8c1ff;
    --button: #4879e0;
    --button-hover: #3c6dd4;
    --element-hover: #3c6dd4;
    --input-bg: #2563eb; /* Same bright blue as container */
}

    body[data-theme="dark"][data-view-mode="patient"] {
        --bg-primary: #202123;
        --bg-secondary: #343541;
        --bg-tertiary: #40414f;
        --bg-muted: #3e3f4d;
        --border-color: #565869;
        --text-primary: #fff;
        --text-secondary: #8e8ea0;
        --button: #565869;
        --button-hover: #5c6270;
        --element-hover: #5c6270;
        --input-bg: #343541; /* Darker for patient view */
    }

body[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f2f2f2;
    --bg-tertiary: #e8f4ff;
    --border-color: #dee2e6;
    --text-primary: #374151;
    --text-secondary: #4b5563;
    --button: #e5e5e5;
    --button-hover: #e9ecef;
    --element-hover: #e9ecef;
    --input-bg: #ffffff; /* White for input fields */
}

    body[data-theme="light"][data-view-mode="patient"] {
        --bg-primary: #202123;
        --bg-secondary: #343541;
        --bg-tertiary: #40414f;
        --border-color: #565869;
        --text-primary: #fff;
        --text-secondary: #8e8ea0;
        --button: #565869;
        --button-hover: #5c6270;
        --element-hover: #5c6270;
        --input-bg: #343541; /* Dark for patient view */
    }

    /* Selected state - light blue */
    body[data-theme="light"] .warmth-option input[type="radio"]:checked + label {
        background-color: #e8f4ff;
    }

    /* Hover state - light gray */
    body[data-theme="light"] .warmth-option label:hover {
        background-color: #f8fafc;
    }

    /* Selected state - light blue */
    body[data-theme="light"] .security-option input[type="radio"]:checked + label {
        background-color: #e8f4ff;
    }

    /* Hover state - light gray */
    body[data-theme="light"] .security-option label:hover {
        background-color: #f8fafc;
    }

    body[data-theme="light"] .ai-provider-option input[type="radio"]:checked + label {
        background-color: #e8f4ff;
    }

    body[data-theme="light"] .ai-provider-option label:hover {
        background-color: #f8fafc;
    }

body[data-theme="dark"] .sentiment-emoji:hover {
    transform: scale(1.1);
    background-color: var(--element-hover);
}

body[data-theme="light"] .sentiment-emoji:hover {
    transform: scale(1.1);
    background-color: #3B82F6;
    border-color: #3B82F6;
}

body[data-theme="dark"] .sentiment-emoji.selected {
    background-color: var(--bg-tertiary);
    border-color: var(--button);
    transform: scale(1.1);
}

body[data-theme="light"] .sentiment-emoji.selected {
    background-color: #3B82F6;
    border-color: #3B82F6;
    transform: scale(1.1);
    box-shadow: 0 0 3px rgba(37, 99, 235, 0.5);
}

body[data-theme="light"] .music-survey-panel {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

body[data-theme="dark"] .music-survey-panel {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 10px #000000;
}

body[data-theme="dark"] .progress-dot.active {
    background-color: var(--bg-tertiary);
    border-color: var(--button);
    transform: scale(1.2);
    box-shadow: 0 0 3px var(--button-hover);
}

body[data-theme="light"] .progress-dot.active {
    background-color: #3B82F6;
    border-color: #3B82F6;
    transform: scale(1.2);
    box-shadow: 0 0 3px rgba(37, 99, 235, 0.5);
}

body[data-theme="dark"] .mobile-music-panel {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body[data-theme="dark"] .theme-aware-image.chomsky-icon {
    content: url('/images/chomsky-device.png');
}

body[data-theme="light"] .theme-aware-image.chomsky-icon {
    content: url('/images/chomsky-device-light.png');
}

body[data-theme="slm-dark"] .theme-aware-image.soundslikeme-icon {
    content: url('/images/soundslikeme-device.png');
}

body[data-theme="light"] .theme-aware-image.soundslikeme-icon {
    content: url('/images/soundslikeme-device-light.png');
}

body[data-theme="slm-dark"] {
    --bg-primary: #5d44c4; /* base */
    --bg-secondary: #6857cb; /* ~15% lighter */
    --bg-tertiary: #7c6fe2; /* ~30% lighter */
    --bg-muted: #4a318e; /* ~15% darker than primary */
    --border-color: #9180d7; /* manually changed for visibility*/
    --text-primary: #ffffff;
    --text-secondary: #c8bfff; /* a soft lavender white*/
    --button: #8f7df2; /* ~40% lighter than primary*/
    --button-hover: #7c6acf; /* ~25% lighter than primary */
    --element-hover: #7c6acf; /* same as button-hover */
    --input-bg: #7c6fe2; /* Same as --bg-tertiary for container matching */
}

    body[data-theme="slm-dark"] .sentiment-emoji:hover {
        transform: scale(1.1);
        background-color: var(--element-hover);
    }

    body[data-theme="slm-dark"] .sentiment-emoji.selected {
        background-color: var(--bg-tertiary);
        border-color: var(--button);
        transform: scale(1.1);
    }

    body[data-theme="slm-dark"] .music-survey-panel {
        background-color: var(--bg-primary);
        border: 1px solid var(--border-color);
        box-shadow: 0 2px 10px var(--bg-secondary);
    }

    body[data-theme="slm-dark"] .progress-dot.active {
        background-color: var(--bg-tertiary);
        border-color: var(--button);
        transform: scale(1.2);
        box-shadow: 0 0 3px var(--button-hover);
    }

    body[data-theme="slm-dark"] .mobile-music-panel {
        box-shadow: 0 2px 8px var(--bg-secondary);
    }


    body[data-theme="slm-dark"][data-view-mode="patient"] {
        --bg-primary: #202123;
        --bg-secondary: #343541;
        --bg-tertiary: #40414f;
        --bg-muted: #3e3f4d;
        --border-color: #565869;
        --text-primary: #fff;
        --text-secondary: #8e8ea0;
        --button: #565869;
        --button-hover: #5c6270;
        --element-hover: #5c6270;
        --input-bg: #343541; /* Dark for patient view */
    }

.text-primary {
    color: var(--text-primary);
    font-weight: bold;
}

/* Input field styles using the new variable */
input[type="text"],
input[type="email"],
input[type="password"],
textarea,
.settings-input,
.role-select,
#userInput,
#shareEmailInput {
    background-color: var(--input-bg) !important;
}
