/* ============================================================
   SMOOTHLY 8.0 — CHAT STYLES (Light Theme)
   Design: Clean, bright, approachable.
   Fonts: Playfair Display (display), DM Sans (body).
   Palette: #ffffff bg, #fb5a62 accent, #10ff04 AI response.
   Pairs with: chat.html, response-actions.css
   Updated: March 2, 2026
   ============================================================ */

/* ===== RESET & FOUNDATION ===== */

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

:root {
    --bg: #ffffff;
    --bg2: #f8f8f8;
    --card: #ffffff;
    --card-hover: #f5f5f5;
    --input: #ffffff;
    --accent: #fb5a62;
    --accent-hover: #e14e55;
    --accent-glow: rgba(251, 90, 98, 0.08);
    --accent-glow-strong: rgba(251, 90, 98, 0.15);
    --accent-shadow: rgba(251, 90, 98, 0.1);
    --success: #10ff04;
    --success-bg: rgba(16, 255, 4, 0.08);
    --text: #333333;
    --text2: #666666;
    --muted: #888888;
    --faint: #dcdcdc;
    --border: rgba(0, 0, 0, 0.1);
    --border-hover: rgba(0, 0, 0, 0.18);
    --font-d: 'Playfair Display', Georgia, serif;
    --font-b: 'DM Sans', 'Helvetica Neue', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
    font-family: var(--font-b);
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}


/* ===== MAIN CONTAINER ===== */

.container {
    background-color: var(--bg);
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    padding: 0 0 40px;
    min-height: 100vh;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
}


/* ===== LOGO ===== */

.logo {
    display: block;
    width: 72px;
    height: auto;
    margin: 28px auto 12px;
    border-radius: 16px;
    opacity: 0.9;
}


/* ===== SUBTEXT / TAGLINE ===== */

.subtext {
    font-size: 14px;
    font-weight: 400;
    color: var(--text2);
    text-align: center;
    margin: 0 0 20px;
    letter-spacing: 0.1px;
}

.tagline {
    font-size: 14px;
    color: var(--text2);
    margin-top: 5px;
    text-align: center;
}


/* ===== INPUT AREA ===== */

.input-container {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 600px;
    padding: 0 20px;
    margin: 0 auto 16px;
    gap: 10px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.input-container input,
#userInput {
    flex: 1;
    padding: 14px 18px;
    font-family: var(--font-b);
    font-size: 15px;
    color: var(--text);
    background: transparent;
    border: none;
    border-radius: 12px;
    outline: none;
    transition: border-color 0.2s ease;
}

.input-container input:focus,
#userInput:focus {
    outline: none;
    box-shadow: none;
}

.input-container input::placeholder,
#userInput::placeholder {
    color: var(--muted);
}

.submit-button,
.send-btn {
    padding: 14px 24px;
    font-family: var(--font-b);
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: var(--accent);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

.submit-button:hover,
.send-btn:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 16px var(--accent-shadow);
}

.submit-button:disabled,
.send-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    box-shadow: none;
}


/* ===== CHAT MESSAGES ===== */

.chat-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    padding: 0 20px;
    overflow-y: visible;
    background: transparent;
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.message-container {
    display: flex;
    flex-direction: column;
    margin-bottom: 8px;
    position: relative;
}

.message-container.user-container {
    align-items: flex-start;
}

.message-container.ai-container {
    align-items: flex-end;
}

.message {
    padding: 14px 18px;
    border-radius: 18px;
    max-width: 75%;
    font-size: 14px;
    line-height: 1.55;
    word-wrap: break-word;
    position: relative;
}


/* User message — dark card, left-aligned */
.message.user,
.user-message {
    background: var(--accent);
    color: #ffffff;
    align-self: flex-start;
    border: none;
    border-bottom-left-radius: 6px;
}

/* AI logic — subtle, italic, right-aligned */
.message.ai-logic,
.ai-logic {
    background: var(--bg2);
    color: var(--text2);
    align-self: flex-end;
    margin-left: auto;
    font-style: italic;
    font-size: 13px;
    border-radius: 14px;
    border-bottom-right-radius: 6px;
    border: 1px solid var(--border);
    max-width: 70%;
}

/* AI response — green, right-aligned */
.message.ai-response,
.ai-response {
    background: #10ff04;
    color: #000000;
    align-self: flex-end;
    margin-left: auto;
    border: 1px solid rgba(16, 255, 4, 0.3);
    border-bottom-right-radius: 6px;
    font-weight: 450;
}


/* ===== COPY BUTTON ===== */

.copy-button {
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: -36px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.message-container:hover .copy-button {
    opacity: 1;
}

.copy-button:hover {
    border-color: var(--accent);
}

.copy-button img {
    width: 18px;
    height: 18px;
    filter: brightness(0.7);
}

.copy-notification {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.copy-notification.show {
    opacity: 1;
}


/* ===== TOKEN COUNTER ===== */

.token-counter {
    position: absolute;
    top: 12px;
    right: 80px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text2);
    background: var(--card);
    padding: 6px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.token-counter .token-icon {
    color: var(--accent);
    font-weight: 700;
}

.token-counter .token-count {
    font-weight: 700;
    color: var(--accent);
}

.token-counter .free-count {
    font-weight: 700;
    color: var(--success);
}


/* ===== PURCHASE PROMPT ===== */

.purchase-prompt {
    display: none;
    background: var(--card);
    border: 1px solid var(--border);
    padding: 24px;
    border-radius: 14px;
    text-align: center;
    margin: 20px;
}

.purchase-prompt h3 {
    color: var(--text);
    font-family: var(--font-d);
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 8px;
}

.purchase-prompt p {
    color: var(--text2);
    font-size: 14px;
    margin-bottom: 16px;
}

.purchase-prompt a {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 13px 28px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.3px;
    transition: all 0.2s ease;
}

.purchase-prompt a:hover {
    background: var(--accent-hover);
    box-shadow: 0 8px 24px var(--accent-glow-strong);
}


/* ===== THINKING MESSAGE ===== */

.thinking-message {
    display: none;
    text-align: center;
    padding: 15px;
    margin: 10px 0;
    color: var(--accent);
    font-style: italic;
    font-size: 14px;
    animation: pulse 1.5s ease-in-out infinite;
}

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

.thinking-message .dots::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}


/* ===== EXPERT BANNER ===== */

.expert-banner,
.rizz-banner {
    display: none;
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 14px 20px;
    text-align: center;
    font-weight: 500;
    font-size: 13px;
    position: relative;
    letter-spacing: 0.3px;
}

.expert-banner.active,
.rizz-banner.active {
    display: block;
}

.expert-banner .close-banner,
.rizz-banner .close-banner {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border);
    color: var(--text2);
    font-size: 1em;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.expert-banner .close-banner:hover,
.rizz-banner .close-banner:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.expert-banner a,
.rizz-banner a {
    color: var(--accent);
    text-decoration: none;
    margin-left: 8px;
    font-weight: 600;
}

.expert-banner a:hover,
.rizz-banner a:hover {
    text-decoration: underline;
}


/* ===== STYLE SELECTION MODAL ===== */

.style-modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.style-modal-overlay.active {
    display: flex;
}

.style-modal {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 36px 28px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    animation: modalSlideUp 0.3s ease;
}

@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.style-modal h2 {
    font-family: var(--font-d);
    font-size: 24px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 8px;
}

.style-modal p {
    color: var(--text2);
    font-size: 14px;
    margin-bottom: 24px;
}

.style-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.style-option {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.style-option:hover {
    border-color: var(--accent);
    background: var(--accent-glow);
}

.style-option .emoji {
    font-size: 1.6em;
    display: block;
    margin-bottom: 6px;
}

.style-option .style-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text);
    margin-bottom: 2px;
}

.style-option .style-desc {
    font-size: 11px;
    color: var(--text2);
}


/* ===== MODEL INDICATOR ===== */

.model-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin: 12px 20px;
    font-size: 13px;
    color: var(--text2);
}

.model-indicator .model-name {
    font-weight: 600;
    color: var(--text);
}

.model-indicator .change-btn {
    margin-left: auto;
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    background: none;
    border: none;
    font-family: var(--font-b);
    transition: opacity 0.2s;
}

.model-indicator .change-btn:hover {
    opacity: 0.7;
}


/* ===== COPYRIGHT ===== */

.copyright {
    font-size: 11px;
    color: var(--muted);
    text-align: center;
    margin-top: 32px;
    letter-spacing: 0.3px;
}

.copyright-notice {
    position: fixed;
    bottom: 10px;
    right: 10px;
    font-size: 11px;
    color: var(--faint);
    z-index: 1000;
}


/* ===== LOGOUT BUTTON ===== */

#logoutBtn {
    color: var(--muted);
    border: 1px solid var(--border);
    padding: 6px 14px;
    border-radius: 8px;
    font-family: var(--font-b);
    font-size: 12px;
    letter-spacing: 0.3px;
    background: none;
    cursor: pointer;
    transition: all 0.2s;
}

#logoutBtn:hover {
    border-color: var(--accent);
    color: var(--accent);
}


/* ===== HEADER ===== */

.header {
    padding: 20px 0;
    text-align: center;
}


/* ===== SEARCH CONTAINER (legacy compat) ===== */

.search-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 20px 0;
}

.search-container input {
    width: 70%;
    max-width: 400px;
    padding: 12px 16px;
    font-family: var(--font-b);
    font-size: 15px;
    color: var(--text);
    background: var(--input);
    border: 1px solid var(--border);
    border-radius: 12px 0 0 12px;
    outline: none;
    transition: border-color 0.2s;
}

.search-container input:focus {
    border-color: var(--accent);
}

.search-container input::placeholder {
    color: var(--muted);
}


/* ===== BUBBLE BUTTON ===== */

.bubble-button {
    background-color: var(--accent);
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-family: var(--font-b);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin: 0 8px;
    transition: all 0.2s ease;
    letter-spacing: 0.3px;
}

.bubble-button:hover {
    background-color: var(--accent-hover);
    box-shadow: 0 4px 16px var(--accent-shadow);
}


/* ===== USER CONTROLS ===== */

.user-controls {
    text-align: center;
    margin-top: 20px;
}


/* ===== SETTINGS PAGE ===== */

.settings-container {
    text-align: center;
    max-width: 400px;
    margin: 0 auto;
    padding: 20px;
}

.settings-header {
    margin-bottom: 30px;
}

.settings-logo {
    max-width: 72px;
    height: auto;
    display: block;
    margin: 0 auto 20px;
    border-radius: 16px;
    opacity: 0.9;
}

.settings-form form {
    margin-bottom: 20px;
    padding: 20px;
    background: var(--card);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.settings-form label {
    display: block;
    text-align: left;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text2);
}

.settings-form input {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-family: var(--font-b);
    font-size: 14px;
    color: var(--text);
    background: var(--input);
    border: 1px solid var(--border);
    border-radius: 10px;
    outline: none;
    transition: border-color 0.2s;
}

.settings-form input:focus {
    border-color: var(--accent);
}

.settings-form input::placeholder {
    color: var(--muted);
}


/* ===== WELCOME MESSAGE ===== */

#welcomeMessage {
    color: var(--text);
    background-color: var(--card);
    padding: 14px 18px;
    border-radius: 12px;
    border: 1px solid var(--border);
    margin: 20px;
    font-size: 14px;
    line-height: 1.5;
}


/* ===== SCROLLBAR ===== */

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--faint);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--muted);
}


/* ===== RESPONSIVE ===== */

@media (max-width: 640px) {
    .container {
        border-left: none;
        border-right: none;
    }

    .message {
        max-width: 88%;
    }

    .input-container {
        padding: 0 14px;
    }

    .input-container input {
        font-size: 16px; /* Prevent iOS zoom on focus */
    }

    .copy-button {
        right: -28px;
        padding: 5px;
    }

    .copy-button img {
        width: 16px;
        height: 16px;
    }

    .token-counter {
        right: 60px;
        font-size: 12px;
        padding: 5px 10px;
    }

    .logo {
        width: 56px;
        margin-top: 20px;
    }

    .style-options {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 400px) {
    .copy-button {
        padding: 4px;
    }

    .copy-button img {
        width: 14px;
        height: 14px;
    }
}
