:root {
    --bg-color: #0b0f19;
    --container-bg: rgba(255, 255, 255, 0.03);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --primary-gradient: linear-gradient(135deg, #FF512F 0%, #F09819 100%);
    --primary-color: #FF512F;
    --secondary-bg: rgba(255, 255, 255, 0.05);
    --secondary-hover: rgba(255, 255, 255, 0.1);
    --success-color: #10b981;
    --error-color: #ef4444;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --border-radius: 16px;
    --transition-speed: 0.3s;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-x: hidden;
    position: relative;
    line-height: 1.5;
}

/* Background Blobs for Visual Excellence */
.background-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
    pointer-events: none;
}

.blob {
    position: absolute;
    filter: blur(100px);
    border-radius: 50%;
    opacity: 0.4;
    animation: float 20s infinite ease-in-out alternate;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: #FF512F;
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: #F09819;
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.1); }
}

/* Main Container - Glassmorphism */
.container {
    background: var(--container-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 40px;
    width: 100%;
    max-width: 650px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    z-index: 1;
}

header {
    text-align: center;
    margin-bottom: 35px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 10px;
}

.logo h1 {
    font-size: 28px;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

header p {
    color: var(--text-secondary);
    font-size: 15px;
}

/* Form Elements */
.input-group {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

textarea, select {
    width: 100%;
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 12px;
    padding: 16px;
    font-family: var(--font-family);
    font-size: 15px;
    outline: none;
    transition: all var(--transition-speed);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

textarea:focus, select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(255, 81, 47, 0.1);
    background: rgba(255, 255, 255, 0.08);
}

textarea::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

/* Custom Select Dropdown */
.select-wrapper {
    position: relative;
}

select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 48px;
    cursor: pointer;
}

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

.select-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-secondary);
}

.controls-row {
    display: flex;
    gap: 16px;
}

.flex-1 {
    flex: 1;
}

/* Buttons */
.actions {
    display: flex;
    gap: 16px;
    margin-top: 32px;
}

.btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed);
    font-family: var(--font-family);
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 81, 47, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 81, 47, 0.4);
}

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

.btn-secondary {
    background: var(--secondary-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

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

.btn-secondary:active {
    transform: translateY(2px);
}

/* Audio Player */
.audio-player-container {
    margin-top: 30px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    animation: fadeIn 0.5s ease;
}

.audio-player-container.hidden {
    display: none;
}

.audio-title {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

audio {
    width: 100%;
    height: 48px;
    outline: none;
}

audio::-webkit-media-controls-panel {
    background-color: var(--secondary-bg);
}

audio::-webkit-media-controls-current-time-display,
audio::-webkit-media-controls-time-remaining-display {
    color: var(--text-primary);
}

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

/* Toaster Notifications */
#toaster-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 9999;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    max-width: 350px;
    pointer-events: auto;
    animation: slideIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
    transform-origin: right center;
}

.toast.hiding {
    animation: slideOut 0.3s ease-in forwards;
}

.toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.toast.success .toast-icon {
    color: var(--success-color);
    background: rgba(16, 185, 129, 0.1);
}

.toast.error .toast-icon {
    color: var(--error-color);
    background: rgba(239, 68, 68, 0.1);
}

.toast.info .toast-icon {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(100%) scale(0.9); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes slideOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(100%); }
}

/* Responsive */
@media (max-width: 600px) {
    .container {
        padding: 30px 20px;
    }
    
    .actions {
        flex-direction: column;
    }
    
    #toaster-container {
        left: 20px;
        right: 20px;
        bottom: 20px;
    }
    
    .toast {
        max-width: none;
    }
}

/* API Settings */
.api-settings {
    margin-top: 24px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.api-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: background 0.2s;
}

.api-header:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.api-header .chevron {
    margin-left: auto;
    transition: transform 0.3s;
}

.api-header.active .chevron {
    transform: rotate(180deg);
}

.api-content {
    padding: 0 16px 16px 16px;
    border-top: 1px solid transparent;
}

.api-content:not(.hidden) {
    border-top-color: var(--border-color);
    animation: fadeIn 0.3s ease;
}

.api-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.api-input {
    width: 100%;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 12px;
    font-family: monospace;
    font-size: 13px;
    outline: none;
    transition: all var(--transition-speed);
}

.api-input:focus {
    border-color: var(--success-color);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}
