/* Duyguş.com - Modern CSS Styles (Romantic Palette) */

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

:root {
    /* Nuova Palette Romantica */
    --primary-color: #880e4f;    /* Bordeaux Scuro (Passione) */
    --secondary-color: #d81b60;  /* Rosa Intenso (Amore) */
    --accent-color: #ffb74d;     /* Oro Tenue (Eleganza) */
    --dark-color: #3e2723;       /* Marrone Scuro (Terra/Calore) */
    --light-color: #fce4ec;      /* Rosa Cipria Molto Chiaro */
    --white: #ffffff;
    --gradient: linear-gradient(135deg, #880e4f, #d81b60, #ffb74d);
    --shadow: 0 10px 30px rgba(136, 14, 79, 0.3); /* Ombra basata su primary-color */
    --border-radius: 15px;
    --transition: all 0.3s ease;
}

body {
    font-family: 'Poppins', sans-serif;
    /* Sfondo Sognante: Viola Prugna a Rosa Antico */
    background: linear-gradient(135deg, #4a148c 0%, #880e4f 100%);
    min-height: 100vh;
    color: var(--dark-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 0;
}

.logo h1 {
    font-size: 3.5rem;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.logo h1 i {
    color: var(--primary-color);
    margin-right: 15px;
    animation: heartbeat 2s infinite;
}

.tagline {
    font-size: 1.2rem;
    color: var(--light-color); /* Colore più tenue per il testo chiaro */
    font-weight: 300;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5); /* Ombra più scura per leggibilità */
}

/* Hero Section */
.hero {
    text-align: center;
    margin-bottom: 50px;
    padding: 40px 20px;
    /* Sfondo traslucido romantico */
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.hero h2 {
    font-size: 2.5rem;
    color: var(--white);
    margin-bottom: 15px;
    font-weight: 600;
}

.hero p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 300;
}

/* Form Section */
.form-section {
    background: var(--white);
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.song-form {
    display: grid;
    gap: 25px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--dark-color);
    font-size: 1rem;
}

.form-group label i {
    color: var(--primary-color);
    margin-right: 8px;
    width: 20px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 15px;
    border: 2px solid var(--light-color); /* Bordo più morbido */
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    background: #fffafa; /* Sfondo quasi bianco */
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--secondary-color); /* Bordo focus secondario */
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(216, 27, 96, 0.15); /* Ombra focus secondaria */
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Generate Button */
.generate-btn {
    background: var(--gradient);
    color: var(--white);
    border: none;
    padding: 18px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.generate-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(136, 14, 79, 0.4);
}

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

.generate-btn i {
    margin-right: 10px;
}

/* Result Section */
.result-section {
    background: var(--white);
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    animation: slideUp 0.5s ease;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.result-header h3 {
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 600;
}

.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.action-btn {
    background: var(--light-color);
    color: var(--dark-color);
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.action-btn:hover {
    background: var(--secondary-color); /* Hover secondario */
    color: var(--white);
    transform: translateY(-2px);
}

.song-result {
    background: var(--light-color); /* Sfondo testo rosa chiaro */
    padding: 30px;
    border-radius: 10px;
    border-left: 5px solid var(--primary-color);
    font-family: 'Georgia', serif;
    line-height: 1.8;
    font-size: 1.1rem;
    white-space: pre-line;
    color: var(--dark-color);
}

/* --- YÜKLEME BÖLÜMÜ STİLLERİ (DÜZELTİLMİŞ) --- */
.loading-section {
    /* **KRİTİK DÜZELTME: Tam ekranı kaplamak ve merkeze sabitlemek için** */
    position: fixed; 
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.65); /* Arka planı koyu ve şeffaf yaptık */
    z-index: 9999;
    
    /* İçeriği tam ortalamak için Flexbox kullanılır */
    /* JS kodu .style.display='flex' ile açtığı için !important kullanılması gerekebilir */
    display: flex; 
    justify-content: center; /* Yatayda ortalama */
    align-items: center;    /* Dikeyde ortalama */
    flex-direction: column; 
    text-align: center;
    padding: 20px;
}

/* Yükleme animasyonu kapsayıcısı (metnin bulunduğu beyaz kutu) */
.loading-animation {
    padding: 25px 35px;
    border-radius: 15px;
    background-color: var(--white); /* Beyaz arka plan */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    max-width: 90%; /* Mobil uyum için max genişlik */
    width: 320px;
}

/* Yükleme metni */
#loadingText {
    margin-top: 15px;
    font-size: 1.1rem;
    color: var(--dark-color);
    font-weight: 500;
    white-space: pre-wrap; /* Metin içerisindeki satır sonlarını korur */
}

/* Müzik Notası Animasyonu */
.music-notes {
    position: relative;
    height: 40px;
    margin-bottom: 10px;
    display: flex; /* İç notaları ortalamak için */
    justify-content: center;
    align-items: center;
    width: 100%;
}

.music-notes i {
    position: relative; /* Absolute yerine Relative kullanıldı */
    font-size: 24px;
    color: var(--secondary-color); /* Romantik paletinizdeki renk */
    margin: 0 10px;
    animation: bounce-fade 1.5s infinite ease-in-out;
}

.music-notes .note2 { animation-delay: 0.3s; }
.music-notes .note3 { animation-delay: 0.6s; }

/* Bounce-Fade Keyframes: Notanın yukarı çıkıp kaybolması */
@keyframes bounce-fade {
    0%, 100% { transform: translateY(0); opacity: 0.5; }
    50% { transform: translateY(-20px); opacity: 1; }
}
/* --- YÜKLEME BÖLÜMÜ STİLLERİ (DÜZELTİLMİŞ SONU) --- */


/* Footer */
.footer {
    text-align: center;
    padding: 30px 20px;
    color: rgba(255, 255, 255, 0.9);
    margin-top: auto;
}

.footer p {
    margin-bottom: 5px;
}

/* Animations */
@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .logo h1 {
        font-size: 2.5rem;
    }
    
    .hero h2 {
        font-size: 2rem;
    }
    
    .form-section,
    .result-section {
        padding: 25px;
    }
    
    .result-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .action-buttons {
        justify-content: center;
    }
    
    .generate-btn {
        padding: 15px 30px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 2rem;
    }
    
    .hero h2 {
        font-size: 1.5rem;
    }
    
    .form-section,
    .result-section {
        padding: 20px;
    }
    
    .song-result {
        padding: 20px;
        font-size: 1rem;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}


/* Convert to Song Button Styles */
.convert-song-btn {
    /* Nuovo gradiente per il pulsante di conversione (Viola Prugna/Scuro) */
    background: linear-gradient(135deg, #6a1b9a, #4527a0); 
    color: var(--white);
}

.convert-song-btn:hover {
    background: linear-gradient(135deg, #4527a0, #6a1b9a);
    transform: translateY(-2px);
}

/* Music Player Section */
.music-player-section {
    margin-top: 25px;
    padding: 25px;
    background: var(--light-color); /* Sfondo più caldo */
    border-radius: 10px;
    border: 2px solid #f8bbd0; /* Bordo rosa tenue */
    animation: slideUp 0.5s ease;
}

.music-player-header {
    margin-bottom: 20px;
}

.music-player-header h4 {
    color: var(--secondary-color);
    font-size: 1.3rem;
    font-weight: 600;
}

.music-player-header h4 i {
    margin-right: 10px;
    color: var(--primary-color);
}

.music-player-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.music-player {
    width: 100%;
    height: 50px;
    border-radius: 25px;
    outline: none;
}

.music-player::-webkit-media-controls-panel {
    background-color: var(--white);
    border-radius: 25px;
}

.music-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
}

/* Loading states for convert to song */
.convert-song-btn.loading {
    /* Colori di caricamento più neutri */
    background: linear-gradient(135deg, #bdbdbd, #9e9e9e);
    cursor: not-allowed;
    pointer-events: none;
}

.convert-song-btn.loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Responsive adjustments for music player */
@media (max-width: 768px) {
    .music-player-section {
        padding: 20px;
    }
    
    .music-player-header h4 {
        font-size: 1.2rem;
    }
    
    .music-controls {
        flex-direction: column;
        align-items: center;
    }
}
