/* Weather Sounds - Atmospheric UI */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --text-color: #2c3e50;
    --bg-color: #ecf0f1;
    --card-bg: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

/* Weather-reactive color schemes */
.sunny {
    --primary-color: #f39c12;
    --secondary-color: #e67e22;
    --bg-color: #fef9e7;
}

.rainy {
    --primary-color: #34495e;
    --secondary-color: #7f8c8d;
    --bg-color: #eaeded;
}

.cloudy {
    --primary-color: #95a5a6;
    --secondary-color: #bdc3c7;
    --bg-color: #f8f9fa;
}

.stormy {
    --primary-color: #2c3e50;
    --secondary-color: #8e44ad;
    --bg-color: #e8e8e8;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--bg-color) 0%, #ffffff 100%);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    transition: var(--transition);
}

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

.app-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px 0;
}

.app-header h1 {
    font-size: 3rem;
    font-weight: 300;
    color: var(--primary-color);
    margin-bottom: 10px;
    transition: var(--transition);
}

.tagline {
    font-size: 1.2rem;
    color: var(--secondary-color);
    font-style: italic;
    opacity: 0.8;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 30px;
    flex: 1;
}

.weather-section {
    grid-column: 1;
    grid-row: 1;
}

.music-section {
    grid-column: 2;
    grid-row: 1;
}

.narrative-section {
    grid-column: 1 / -1;
    grid-row: 2;
}

.history-section {
    grid-column: 1 / -1;
    grid-row: 3;
}

/* Card Styles */
.weather-card,
.music-card,
.narrative-card,
.history-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.weather-card:hover,
.music-card:hover,
.narrative-card:hover,
.history-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.weather-card h2,
.music-card h2,
.narrative-card h2,
.history-card h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.5rem;
    font-weight: 500;
}

/* Weather Info */
.weather-info {
    text-align: center;
}

.location {
    font-size: 1.1rem;
    color: var(--secondary-color);
    margin-bottom: 10px;
}

.temperature {
    font-size: 4rem;
    font-weight: 200;
    color: var(--primary-color);
    margin: 20px 0;
}

.conditions {
    font-size: 1.3rem;
    color: var(--text-color);
    margin-bottom: 20px;
    text-transform: capitalize;
}

.details {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 0.9rem;
    color: var(--secondary-color);
}

/* Music Profile */
.music-profile {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.mood-display,
.energy-display,
.tempo-display,
.genres-display {
    text-align: center;
}

.mood-display h3,
.energy-display h3,
.tempo-display h3,
.genres-display h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.1rem;
}

/* Mood and Energy Bars */
.mood-bar,
.energy-bar {
    width: 100%;
    height: 8px;
    background: #ecf0f1;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.mood-fill,
.energy-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary-color), var(--primary-color));
    border-radius: 4px;
    transition: width 0.8s ease;
}

.mood-label,
.energy-label {
    font-size: 0.9rem;
    color: var(--text-color);
    font-weight: 500;
}

/* Tempo Display */
.tempo-info {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.bpm {
    font-size: 2rem;
    font-weight: 300;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.tempo-desc {
    font-size: 0.9rem;
    color: var(--secondary-color);
}

/* Genres */
.genres-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.genre-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(52, 152, 219, 0.1);
    border-radius: 6px;
    font-size: 0.9rem;
}

.genre-name {
    color: var(--text-color);
    text-transform: capitalize;
}

.genre-weight {
    color: var(--secondary-color);
    font-weight: 500;
}

/* Narrative */
.narrative-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-color);
}

.narrative-content p {
    margin-bottom: 15px;
}

/* History */
.history-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.history-day {
    text-align: center;
    padding: 15px;
    background: rgba(52, 152, 219, 0.05);
    border-radius: 8px;
    transition: var(--transition);
}

.history-day:hover {
    background: rgba(52, 152, 219, 0.1);
}

.history-date {
    font-size: 0.8rem;
    color: var(--secondary-color);
    margin-bottom: 8px;
}

.history-mood {
    font-size: 0.9rem;
    color: var(--text-color);
    margin-bottom: 5px;
}

.history-genres {
    font-size: 0.8rem;
    color: var(--secondary-color);
}

/* Status Bar */
.status-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--primary-color);
    color: white;
    padding: 10px 20px;
    text-align: center;
    font-size: 0.9rem;
    transition: var(--transition);
}

.status-bar.hidden {
    transform: translateY(100%);
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--secondary-color);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Animation Classes */
.mood-animation {
    animation: pulse 0.3s ease-in-out;
}

.energy-animation {
    animation: pulse 0.3s ease-in-out;
}

.temperature-change {
    animation: bounce 0.5s ease-in-out;
}

.tempo-change {
    animation: fadeInScale 0.4s ease-in-out;
}

.genres-updated .genre-item {
    animation: slideInLeft 0.3s ease-out forwards;
    opacity: 0;
    transform: translateX(-20px);
}

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

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

@keyframes fadeInScale {
    0% { 
        opacity: 0; 
        transform: scale(0.8); 
    }
    100% { 
        opacity: 1; 
        transform: scale(1); 
    }
}

@keyframes slideInLeft {
    0% {
        opacity: 0;
        transform: translateX(-20px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Status Bar Variants */
.status-bar.success {
    background: var(--secondary-color);
}

.status-bar.warning {
    background: #f39c12;
}

.status-bar.error {
    background: var(--accent-color);
}

.status-bar.info {
    background: var(--primary-color);
}

/* Enhanced Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus indicators for keyboard navigation */
button:focus,
.genre-item:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #000000;
        --secondary-color: #0066cc;
        --text-color: #000000;
        --bg-color: #ffffff;
        --card-bg: #ffffff;
    }
}

/* Dark theme support */
.dark-theme {
    --primary-color: #ecf0f1;
    --secondary-color: #3498db;
    --text-color: #ecf0f1;
    --bg-color: #2c3e50;
    --card-bg: #34495e;
}

/* Print styles */
@media print {
    .status-bar {
        display: none;
    }
    
    .app-container {
        max-width: none;
        padding: 0;
    }
    
    .main-content {
        display: block;
    }
    
    .weather-card,
    .music-card,
    .narrative-card {
        break-inside: avoid;
        margin-bottom: 20px;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .weather-section,
    .music-section,
    .narrative-section,
    .history-section {
        grid-column: 1;
    }
    
    .app-header h1 {
        font-size: 2rem;
    }
    
    .music-profile {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .temperature {
        font-size: 3rem;
    }
    
    .details {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .app-container {
        padding: 15px;
    }
    
    .weather-card,
    .music-card,
    .narrative-card,
    .history-card {
        padding: 20px;
    }
    
    .app-header h1 {
        font-size: 1.8rem;
    }
    
    .tagline {
        font-size: 1rem;
    }
}