:root {
    --bg-color: #0d0d0d;
    --card-bg: #1a1a1a;
    --accent-color: #4B7BFF;
    --text-main: #ffffff;
    --text-muted: #888888;
    --danger-color: #E74C3C;
    --danger-hover: #C0392B;
    --font-family: 'Roboto', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: radial-gradient(circle at 50% 10%, #1a1a1a 0%, var(--bg-color) 80%);
    color: var(--text-main);
    font-family: var(--font-family);
    min-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #0d0d0d;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Header */
.header {
    padding: 2rem 2rem 1rem;
    background: linear-gradient(to bottom, rgba(13, 13, 13, 1) 0%, rgba(13, 13, 13, 0) 100%);
    z-index: 10;
}

.title {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.subtitle {
    color: var(--text-muted);
    margin-top: 0.5rem;
    font-size: 1rem;
}

/* Main Grid */
.tracks-grid {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 2rem;
    align-content: flex-start;
}

/* Track Card */
.track-card {
    background-color: var(--card-bg);
    border-radius: 20px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 2px solid transparent;
    /* Reserve space for border */
    transition: all 0.3s ease;
    user-select: none;
}

.track-card:hover {
    background-color: #252525;
    transform: translateY(-2px);
}

.track-card.active {
    border-color: var(--accent-color);
    background-color: #1F2229;
    box-shadow: 0 4px 20px rgba(75, 123, 255, 0.15);
}

.image-container {
    width: 180px;
    height: 180px;
    margin-bottom: 1rem;
    border-radius: 30px;
    /* Rounded corners, larger size */
    overflow: hidden;
    position: relative;
    cursor: pointer;
}

.track-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.5s ease;
}

.track-card:hover .track-image {
    transform: scale(1.05);
}

.track-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    transition: color 0.3s ease;
    cursor: pointer;
}

.track-card.active .track-name {
    color: var(--accent-color);
}

/* Volume Slider */
.volume-slider {
    width: 100%;
    height: 6px;
    appearance: none;
    -webkit-appearance: none;
    background: #444;
    border-radius: 3px;
    outline: none;
    margin-top: 1rem;
    touch-action: none;
    /* Prevents scroll interference on iOS */
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--text-muted);
    cursor: pointer;
    transition: background 0.2s;
}

.track-card.active .volume-slider::-webkit-slider-thumb {
    background: var(--accent-color);
}

.track-card.active .volume-slider {
    background: rgba(75, 123, 255, 0.3);
}

/* Footer */
.footer {
    background-color: #111;
    padding: 1.5rem 2rem;
    border-top: 1px solid #222;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.stop-btn {
    background-color: var(--danger-color);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.3s;
}

.stop-btn:hover {
    background-color: var(--danger-hover);
}

.master-volume-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.master-volume-container label {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-muted);
}

#master-volume {
    width: 200px;
    height: 6px;
    appearance: none;
    -webkit-appearance: none;
    background: #444;
    border-radius: 3px;
}

#master-volume::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
}

/* --- Navigation & Relax Mode --- */

.nav-link {
    text-decoration: none;
    color: var(--accent-color);
    font-weight: bold;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--accent-color);
    border-radius: 20px;
    transition: all 0.3s ease;
    margin-left: auto;
    /* Push to right in header flex */
}

.nav-link:hover {
    background-color: var(--accent-color);
    color: white;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.header-titles {
    flex: 1;
}

.nav-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Relax Page Specifics */
.relax-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.breathing-circle {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(75, 123, 255, 0.4) 0%, rgba(75, 123, 255, 0.1) 70%);
    /* Increased opacity */
    border: 4px solid rgba(75, 123, 255, 0.8);
    /* Thicker, more visible border */
    display: flex;
    flex-direction: column;
    /* Stack text and timer */
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    /* Explicit gap between text items */
    box-shadow: 0 0 60px rgba(75, 123, 255, 0.3);
    /* Stronger glow */
    transition: all 0.5s ease-in-out;
    transform: scale(1);
    position: relative;
    z-index: 5;
    /* Ensure visibility */
}

.timer-text {
    font-size: 1.5rem;
    /* Larger timer */
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
}

/* Active Animation States and Colors */
.breathing-circle.grow.inhale-state {
    transform: scale(1.5);
    background: radial-gradient(circle, rgba(75, 123, 255, 0.4) 0%, rgba(75, 123, 255, 0) 80%);
    box-shadow: 0 0 80px rgba(75, 123, 255, 0.3);
    border-color: #4B7BFF;
    /* Blue */
    transition: transform 4s ease-in-out, background 4s ease-in-out, box-shadow 4s ease-in-out, border-color 4s ease-in-out;
}

.breathing-circle.grow.hold-state {
    transform: scale(1.5);
    /* Stay grown */
    background: radial-gradient(circle, rgba(157, 70, 255, 0.4) 0%, rgba(157, 70, 255, 0) 80%);
    /* Purple */
    box-shadow: 0 0 80px rgba(157, 70, 255, 0.3);
    border-color: #9D46FF;
    transition: transform 4s ease-in-out, background 4s ease-in-out, box-shadow 4s ease-in-out, border-color 4s ease-in-out;
}

.breathing-circle.shrink.exhale-state {
    transform: scale(1);
    background: radial-gradient(circle, rgba(0, 229, 255, 0.2) 0%, rgba(0, 229, 255, 0) 70%);
    /* Cyan */
    box-shadow: 0 0 50px rgba(0, 229, 255, 0.1);
    border-color: #00E5FF;
    transition: transform 4s ease-in-out, background 4s ease-in-out, box-shadow 4s ease-in-out, border-color 4s ease-in-out;
}

/* Instruction Overlay */
.instruction-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    /* Dark overlay */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    transition: opacity 0.5s ease;
}

.instruction-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

.instruction-card {
    text-align: center;
    max-width: 80%;
}

.instruction-card h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, #4B7BFF, #9D46FF);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.highlight-text {
    font-size: 1.2rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    color: var(--text-muted);
}

.highlight-text span {
    font-weight: bold;
    color: white;
}

.inhale-text {
    color: #4B7BFF !important;
}

.hold-text {
    color: #9D46FF !important;
}

.exhale-text {
    color: #00E5FF !important;
}

.start-btn {
    background: white;
    color: black;
    border: none;
    padding: 1rem 3rem;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.start-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.hidden {
    display: none !important;
}

.breath-text {
    font-size: 2.5rem;
    /* Larger, dominant text */
    color: white;
    font-weight: 700;
    pointer-events: none;
    z-index: 2;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.centered-footer {
    justify-content: center;
}

.nav-btn {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.9rem;
    padding: 0.6rem 1.5rem;
    border: 1px solid var(--text-muted);
    border-radius: 30px;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: inline-flex;
    justify-content: center;
}

.nav-btn:hover {
    color: white;
    border-color: white;
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(255, 255, 255, 0.1);
}

/* --- Playground Specifics --- */
.playground-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.project-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 2rem;
    text-decoration: none;
    color: var(--text-main);
    transition: all 0.3s ease;
    border: 1px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.project-card:hover {
    transform: translateY(-5px);
    background: #252525;
    border-color: var(--accent-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.project-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    transition: transform 0.3s ease;
}

.project-card:hover .project-icon {
    transform: scale(1.1) rotate(5deg);
}

.project-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--accent-color);
}

.project-desc {
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 1rem;
}

.flag-icon {
    height: 0.7em;
    vertical-align: middle;
    margin: 0 0.1em;
    border-radius: 4px;
}

/* --- Dynamic Entrance Animations --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.track-card,
.project-card {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
    /* Star invisible */
}

/* Staggered Delays for Grid Items (up to 10) */
.track-card:nth-child(1),
.project-card:nth-child(1) {
    animation-delay: 0.1s;
}

.track-card:nth-child(2),
.project-card:nth-child(2) {
    animation-delay: 0.2s;
}

.track-card:nth-child(3),
.project-card:nth-child(3) {
    animation-delay: 0.3s;
}

.track-card:nth-child(4),
.project-card:nth-child(4) {
    animation-delay: 0.4s;
}

.track-card:nth-child(5),
.project-card:nth-child(5) {
    animation-delay: 0.5s;
}

.track-card:nth-child(6),
.project-card:nth-child(6) {
    animation-delay: 0.6s;
}

.track-card:nth-child(7),
.project-card:nth-child(7) {
    animation-delay: 0.7s;
}

.track-card:nth-child(8),
.project-card:nth-child(8) {
    animation-delay: 0.8s;
}

.track-card:nth-child(9),
.project-card:nth-child(9) {
    animation-delay: 0.9s;
}

.track-card:nth-child(10),
.project-card:nth-child(10) {
    animation-delay: 1.0s;
}

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
    .header {
        padding: 1rem;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1.5rem;
    }

    .nav-actions {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .nav-link, .nav-btn {
        margin-left: 0;
        width: auto;
        flex: 1;
        min-width: 120px;
        text-align: center;
    }

    /* Grids */
    .tracks-grid,
    .playground-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        /* Smaller cards */
        gap: 1rem;
        padding: 1rem;
    }

    /* Adjust Card Sizes */
    .track-card,
    .project-card {
        padding: 1rem;
    }

    .image-container {
        width: 140px;
        height: 140px;
    }

    .project-icon {
        font-size: 3rem;
    }

    /* Footer */
    .footer-content {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 1.5rem;
    }

    .master-volume-container {
        width: 100%;
        justify-content: center;
    }

    #master-volume {
        width: 100%;
        /* Full width slider */
        height: 12px;
        /* Thicker for touch */
    }

    /* Volume Sliders Thicker for Touch */
    .volume-slider {
        height: 10px;
    }

    .volume-slider::-webkit-slider-thumb {
        width: 24px;
        height: 24px;
    }

    /* Breathing Circle */
    .breathing-circle {
        width: 250px;
        height: 250px;
    }

    .instruction-card h2 {
        font-size: 1.8rem;
    }
}

/* Sound Selector */
.sound-selector-container {
    width: 100%;
    margin-bottom: 0.8rem;
    /* Space between image and title/select */
    margin-top: -0.5rem;
    /* Pull up slightly closer to image */
    display: flex;
    justify-content: center;
    z-index: 5;
}

.sound-select {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    border: 1px solid transparent;
    padding: 0.2rem 0.8rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-family: inherit;
    outline: none;
    cursor: pointer;
    transition: all 0.2s ease;
    max-width: 100%;
    text-align: center;
    backdrop-filter: blur(5px);
}

.sound-select:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
}

.track-card.active .sound-select {
    color: rgba(255, 255, 255, 0.9);
    background-color: rgba(75, 123, 255, 0.2);
    border-color: rgba(75, 123, 255, 0.5);
}

.sound-select option {
    background-color: #222;
    color: white;
}
.footer-logo {
    height: 18px;
    width: auto;
    opacity: 0.8;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.footer-logo:hover {
    opacity: 1;
    transform: scale(1.05);
}

.footer-copyright {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}
.main-logo {
    width: 140px;
    height: auto;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.2));
    transition: transform 0.4s ease, filter 0.4s ease;
    cursor: default;
}

.main-logo:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 35px rgba(255, 255, 255, 0.4));
}


