:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --primary: #8b5cf6;
    /* Violet */
    --secondary: #ec4899;
    /* Pink */
    --accent: #06b6d4;
    /* Cyan */
    --text: #f8fafc;
    --text-muted: #94a3b8;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    background-color: var(--bg-color);
    background-image:
        radial-gradient(at 0% 0%, rgba(139, 92, 246, 0.3) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(236, 72, 153, 0.3) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(6, 182, 212, 0.3) 0px, transparent 50%);
    /* Fixed background can be buggy on iOS, using scroll for mobile */
    background-attachment: scroll;
    color: var(--text);
    min-height: 100vh;
    /* Use dynamic viewport height for mobile browsers */
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px;
}

.container {
    width: 100%;
    max-width: 500px;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 30px 20px;
    /* Reduced padding for mobile */
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Glow effect on top */
.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
}

h1 {
    font-size: 2rem;
    /* Slightly smaller for mobile base */
    font-weight: 800;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
    background-clip: text;
    /* Standard property */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
}

:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --primary: #8b5cf6;
    /* Violet */
    --secondary: #ec4899;
    /* Pink */
    --accent: #06b6d4;
    /* Cyan */
    --text: #f8fafc;
    --text-muted: #94a3b8;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    background-color: var(--bg-color);
    background-image:
        radial-gradient(at 0% 0%, rgba(139, 92, 246, 0.3) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(236, 72, 153, 0.3) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(6, 182, 212, 0.3) 0px, transparent 50%);
    /* Fixed background can be buggy on iOS, using scroll for mobile */
    background-attachment: scroll;
    color: var(--text);
    min-height: 100vh;
    /* Use dynamic viewport height for mobile browsers */
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px;
}

.container {
    width: 100%;
    max-width: 500px;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 30px 20px;
    /* Reduced padding for mobile */
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Glow effect on top */
.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
}

h1 {
    font-size: 2rem;
    /* Slightly smaller for mobile base */
    font-weight: 800;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
    background-clip: text;
    /* Standard property */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
}

p.subtitle {
    color: var(--text-muted);
    margin-bottom: 40px;
    font-size: 1.1rem;
}

.input-group {
    position: relative;
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    /* Mobile First: Stacked */
    gap: 15px;
}

input[type="text"] {
    width: 100%;
    /* Full width in column mode */
    background: rgba(15, 23, 42, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    font-size: 1.2rem;
    color: white;
    outline: none;
    transition: all 0.3s ease;
}

/* Mic Button Styles */
.mic-btn {
    width: 100%;
    /* Mobile First: Full Width */
    height: 60px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    font-size: 1.2rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    padding: 0;
}

.mic-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.mic-btn.listening {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #ef4444;
    animation: pulse 1.5s infinite;
}

.mic-icon {
    font-size: 1.5rem;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

input[type="text"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.2);
}

input[type="text"]::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

button {
    width: 100%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    padding: 20px;
    border-radius: 16px;
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(236, 72, 153, 0.4);
}

button:active {
    transform: translateY(0);
}

/* Loading State */
button.loading {
    pointer-events: none;
    opacity: 0.8;
}

button.loading span {
    display: none;
}

button.loading::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    top: 50%;
    left: 50%;
    margin-top: -12px;
    margin-left: -12px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.status-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 12px;
    font-size: 0.95rem;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.status-message.success {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
    opacity: 1;
    transform: translateY(0);
}

.status-message.error {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
    opacity: 1;
    transform: translateY(0);
}

/* Quick Suggestions */
.suggestions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 30px;
}

.chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.chip:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent);
    color: var(--accent);
}

/* Media Query for Desktop */
@media (min-width: 768px) {
    body {
        background-attachment: fixed;
        /* Restore fixed for desktop */
    }

    .container {
        padding: 40px 30px;
    }

    h1 {
        font-size: 2.5rem;
    }

    /* Desktop Layout: Side by Side */
    .input-group {
        flex-direction: row;
    }

    .mic-btn {
        width: 60px;
        /* Compact on desktop */
    }

    .mic-label {
        display: none;
        /* Icon only on desktop */
    }
}