/* styles.css */
:root {
    --primary: #8e44ad;
    --secondary: #9b59b6;
    --accent: #e74c3c;
    --light: #ecf0f1;
    --dark: #2c3e50;
    --text: #333;
    --bg: #f9f9f9;
    --card-bg: #fff;
    --shadow: rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

.dark-mode {
    --primary: #9b59b6;
    --secondary: #8e44ad;
    --light: #34495e;
    --dark: #ecf0f1;
    --text: #ecf0f1;
    --bg: #2c3e50;
    --card-bg: #34495e;
    --shadow: rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: var(--transition);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, var(--bg), var(--light));
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 30px;
    border-bottom: 3px solid var(--primary);
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-icon {
    font-size: 2.5rem;
    color: var(--primary);
    animation: pulse 2s infinite;
}

.logo-text {
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(45deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.theme-toggle {
    background: var(--card-bg);
    border: 2px solid var(--primary);
    color: var(--primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    box-shadow: 0 4px 8px var(--shadow);
}

.theme-toggle:hover {
    transform: rotate(30deg);
    background: var(--primary);
    color: var(--light);
}

.hero {
    text-align: center;
    margin-bottom: 40px;
}

.hero h1 {
    font-size: 2.8rem;
    margin-bottom: 10px;
    color: var(--text);
}

.hero p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 25px;
    color: var(--text);
}

.mood-selector {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px var(--shadow);
    margin-bottom: 40px;
}

.selector-title {
    text-align: center;
    margin-bottom: 25px;
    font-size: 1.8rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.input-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.input-card {
    background: var(--light);
    border-radius: 15px;
    padding: 25px;
    flex: 1;
    min-width: 250px;
    max-width: 350px;
    text-align: center;
    box-shadow: 0 5px 15px var(--shadow);
    border: 2px solid transparent;
}

.input-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
}

.input-card h3 {
    margin-bottom: 15px;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

select, .voice-btn {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: 2px solid #ddd;
    background: var(--card-bg);
    color: var(--text);
    font-size: 1rem;
    cursor: pointer;
    outline: none;
}

select:focus {
    border-color: var(--primary);
}

.voice-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--primary);
    color: white;
    border: none;
    font-weight: 600;
    transition: all 0.3s;
}

.voice-btn:hover {
    background: var(--secondary);
    transform: scale(1.05);
}

.voice-btn.listening {
    background: var(--accent);
    animation: pulse 1.5s infinite;
}

.voice-result {
    margin-top: 15px;
    font-style: italic;
    min-height: 24px;
}

.playlist-section {
    display: none;
    background: var(--card-bg);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px var(--shadow);
    margin-bottom: 40px;
}

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

.mood-result {
    display: flex;
    align-items: center;
    gap: 15px;
}

.mood-emoji {
    font-size: 2.5rem;
}

.mood-text {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
}

.playlist-actions {
    display: flex;
    gap: 15px;
}

.action-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 8px var(--shadow);
}

.action-btn:hover {
    background: var(--secondary);
    transform: translateY(-3px);
}

.action-btn.try-again {
    background: var(--accent);
}

.action-btn.try-again:hover {
    background: #c0392b;
}

.playlist-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.video-card {
    background: var(--light);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px var(--shadow);
    transition: transform 0.3s;
}

.video-card:hover {
    transform: translateY(-10px);
}

.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-info {
    padding: 15px;
}

.video-info h3 {
    margin-bottom: 8px;
    color: var(--text);
}

.video-info p {
    color: var(--secondary);
    font-size: 0.9rem;
}

.video-link {
    display: inline-block;
    margin-top: 10px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.video-link:hover {
    text-decoration: underline;
}

footer {
    text-align: center;
    padding: 20px;
    color: var(--text);
    font-size: 0.9rem;
    border-top: 1px solid var(--primary);
    margin-top: 30px;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--primary);
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 5px 15px var(--shadow);
    transform: translateX(200%);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.notification.show {
    transform: translateX(0);
}

@media (max-width: 768px) {
    .logo-text {
        font-size: 1.8rem;
    }
    
    .hero h1 {
        font-size: 2.2rem;
    }
    
    .input-row {
        flex-direction: column;
        align-items: center;
    }
    
    .input-card {
        width: 100%;
    }
    
    .playlist-header {
        flex-direction: column;
        text-align: center;
    }
    
    .mood-result {
        justify-content: center;
    }
    
    .playlist-actions {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .logo {
        flex-direction: column;
        gap: 5px;
    }
    
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .mood-selector, .playlist-section {
        padding: 20px 15px;
    }
    
    .selector-title {
        font-size: 1.5rem;
    }
    
    .action-btn {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
}