
/* @import "bootstrap.min.css"; */
/* @import "font-awesome.css"; */
:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-hover: #4f46e5;
    --bg: #0f172a;
    --card-bg: #1e293b;
    --input-bg: rgba(15, 23, 42, 0.6);
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #10b981;
    --border: rgba(255, 255, 255, 0.08);
}

body {
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow-x: hidden;
    background-image:
        radial-gradient(circle at 0% 0%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(16, 185, 129, 0.05) 0%, transparent 50%);
}

.option-card {
    width: 100%;
    max-width: 800px;
    background: var(--card-bg);
    padding: 30px;
    border-radius: 28px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    border: 1px solid var(--border);
    position: relative;
    z-index: 1;
    backdrop-filter: blur(20px);
    margin: 20px;
}

.glass {
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    background: rgba(17, 25, 40, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.125);
    border-radius: 12px;
    opacity: 0.95;
}

.w-300 {
    width: 300px;
}

.w-400 {
    width: 400px;
}

h1 {
    font-size: 2rem;
    font-weight: 600;
    margin: 0 0 8px 0;
    text-align: center;
    background: linear-gradient(135deg, #fff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
    margin: 0px;  
}

p.subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 32px;
    font-weight: 300;
    font-size: 1.1rem;
}

.grid-settings {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

label span.val {
    color: var(--primary-light);
    font-family: monospace;
    font-size: 0.95rem;
}

textarea {
    width: 100%;
    height: 130px;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px;
    color: var(--text);
    font-size: 1rem;
    resize: vertical;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    line-height: 1.6;
    font-family: inherit;
}

textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(15, 23, 42, 0.8);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

select,
input[type="number"] {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text);
    font-size: 1rem;
    cursor: pointer;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='rgba(148, 163, 184, 0.8)'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 18px;
}

input[type="range"] {
    width: 100%;
    height: 6px;
    background: var(--input-bg);
    border-radius: 5px;
    appearance: none;
    cursor: pointer;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary);
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

.actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.btn {
    border: none;
    padding: 16px;
    border-radius: 16px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:focus,
.btn:active {
    outline: none;
}

.btn-play {
    flex: 2;
    background: var(--primary);
    color: white;
    box-shadow: 0 10px 20px -5px rgba(99, 102, 241, 0.4);
}

.btn-play:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.btn-download {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-download:hover {
    background: rgba(255, 255, 255, 0.1);
}

.icon-btn {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.icon-btn.active {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    animation: pulse-red 1.5s infinite;
}

.player-card {
    margin-top: 32px;
    background: rgba(15, 23, 42, 0.4);
    border-radius: 20px;
    padding: 24px;
    border: 1px solid var(--border);
    animation: slideUp 0.4s ease-out;
}

/* Metrics Styles */
.metrics-bar {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.metric {
    text-align: center;
}

.metric .label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.metric .value {
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--primary-light);
    font-weight: 600;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

audio {
    width: 100%;
    height: 44px;
}

.wave-container {
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-bottom: 12px;
    opacity: 0;
    transition: opacity 0.3s;
}

.wave-bar {
    width: 3px;
    height: 6px;
    background: var(--primary);
    border-radius: 4px;
    animation: quiet 1s infinite alternate;
}

.playing .wave-bar {
    animation: dynamic 0.5s infinite alternate;
}

@keyframes quiet {
    to {
        height: 12px;
        background: var(--primary-light);
    }
}

@keyframes dynamic {
    to {
        height: 30px;
        background: var(--accent);
    }
}

.loading .btn-play {
    pointer-events: none;
    opacity: 0.8;
    filter: grayscale(0.5);
}

.advanced-toggle {
    text-align: center;
    margin-top: 15px;
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
    text-decoration: underline;
}

/** Chat Styles */
.chat-container {
    width: 100%;
    max-width: 900px;
    height: 90vh;
    display: flex;
    flex-direction: column;
    padding: 0 !important;
    overflow: hidden !important;
    position: relative;
}

.chat-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    flex-shrink: 0;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 25px;
    scroll-behavior: smooth;
}

.message {
    max-width: 85%;
    padding: 14px 20px;
    border-radius: 20px;
    font-size: 1.05rem;
    line-height: 1.6;
    position: relative;
    animation: fadeIn 0.3s ease-out;
    word-wrap: break-word;
    font-family: inherit;
}

.message.user {
    align-self: flex-end;
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.assistant {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}

.message::before {
    content: attr(data-role);
    position: absolute;
    top: -22px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.message.user::before {
    right: 5px;
}

.message.assistant::before {
    left: 5px;
}

.input-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    background: rgba(15, 23, 42, 0.95);
    border-top: 1px solid var(--border);
    position: relative;
    z-index: 1000;
    flex-shrink: 0;
}

.main-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 14px 20px;
    color: #fff !important;
    font-size: 1rem;
    outline: none !important;
    transition: all 0.3s;
    pointer-events: auto !important;
    user-select: text !important;
}

.main-input:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}