@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&display=swap');

:root {
    --primary: #8a2be2;
    --primary-bg: #0f0c29;
    --accent: #00d2ff;
    --glass: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text: #ffffff;
    --text-dim: rgba(255, 255, 255, 0.7);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background: radial-gradient(circle at top right, #1a1a2e, #16213e, #0f0c29);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

.bg-decor {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100vw;
    height: 100vh;
    z-index: -1;
    opacity: 0.4;
    filter: blur(80px);
    background:
        radial-gradient(circle at 20% 30%, var(--primary) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, var(--accent) 0%, transparent 40%);
}

.container {
    width: 100%;
    max-width: 800px;
    padding: 40px;
    z-index: 1;
}

.glass-card {
    background: var(--glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    padding: 50px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    text-align: center;
    animation: slideUp 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 15px;
    background: linear-gradient(to right, #fff, var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-dim);
    margin-bottom: 40px;
    line-height: 1.6;
}

.input-wrapper {
    position: relative;
    margin-bottom: 30px;
}

textarea {
    width: 100%;
    height: 160px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 20px;
    color: white;
    font-size: 1.1rem;
    resize: none;
    transition: all 0.3s ease;
    outline: none;
}

textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.2);
    background: rgba(0, 0, 0, 0.3);
}

/* Options Grid */
.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
    text-align: left;
}

.option-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-dim);
    font-size: 0.9rem;
}

select {
    width: 100%;
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: white;
    font-family: inherit;
    outline: none;
}

option {
    background: #1a1a2e;
}

/* Toggle Switch */
.toggle-switch {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 42px;
    /* Match select height roughly */
}

.toggle-switch input {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    cursor: pointer;
}

.toggle-switch label {
    margin-bottom: 0;
    color: white;
    cursor: pointer;
}

.btn-generate {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border: none;
    padding: 18px 40px;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 20px rgba(138, 43, 226, 0.3);
}

.btn-generate:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 15px 30px rgba(138, 43, 226, 0.4);
}

.btn-generate:active {
    transform: scale(0.98);
}

.btn-generate:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

#status {
    margin-top: 25px;
    font-weight: 500;
    min-height: 24px;
}

.loading-dots:after {
    content: '...';
    animation: dots 1.5s steps(5, end) infinite;
}

@keyframes dots {

    0%,
    20% {
        content: '';
    }

    40% {
        content: '.';
    }

    60% {
        content: '..';
    }

    80%,
    100% {
        content: '...';
    }
}

#playSection {
    margin-top: 30px;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.btn-play {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 15px 35px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 auto;
}

/* Buttons */
.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.btn-play:hover {
    background: var(--accent);
    color: var(--primary-bg);
}

.success-badge {
    color: #00ff88;
    background: rgba(0, 255, 136, 0.1);
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.9rem;
    display: inline-block;
    margin-bottom: 20px;
}

.qr-container {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 30px;
    display: inline-block;
    animation: fadeIn 0.8s ease;
}

#qrcode {
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    display: flex;
    justify-content: center;
}

#qrcode img {
    margin: 0 auto;
}