/* Root Variables */
:root {
    --primary-color: #6B73FF;
    --secondary-color: #9C88FF;
    --background-color: #F7F9FC;
    --text-color: #2D3748;
    --accent-color: #4FD1C7;
    --card-background: rgba(255, 255, 255, 0.95);
    --border-radius: 16px;
    --padding: 20px;
    --shadow: 0 4px 20px rgba(107, 115, 255, 0.1);
    --shadow-hover: 0 8px 30px rgba(107, 115, 255, 0.15);
    
    /* New Soundscape colors */
    --light-rain-color: #9BB5FF;
    --heavy-rain-color: #6B8EFF;
    --sea-waves-color: #4DD0E1;
    --industrial-hum-color: #FFB74D;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: url('/static/images/soundscape-landscape.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-color);
    line-height: 1.6;
    padding: 0;
    margin: 0;
}

/* Horizontal Navigation */
.navbar {
    background: transparent;
    padding: 0.75rem 2rem;
    border-bottom: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: transform 0.3s ease-in-out;
}

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

.navbar .container-fluid {
    background: none !important;
    padding: 0;
    min-height: auto;
    display: flex !important;
    flex-direction: row !important;
    justify-content: flex-start;
    align-items: center;
    max-width: none;
}

.navbar-nav {
    display: flex !important;
    flex-direction: row !important;
    gap: 2.5rem;
    align-items: center;
    margin-left: 1rem;
    list-style: none;
}

.nav-link {
    color: #333;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.5rem 0;
    border-radius: 0;
    transition: color 0.2s ease;
    letter-spacing: 0.3px;
}

.nav-link:hover {
    color: #333;
    background: none;
}

/* Main Content Container */
.container-fluid {
    padding: var(--padding);
    padding-top: calc(var(--padding) + 60px); /* Add space for fixed navbar */
}

/* Header Card */
.header-card {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(8px);
    border-radius: var(--border-radius);
    padding: var(--padding);
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Header Elements */
.brand-label {
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 2px;
    color: var(--text-color);
    opacity: 0.6;
    margin-bottom: 0.5rem;
}

.app-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 3rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.app-subtitle {
    font-weight: 300;
    font-size: 1rem;
    color: var(--text-color);
    opacity: 0.7;
    margin-bottom: 1.5rem;
}

.play-indicator {
    margin: 1.5rem 0;
}

.global-play-btn {
    background: #2ECC71;
    border: none;
    border-radius: 50px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    padding: 12px 32px;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    box-shadow: 0 4px 20px rgba(46, 204, 113, 0.3);
    min-width: 120px;
}

.global-play-btn:hover {
    background: #27AE60;
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(46, 204, 113, 0.4);
}

.tip-text {
    font-size: 0.9rem;
    color: var(--text-color);
    opacity: 0.6;
    margin: 1rem 0;
}

.sponsor-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-color);
    opacity: 0.7;
    margin-top: 1rem;
}

.sponsor-logo {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

/* Main Panel */
.main-panel {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    padding: var(--padding);
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 2rem;
}

/* Master Volume Section */
.master-volume-section {
    text-align: center;
}

.section-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 1rem;
}

.master-volume-control {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: center;
    max-width: 400px;
    margin: 0 auto;
}

.volume-label {
    font-size: 0.9rem;
    color: var(--text-color);
    opacity: 0.7;
    min-width: 40px;
}

.master-volume-slider {
    flex: 1;
    height: 8px;
    background: #E2E8F0;
    border-radius: 4px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.master-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.master-volume-slider::-webkit-slider-thumb:hover {
    background: var(--accent-color);
    transform: scale(1.1);
}

/* Audio Grid */
.audio-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 2rem;
}

/* Audio Cards */
.audio-card {
    background: var(--card-background);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
}

.audio-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.audio-card.playing {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* Card Colors */
.light-rain-card {
    background: linear-gradient(135deg, var(--light-rain-color), rgba(155, 181, 255, 0.8));
}

.heavy-rain-card {
    background: linear-gradient(135deg, var(--heavy-rain-color), rgba(107, 142, 255, 0.8));
}

.sea-waves-card {
    background: linear-gradient(135deg, var(--sea-waves-color), rgba(77, 208, 225, 0.8));
}

.industrial-hum-card {
    background: linear-gradient(135deg, var(--industrial-hum-color), rgba(255, 183, 77, 0.8));
}

.card-header {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.audio-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.audio-icon svg {
    width: 24px;
    height: 24px;
}

.card-content {
    flex: 1;
}

.audio-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    margin-bottom: 0.5rem;
}

.audio-description {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 1rem;
    line-height: 1.4;
}

.volume-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.9);
}

.volume-percent {
    font-weight: 600;
}

.volume-slider {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

/* Quick Controls Panel */
.quick-controls-panel {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    padding: var(--padding);
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
}

.presets-section {
    margin-bottom: 2rem;
}

.control-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 1.5rem;
}

/* Preset Buttons */
.preset-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.preset-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 14px 20px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 500;
    width: 100%;
    justify-content: flex-start;
    padding-left: 30px;
}

.deep-focus-preset {
    background: #6B8EFF;
    color: white;
}

.relaxation-preset {
    background: #5DADE2;
    color: white;
}

.sleep-preset {
    background: #4FD1C7;
    color: white;
}

.urban-preset {
    background: #E8F4F8;
    color: #5DADE2;
}

.preset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.preset-btn svg {
    width: 18px;
    height: 18px;
}

/* Timer Section */
.timer-section {
    text-align: center;
}

.timer-selector {
    margin-bottom: 1rem;
}

.timer-dropdown {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid #E8F4F8;
    border-radius: 25px;
    background: white;
    font-size: 1rem;
    color: var(--text-color);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
}

.timer-dropdown:focus {
    outline: none;
    border-color: var(--primary-color);
}

.start-timer-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 12px 24px;
    background: #F8F9FA;
    color: var(--text-color);
    border: 2px solid #E8F4F8;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 500;
    width: 100%;
    margin: 0 auto;
}

.start-timer-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.start-timer-btn svg {
    width: 16px;
    height: 16px;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        background: url('/static/images/soundscape-mobile.jpg');
        background-size: cover;
        background-position: center;
        background-attachment: fixed;
        padding: 15px;
    }
    
    .navbar {
        padding: 0.75rem 1rem;
    }
    
    .navbar-nav {
        gap: 1.5rem;
        flex-wrap: wrap;
        justify-content: flex-start;
        margin-left: 0;
    }
    
    .nav-link {
        font-size: 0.85rem;
        padding: 0.4rem 0;
    }
    
    .footer {
        padding: 0.3rem 0.75rem;
    }
    
    .footer-nav {
        gap: 1rem;
    }
    
    .footer-tagline {
        font-size: 0.8rem;
    }
    
    .footer-content {
        gap: 0.25rem;
    }
    
    .footer-branding {
        gap: 0.05rem;
    }
    
    .app-title {
        font-size: 2.5rem;
    }
    
    .audio-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .preset-buttons {
        gap: 0.5rem;
    }
    
    .preset-btn {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
    
    .card-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 10px;
    }
    
    .audio-icon {
        margin: 0 auto;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .app-title {
        font-size: 2rem;
    }
    
    .audio-card {
        padding: 15px;
    }
    
    .main-panel, .quick-controls-panel {
        padding: 15px;
    }
    
    .master-volume-control {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .volume-label {
        min-width: auto;
    }
}

/* Loading States */
.audio-card.loading {
    opacity: 0.7;
    pointer-events: none;
}

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

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

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.audio-card {
    animation: fadeIn 0.5s ease forwards;
}

.audio-card:nth-child(1) { animation-delay: 0.1s; }
.audio-card:nth-child(2) { animation-delay: 0.2s; }
.audio-card:nth-child(3) { animation-delay: 0.3s; }
.audio-card:nth-child(4) { animation-delay: 0.4s; }

/* Footer */
.footer {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding: 0.5rem 1rem;
    margin-top: 0.5rem;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.3rem;
    max-width: 600px;
    margin: 0 auto;
}

.footer-branding {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-logo-img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.footer-powered {
    color: #6B73FF;
    font-size: 0.95rem;
    font-weight: 500;
}

.brand-name {
    font-weight: 600;
    color: #6B73FF;
}

.footer-tagline {
    color: #64748B;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
    max-width: 400px;
}

.footer-nav {
    display: flex;
    gap: 2rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-nav a {
    color: #64748B;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.footer-nav a:hover {
    color: var(--primary-color);
}

.footer-advertising {
    color: #64748B;
    font-size: 0.85rem;
}

.contact-link {
    color: #6B73FF;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.contact-link:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* Page Styles */
.page-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 2rem;
}

.page-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 2.5rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.page-subtitle {
    font-weight: 300;
    font-size: 1.1rem;
    color: var(--text-color);
    opacity: 0.7;
    margin-bottom: 2rem;
}

.setup-section, .about-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.setup-section h3, .about-section h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.setup-section h3 svg, .about-section h3 svg {
    width: 20px;
    height: 20px;
}

.setup-section p, .about-section p {
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
}

.btn-primary {
    background: var(--primary-color);
    border: none;
    border-radius: 25px;
    padding: 12px 24px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(107, 115, 255, 0.3);
}

.btn-primary svg {
    width: 16px;
    height: 16px;
}

/* Contact Page Styles */
.contact-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.contact-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.contact-section h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.contact-section h3 svg {
    width: 20px;
    height: 20px;
}

.contact-info {
    margin-top: 1rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.contact-icon {
    width: 20px;
    height: 20px;
    color: var(--primary-color);
    flex-shrink: 0;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
    flex: 1;
}

.contact-email {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 1.1rem;
    word-break: break-all;
    overflow-wrap: break-word;
}

.contact-email:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

.help-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.help-list li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: var(--text-color);
    line-height: 1.5;
}

.help-list li:before {
    content: "•";
    color: var(--primary-color);
    font-weight: bold;
    position: absolute;
    left: 0;
}