/* --- CSS RESET & BASIC VARS --- */
:root {
    --bg-dark: hsl(240, 10%, 5%);
    --bg-card: rgba(22, 22, 26, 0.65);
    --border-color: rgba(212, 175, 55, 0.12);
    --border-hover: rgba(212, 175, 55, 0.3);
    --text-main: hsl(0, 0%, 93%);
    --text-muted: hsl(0, 0%, 65%);
    --gold-primary: hsl(42, 78%, 54%);
    --gold-glow: hsl(42, 90%, 60%);
    --gold-dark: hsl(35, 60%, 35%);
    --orange-accent: hsl(24, 85%, 50%);
    --card-glow-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-outfit: 'Outfit', sans-serif;
    --font-playfair: 'Playfair Display', serif;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-outfit);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
    padding: 2rem 1rem;
}

/* --- PREMIUM BACKDROP GLOW ORBS --- */
.glow-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.15;
}

.orb-1 {
    top: -10%;
    right: 15%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--gold-primary) 0%, transparent 70%);
}

.orb-2 {
    bottom: -10%;
    left: 10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--orange-accent) 0%, transparent 70%);
}

/* --- APP WRAPPER --- */
.app-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* --- HEADER DESIGN --- */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: var(--card-glow-shadow);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.wave-icon {
    font-size: 2.2rem;
    color: var(--gold-primary);
    text-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
    animation: pulseIcon 3s infinite ease-in-out;
}

@keyframes pulseIcon {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; text-shadow: 0 0 25px rgba(212, 175, 55, 0.8); }
}

.brand h1 {
    font-family: var(--font-playfair);
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.brand h1 span {
    font-family: var(--font-outfit);
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-left: 0.5rem;
}

.brand p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.portal-badge a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gold-primary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px dashed var(--gold-primary);
    padding: 0.5rem 1rem;
    border-radius: 30px;
    background: rgba(212, 175, 55, 0.05);
    transition: var(--transition-smooth);
}

.portal-badge a:hover {
    background: rgba(212, 175, 55, 0.15);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.25);
    transform: translateY(-2px);
}

/* --- DASHBOARD GRID --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .app-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

/* --- CARD DESIGN --- */
.dashboard-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: var(--card-glow-shadow);
    padding: 1.5rem;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;
    overflow: hidden;
}

.dashboard-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--gold-primary), transparent);
    opacity: 0.5;
}

.dashboard-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px 0 rgba(212, 175, 55, 0.06);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.icon-wrap {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--gold-primary);
    font-size: 1.1rem;
}

.card-header h2 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-main);
}

.card-body {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

/* --- FORM ELEMENTS --- */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.custom-select, .custom-input {
    width: 100%;
    background-color: rgba(12, 12, 14, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-family: var(--font-outfit);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition-smooth);
}

.custom-select:hover, .custom-input:hover {
    border-color: rgba(212, 175, 55, 0.4);
}

.custom-select:focus, .custom-input:focus {
    border-color: var(--gold-primary);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.15);
}

/* Custom dropdown style */
.custom-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23d4af37' width='18px' height='18px'%3E%3Cpath d='M0 0h24v24H0V0z' fill='none'/%3E%3Cpath d='M7 10l5 5 5-5H7z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 35px;
}

.custom-input::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

.field-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

/* INFO BOX */
.info-box {
    margin-top: 0.5rem;
    padding: 0.8rem 1rem;
    background: rgba(212, 175, 55, 0.04);
    border-left: 3px solid var(--gold-primary);
    border-radius: 0 10px 10px 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.info-label {
    color: var(--text-muted);
}

.info-value {
    color: var(--gold-primary);
    font-weight: 600;
}

/* Disable state simulation for dropdown groups */
.group-disabled {
    opacity: 0.4;
    pointer-events: none;
    transition: var(--transition-smooth);
}

/* --- RESULTS AREA & VISUALIZER --- */
.results-area {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: var(--card-glow-shadow);
    padding: 2rem;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Dynamic Sound Wave Visualizer */
.visualizer-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 4px;
    height: 40px;
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-dark);
    padding: 8px 24px;
    border-radius: 30px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.visualizer-bar {
    width: 4px;
    background: linear-gradient(to top, var(--gold-dark), var(--gold-primary));
    border-radius: 4px;
    animation: bounceVisualizer 1.2s infinite ease-in-out alternate;
    height: 5px;
}

@keyframes bounceVisualizer {
    0% { height: 5px; }
    100% { height: 26px; }
}

/* Randomize bar animation parameters for realism */
.bar-1  { animation-delay: 0.1s; height: 12px; }
.bar-2  { animation-delay: 0.35s; height: 18px; }
.bar-3  { animation-delay: 0.15s; height: 8px; }
.bar-4  { animation-delay: 0.6s; height: 22px; }
.bar-5  { animation-delay: 0.25s; height: 14px; }
.bar-6  { animation-delay: 0.45s; height: 26px; }
.bar-7  { animation-delay: 0.2s; height: 16px; }
.bar-8  { animation-delay: 0.55s; height: 10px; }
.bar-9  { animation-delay: 0.3s; height: 24px; }
.bar-10 { animation-delay: 0.65s; height: 6px; }
.bar-11 { animation-delay: 0.4s; height: 19px; }
.bar-12 { animation-delay: 0.5s; height: 13px; }

/* RESULTS GRID */
.results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .results-grid {
        grid-template-columns: 1fr;
    }
}

.result-card {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.result-header h3 i {
    color: var(--gold-primary);
}

.btn-copy {
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.25);
    color: var(--gold-primary);
    padding: 0.4rem 1rem;
    border-radius: 30px;
    cursor: pointer;
    font-family: var(--font-outfit);
    font-size: 0.8rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: var(--transition-smooth);
}

.btn-copy:hover {
    background: var(--gold-primary);
    color: var(--bg-dark);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
    transform: translateY(-1px);
}

.btn-copy:active {
    transform: translateY(1px);
}

/* Result Actions Container */
.result-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Regenerate / Yenile Button */
.btn-regenerate {
    background: rgba(212, 175, 55, 0.15);
    border: 1px solid rgba(212, 175, 55, 0.35);
    color: var(--gold-primary);
    padding: 0.4rem 1rem;
    border-radius: 30px;
    cursor: pointer;
    font-family: var(--font-outfit);
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: var(--transition-smooth);
}

.btn-regenerate:hover {
    background: var(--gold-primary);
    color: var(--bg-dark);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
    transform: translateY(-1px);
}

.btn-regenerate:active {
    transform: translateY(1px);
}

.btn-regenerate-spin i {
    animation: diceSpin 0.5s ease-out;
}

@keyframes diceSpin {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.3); }
    100% { transform: rotate(360deg) scale(1); }
}

/* Prompt Box Formatting */
.prompt-box-wrapper {
    position: relative;
    border-radius: 12px;
    background: hsl(240, 10%, 3%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1rem;
    transition: var(--transition-smooth);
}

.prompt-box-wrapper:focus-within {
    border-color: rgba(212, 175, 55, 0.5);
    box-shadow: inset 0 0 15px rgba(0,0,0,0.8), 0 0 10px rgba(212, 175, 55, 0.1);
}

.output-text-area {
    width: 100%;
    height: 200px;
    background: transparent;
    border: none;
    outline: none;
    color: var(--gold-primary);
    font-family: var(--font-outfit);
    font-size: 1.05rem;
    font-weight: 400;
    line-height: 1.5;
    resize: none;
    cursor: text;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.15);
}

.lyrics-area-output {
    height: 200px;
    color: var(--text-main);
    font-family: monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    text-shadow: none;
}

.char-counter {
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.char-warning {
    color: var(--orange-accent) !important;
}

.suno-warning {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.suno-warning i {
    color: var(--gold-primary);
}

/* --- FOOTER --- */
.app-footer {
    text-align: center;
    padding: 1.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* --- TOAST NOTIFICATION --- */
#toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--gold-primary);
    color: var(--bg-dark);
    font-weight: 600;
    padding: 0.75rem 2rem;
    border-radius: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
}

.toast-hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(20px) !important;
}

.toast-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0) !important;
}

/* --- TOGGLE SWITCH DESIGN --- */
.toggle-group {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed rgba(212, 175, 55, 0.1);
}

.toggle-container {
    display: flex;
    align-items: center;
    position: relative;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-main);
    user-select: none;
    gap: 0.8rem;
}

.toggle-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 18px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    transition: var(--transition-smooth);
}

.checkmark:after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--text-muted);
    transition: var(--transition-smooth);
}

.toggle-container input:checked ~ .checkmark {
    background-color: rgba(212, 175, 55, 0.2);
    border-color: var(--gold-primary);
}

.toggle-container input:checked ~ .checkmark:after {
    left: 20px;
    background-color: var(--gold-primary);
    box-shadow: 0 0 8px var(--gold-glow);
}

.toggle-container:hover input ~ .checkmark {
    border-color: rgba(212, 175, 55, 0.4);
}

.toggle-label {
    color: var(--text-main);
    font-weight: 500;
}

/* --- AVANT-GARDE LAB SPECIFIC --- */
.card-avantgarde {
    transition: var(--transition-smooth);
}

.card-avantgarde.active {
    border-color: rgba(168, 85, 247, 0.4);
    box-shadow: 0 12px 40px 0 rgba(168, 85, 247, 0.12), var(--card-glow-shadow);
}

.card-avantgarde.active::before {
    background: linear-gradient(90deg, transparent, hsl(270, 85%, 65%), transparent);
}

.card-avantgarde.active .icon-wrap {
    color: hsl(270, 85%, 65%);
    background: rgba(168, 85, 247, 0.08);
    border-color: rgba(168, 85, 247, 0.2);
}
