:root {
    --bg-color: #080a10;
    --liquid-glass: rgba(255, 255, 255, 0.05);
    --liquid-border: rgba(255, 255, 255, 0.15);
    --liquid-highlight: rgba(255, 255, 255, 0.25);
    --text-primary: #f0f4f8;
    --text-secondary: #8b949e;
    --accent-color: #c9a0ff;
    --blob-1: #bb86fc;
    --blob-2: #03dac6;
    --blob-3: #cf6679;
}

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

body {
    font-family: 'Noto Serif SC', 'Playfair Display', serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    height: 100vh;
    display: flex;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

/* Liquid Background Animations */
.liquid-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
    filter: blur(80px);
}

.blob {
    position: absolute;
    border-radius: 50%;
    opacity: 0.6;
    animation: drift 20s infinite alternate ease-in-out;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: var(--blob-1);
    top: -100px;
    left: -100px;
    animation-duration: 25s;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: var(--blob-2);
    bottom: -150px;
    right: -100px;
    animation-delay: -5s;
}

.blob-3 {
    width: 300px;
    height: 300px;
    background: var(--blob-3);
    top: 40%;
    left: 50%;
    animation-duration: 30s;
}

@keyframes drift {
    0% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(50px, -50px) scale(1.1); }
    66% { transform: translate(-30px, 80px) scale(0.9); }
    100% { transform: translate(0, 0) scale(1); }
}

/* Base Liquid Panel Style */
.liquid-panel {
    background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--liquid-border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 1px var(--liquid-highlight);
    position: relative;
    z-index: 10;
}

.liquid-panel-top {
    background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--liquid-border);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.liquid-panel-bottom {
    background: linear-gradient(to top, rgba(8,10,16,0.8) 20%, transparent);
    z-index: 10;
}

/* Login Overlay */
.login-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(10px);
    padding: 1rem;
    transition: opacity 0.5s ease, visibility 0.5s;
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 2.5rem 2rem;
    border-radius: 24px;
    text-align: center;
}

.login-card h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    margin-bottom: 0.2rem;
    background: linear-gradient(90deg, #bb86fc, #03dac6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-sub {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 2rem;
    font-style: italic;
}

.input-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.input-group input {
    width: 100%;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--liquid-border);
    color: var(--text-primary);
    padding: 0.8rem 1rem;
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

.input-group input:focus {
    border-color: var(--accent-color);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3), 0 0 15px rgba(187, 134, 252, 0.2);
}

.error-msg {
    color: #cf6679;
    font-size: 0.85rem;
    min-height: 1.2rem;
    margin-bottom: 1rem;
}

.liquid-btn {
    width: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.15), rgba(255,255,255,0.05));
    border: 1px solid var(--liquid-highlight);
    color: var(--text-primary);
    padding: 1rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    backdrop-filter: blur(10px);
}

.liquid-btn:hover {
    background: linear-gradient(135deg, rgba(255,255,255,0.2), rgba(255,255,255,0.1));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.liquid-btn:active {
    transform: translateY(0);
}

.text-btn {
    background: transparent;
    border: none;
    box-shadow: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 1rem;
    padding: 0.5rem;
}

.text-btn:hover {
    background: transparent;
    color: var(--text-primary);
    box-shadow: none;
    transform: none;
    text-decoration: underline;
}

/* App Main Container */
.app-container {
    width: 100%;
    max-width: 600px;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 10;
}

.app-header {
    text-align: center;
    padding: 2rem 1rem 1rem;
}

.app-header h1 {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    font-size: 1.8rem;
    letter-spacing: 1px;
    background: linear-gradient(90deg, #bb86fc, #82b1ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
    font-style: italic;
}

.language-selector {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.8rem;
    margin-top: 1.2rem;
}

.language-selector select {
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--liquid-border);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
    text-align: center;
}

.language-selector select option {
    background: var(--bg-color);
    color: var(--text-primary);
}

.swap-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--liquid-border);
    color: var(--accent-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.swap-btn:active {
    transform: rotate(180deg);
}

.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    scroll-behavior: smooth;
}

.chat-container::-webkit-scrollbar {
    width: 4px;
}
.chat-container::-webkit-scrollbar-thumb {
    background-color: var(--liquid-border);
    border-radius: 4px;
}

.welcome-message {
    text-align: center;
    color: var(--text-secondary);
    margin: auto;
    font-style: italic;
    opacity: 0.7;
}

.message {
    max-width: 85%;
    padding: 1rem 1.2rem;
    border-radius: 18px;
    font-size: 1.05rem;
    line-height: 1.6;
    animation: fadeIn 0.4s ease-out forwards;
    position: relative;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.02));
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--liquid-border);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1), inset 0 1px 1px var(--liquid-highlight);
}

.message.user {
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.message.bot {
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border-left: 2px solid var(--accent-color);
    background: linear-gradient(135deg, rgba(187, 134, 252, 0.15), rgba(255,255,255,0.02));
}

.app-footer {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-family: sans-serif;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--text-secondary);
    transition: background-color 0.3s;
}

.status-indicator.active .dot {
    background-color: #03dac6;
    box-shadow: 0 0 8px #03dac6;
}
.status-indicator.recording .dot {
    background-color: #cf6679;
    box-shadow: 0 0 8px #cf6679;
    animation: pulse-dot 1.5s infinite;
}

.liquid-btn-round {
    width: 75px;
    height: 75px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.02));
    border: 1px solid var(--liquid-highlight);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    outline: none;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 2px 4px rgba(255,255,255,0.2);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

.liquid-btn-round svg {
    width: 32px;
    height: 32px;
    transition: transform 0.3s;
}

.liquid-btn-round:active {
    transform: scale(0.95);
}

.mic-button.recording {
    background: linear-gradient(135deg, rgba(207, 102, 121, 0.3), rgba(207, 102, 121, 0.1));
    border-color: rgba(207, 102, 121, 0.6);
    color: #ffb4c2;
    box-shadow: 0 0 30px rgba(207, 102, 121, 0.4), inset 0 2px 4px rgba(255,255,255,0.3);
    animation: pulse-ring 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

.mic-button.recording svg {
    transform: scale(1.1);
}

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

@keyframes pulse-ring {
    0% { box-shadow: 0 0 0 0 rgba(207, 102, 121, 0.5), inset 0 2px 4px rgba(255,255,255,0.3); }
    70% { box-shadow: 0 0 0 20px rgba(207, 102, 121, 0), inset 0 2px 4px rgba(255,255,255,0.3); }
    100% { box-shadow: 0 0 0 0 rgba(207, 102, 121, 0), inset 0 2px 4px rgba(255,255,255,0.3); }
}

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