:root {
    /* Vibrant Premium Color Palette */
    --primary: hsl(255, 85%, 65%);
    --primary-glow: hsla(255, 85%, 65%, 0.3);
    --secondary: hsl(285, 85%, 60%);
    --accent: hsl(15, 100%, 65%);
    --success: hsl(145, 80%, 45%);

    --bg-mesh: radial-gradient(at 0% 0%, hsla(253, 16%, 7%, 1) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(225, 39%, 30%, 1) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(339, 49%, 30%, 1) 0, transparent 50%);

    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-blur: blur(20px);

    --text-main: #ffffff;
    --text-dim: rgba(255, 255, 255, 0.6);
    --text-dark: #0f172a;

    --bot-bubble-bg: rgba(255, 255, 255, 0.05);
    --user-bubble-bg: linear-gradient(135deg, var(--primary), var(--secondary));

    --radius-xl: 2rem;
    --radius-lg: 1.5rem;
    --radius-md: 1rem;

    --shadow-premium: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    --header-height: 80px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: #0a0c10;
    background-image: var(--bg-mesh);
    color: var(--text-main);
    line-height: 1.6;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100dvh;
    font-size: 16px;
    overflow: hidden;
}

/* App Container - Ultra Premium Glass */
.app-container {
    width: 100%;
    max-width: 500px;
    height: 100dvh;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid var(--glass-border);
}

@media (min-width: 641px) {
    .app-container {
        height: 90vh;
        max-height: 850px;
        border-radius: var(--radius-xl);
        margin: 1rem;
        box-shadow: var(--shadow-premium);
    }
}

/* Header Refinement */
header {
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0 1.5rem;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.logo .icon {
    font-size: 1.8rem;
    filter: drop-shadow(0 0 10px var(--primary-glow));
}

.logo h1 {
    font-size: 1.4rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fff 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.03em;
}

header p {
    font-size: 0.85rem;
    color: var(--text-dim);
    font-weight: 500;
    letter-spacing: 0.01em;
}

/* Chat Window with Deep Effects */
#chat-window {
    flex: 1;
    overflow-y: auto;
    padding: 2rem 1.25rem;
    display: flex;
    flex-direction: column;
    scrollbar-width: none;
}

#chat-window::-webkit-scrollbar {
    display: none;
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.message {
    display: flex;
    width: 100%;
    animation: premiumEntrance 0.5s cubic-bezier(0.23, 1, 0.32, 1) both;
}

@keyframes premiumEntrance {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.message.bot {
    justify-content: flex-start;
}

.message.user {
    justify-content: flex-end;
}

.bubble {
    max-width: 85%;
    padding: 1.1rem 1.4rem;
    font-size: 1.15rem;
    line-height: 1.5;
    position: relative;
    transition: transform 0.2s ease;
}

.message.bot .bubble {
    background: var(--bot-bubble-bg);
    color: white;
    border-radius: 1.5rem 1.5rem 1.5rem 0.4rem;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
}

.message.user .bubble {
    background: var(--user-bubble-bg);
    color: white;
    border-radius: 1.5rem 1.5rem 0.4rem 1.5rem;
    box-shadow: 0 15px 30px -5px rgba(124, 58, 237, 0.3);
}

/* Result Bubble Styling */
.result-bubble {
    max-width: 100% !important;
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid var(--glass-border) !important;
    padding: 2rem !important;
    margin-top: 1rem;
    position: relative;
    overflow: hidden;
}

.result-bubble::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--user-bubble-bg);
}

.success-check {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 1rem;
}

.result-bubble h3 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: white;
}

.result-bubble p {
    font-size: 1.2rem;
    line-height: 1.6;
    color: var(--text-dim);
    white-space: pre-wrap;
    margin-bottom: 2rem;
}

.result-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Floating Interactive Input */
.input-area {
    padding: 1.5rem;
    background: transparent;
    z-index: 10;
}

.options-container {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.option-btn {
    background: var(--user-bubble-bg);
    border: none;
    color: white;
    padding: 1.25rem 2.5rem;
    border-radius: 4rem;
    font-weight: 700;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(124, 58, 237, 0.4);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.text-input-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.6rem 0.6rem 0.6rem 1.5rem;
    border-radius: 3rem;
    border: 1px solid var(--glass-border);
    transition: all 0.3s;
    backdrop-filter: blur(15px);
}

.text-input-container textarea {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: 1.15rem;
    color: white;
    padding: 0.8rem 0;
    resize: none;
    font-family: inherit;
}

.send-btn {
    background: white;
    color: var(--text-dark);
    width: 3.2rem;
    height: 3.2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
}

/* Star Rating Refinement */
.stars-container {
    display: flex;
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem 2rem;
    border-radius: 3rem;
    gap: 0.5rem;
}

.star {
    font-size: 2.5rem;
    color: rgba(255, 255, 255, 0.1);
    transition: all 0.2s;
    cursor: pointer;
}

.star.active {
    color: var(--accent);
    filter: drop-shadow(0 0 12px var(--accent));
}

.primary-btn {
    background: white;
    color: var(--text-dark);
    padding: 1.2rem;
    border-radius: 4rem;
    font-size: 1.1rem;
    font-weight: 800;
    border: none;
    box-shadow: 0 10px 20px rgba(255, 255, 255, 0.1);
    transition: all 0.3s;
    cursor: pointer;
}

.primary-btn:hover {
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(255, 255, 255, 0.15);
}

.secondary-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-dim);
    padding: 1.1rem;
    border-radius: 4rem;
    font-weight: 600;
    transition: all 0.3s;
    cursor: pointer;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
}

/* Typing Indicator */
.typing {
    display: flex;
    gap: 6px;
    padding: 0.5rem 0.5rem;
}

.typing span {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    animation: bounce 0.6s infinite alternate;
}

@keyframes bounce {
    to {
        opacity: 0.2;
        transform: translateY(-4px);
    }
}

.hidden {
    display: none !important;
}

/* Choice Buttons for Set Switching */
.choice-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.choice-btn {
    width: 100%;
    text-align: center;
    font-size: 1rem;
}

/* Example Box Styling for Question Examples */
.example-box {
    margin-top: 1rem;
    padding: 0.9rem 1.1rem;
    background: rgba(255, 255, 255, 0.04);
    border-left: 3px solid var(--primary);
    border-radius: 0 0.75rem 0.75rem 0;
    font-size: 0.95rem;
    color: var(--text-dim);
}

.example-box strong {
    display: block;
    margin-bottom: 0.5rem;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 600;
}

.example-box ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.example-box ul li {
    padding-left: 1.2rem;
    position: relative;
}

.example-box ul li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: bold;
}