:root {
    /* Core Colors */
    --bg-dark: #0f172a;
    --bg-darker: #020617;
    --primary-gradient: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
    /* Darker gradient */
    --primary-glow: rgba(234, 88, 12, 0.3);
    /* Softer glow */
    --glass-bg: rgba(30, 41, 59, 0.4);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-highlight: rgba(255, 255, 255, 0.15);
    --text-main: #cbd5e1;
    /* Slate-300: Softer gray text */
    --text-muted: #64748b;
    /* Slate-500: Darker muted text */

    /* Functional Colors */
    --accent-orange: #ea580c;
    /* Orange-600: Toned down from 500 */
    --accent-green: #22c55e;
    --accent-blue: #3b82f6;
    --accent-purple: #a855f7;

    /* Dark Mode Compatibility (keeping existing vars for JS safety) */
    --dark-bg: #0f172a;
    --dark-surface: #1e293b;
    --dark-input-bg: rgba(15, 23, 42, 0.6);
    --dark-border: rgba(255, 255, 255, 0.1);
    --dark-text: #f8fafc;
    --dark-text-muted: #94a3b8;
    --dark-card-bg: rgba(30, 41, 59, 0.4);
    --dark-header-bg: rgba(15, 23, 42, 0.8);
    --dark-selected: rgba(249, 115, 22, 0.2);
}

body {
    font-family: 'Inter', 'Noto Sans KR', sans-serif;
    background-color: var(--bg-darker);
    background-image:
        radial-gradient(circle at 15% 50%, rgba(249, 115, 22, 0.08), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(59, 130, 246, 0.08), transparent 25%);
    background-attachment: fixed;
    color: var(--text-main);
    overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Glassmorphism Utilities */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
    border-color: var(--glass-highlight);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
}

.header-card {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-primary {
    background: var(--primary-gradient);
    border: 2px solid white;
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 0 10px rgba(255, 255, 255, 0.1);
}

.btn-primary:active:not(:disabled) {
    background: linear-gradient(180deg, #c2410c 0%, #9a3412 100%);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.stepper .step.active {
    color: var(--accent-orange);
    border-bottom-color: var(--accent-orange);
}

.stepper .step.active i {
    transform: scale(1.1);
}

.step-content {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.step-content.active {
    display: block;
}

/* Option Toggle Buttons - 2D Capsule Style */
.btn-toggle {
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
    border-radius: 9999px !important;
    /* Capsule shape */
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    /* Flat background */
    box-shadow: none;
    /* No shadow for 2D look */
    display: inline-block;
    margin: 0.25rem;
}

.btn-toggle:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.btn-toggle.selected {
    background: #ea580c !important;
    /* Flat selected color */
    border-color: #ea580c !important;
    color: white !important;
    box-shadow: none;
    text-shadow: none;
    transform: translateY(0);
}

.btn-toggle.selected:hover {
    background: #f97316 !important;
}

/* Form Elements */
.form-select {
    background-color: var(--dark-input-bg) !important;
    border: 1px solid var(--dark-border) !important;
    color: var(--text-main) !important;
    transition: all 0.2s ease;
    border-radius: 0.5rem;
    width: 100%;
}

.form-select option {
    background-color: var(--bg-dark);
    color: var(--text-main);
}

.form-textarea {
    background-color: var(--dark-input-bg) !important;
    border: 1px solid var(--dark-border) !important;
    color: var(--text-main) !important;
    transition: all 0.2s ease;
    border-radius: 0.5rem;
}

.form-textarea:focus {
    background-color: rgba(15, 23, 42, 0.8) !important;
    border-color: var(--accent-orange) !important;
    outline: none;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

@keyframes glow {
    0% {
        box-shadow: 0 0 5px var(--primary-glow);
    }

    50% {
        box-shadow: 0 0 20px var(--primary-glow);
    }

    100% {
        box-shadow: 0 0 5px var(--primary-glow);
    }
}

/* Toast */
.toast {
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border-radius: 0.5rem;
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.21, 1.02, 0.73, 1);
}

/* Specific Component Styles */
#generate-all-button {
    background: linear-gradient(180deg, #ea580c 0%, #c2410c 100%);
    border: 1px solid #ea580c;
    border-top: 1px solid rgba(255, 255, 255, 0.4);
    border-bottom: 1px solid rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 6px rgba(234, 88, 12, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

#generate-all-button:hover {
    background: linear-gradient(180deg, #f97316 0%, #ea580c 100%);
    box-shadow: 0 6px 12px rgba(234, 88, 12, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 0 15px rgba(234, 88, 12, 0.3);
}

#generate-lyrics-button {
    background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
    border: 1px solid #16a34a;
    border-top: 1px solid rgba(255, 255, 255, 0.4);
    border-bottom: 1px solid rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 6px rgba(34, 197, 94, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

#generate-lyrics-button:hover {
    background: linear-gradient(180deg, #4ade80 0%, #22c55e 100%);
    box-shadow: 0 6px 12px rgba(34, 197, 94, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 0 15px rgba(34, 197, 94, 0.3);
}

#generate-style-button {
    background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
    border: 1px solid #2563eb;
    border-top: 1px solid rgba(255, 255, 255, 0.4);
    border-bottom: 1px solid rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

#generate-style-button:hover {
    background: linear-gradient(180deg, #60a5fa 0%, #3b82f6 100%);
    box-shadow: 0 6px 12px rgba(59, 130, 246, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 0 15px rgba(59, 130, 246, 0.3);
}

.sequence-tag {
    padding: 0.5rem 1rem;
    /* Added padding for size increase */
    transition: all 0.2s ease;
    border-radius: 0px !important;
    /* Sharp corners */
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
}

.sequence-tag.selected {
    background: rgba(249, 115, 22, 0.15);
    border-color: var(--accent-orange);
    color: var(--accent-orange);
    box-shadow: 0 0 10px rgba(249, 115, 22, 0.2);
}

.custom-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 50;
    max-height: 200px;
    overflow-y: auto;
    background-color: var(--bg-dark);
    border: 1px solid var(--glass-border);
    border-radius: 0.5rem;
    margin-top: 4px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

.custom-dropdown.show {
    display: block;
    animation: fadeIn 0.2s ease-out;
}

.custom-dropdown-option {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.custom-dropdown-option:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--accent-orange);
}

.mobile-message {
    display: none;
    height: 100vh;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
    background: var(--bg-darker);
}

@media (max-width: 767px) {
    .app-container {
        display: none;
    }

    .mobile-message {
        display: flex;
        flex-direction: column;
    }
}

/* Flag Icons */
.lang-flag-btn {
    transition: transform 0.2s ease-in-out, opacity 0.2s;
    opacity: 0.6;
    cursor: pointer;
    padding: 0;
    background: transparent;
    border: none;
}

.lang-flag-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.lang-flag-btn.active {
    opacity: 1;
    transform: scale(1.2);
    filter: drop-shadow(0 0 8px var(--accent-orange));
}

.flag-icon {
    width: 48px;
    height: 36px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    background-size: cover;
}