:root {
    /* Light Mode Colors */
    --bg-color: #f8f9fa;
    --text-color: #343a40;
    --primary-color: #6c757d;
    --secondary-color: #ced4da;
    --accent-color: #007bff;
    --inhale-color: #66d9e8;
    --hold-color: #74c0fc;
    --exhale-color: #91a7ff;
    --container-bg: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --ad-bg: #e9ecef;
    
    /* Pixel Art Dog Colors */
    --dog-brown: #8b5a2b;
    --dog-light: #d2b48c;
    --dog-dark: #5d3a1a;
}

body.dark-mode {
    /* Dark Mode Colors */
    --bg-color: #1a1b1e;
    --text-color: #e9ecef;
    --primary-color: #adb5bd;
    --secondary-color: #495057;
    --accent-color: #339af0;
    --inhale-color: #3bc9db;
    --hold-color: #4dabf7;
    --exhale-color: #748ffc;
    --container-bg: #25262b;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    --ad-bg: #2c2e33;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
    min-height: 100vh;
}

header {
    background-color: var(--container-bg);
    box-shadow: var(--shadow);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent-color);
    letter-spacing: -0.5px;
}

#theme-button {
    padding: 0.5rem 1rem;
    cursor: pointer;
    border: 1px solid var(--secondary-color);
    background: transparent;
    color: var(--text-color);
    border-radius: 20px;
    font-size: 0.875rem;
    transition: all 0.2s;
}

#theme-button:hover {
    background: var(--secondary-color);
}

main {
    max-width: 900px;
    margin: 1.5rem auto;
    padding: 0 1rem;
}

.ad-container {
    background-color: var(--ad-bg);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    min-height: 90px;
}

.breathing-container {
    background-color: var(--container-bg);
    border-radius: 16px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.breathing-layout {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.visualizer-side, .character-side {
    flex: 1;
    min-width: 250px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.visualizer-wrapper {
    position: relative;
    width: 220px;
    height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.visualizer {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--inhale-color);
    opacity: 0.2;
    transition: transform 0.1s linear, background-color 0.5s ease;
    transform: scale(0.4);
}

.status-text {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    z-index: 10;
}

.timer-text {
    font-size: 2.5rem;
    font-weight: 800;
    z-index: 10;
}

/* Pixel Art Dog Styling */
.pixel-dog-container {
    width: 200px;
    height: 200px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    image-rendering: pixelated;
}

.dog-pixel-art {
    width: 128px;
    height: 128px;
    position: relative;
    transition: transform 0.5s ease;
}

.dog-body {
    position: absolute;
    bottom: 20px;
    left: 24px;
    width: 80px;
    height: 60px;
    background: var(--dog-brown);
    box-shadow: 
        10px 0 0 var(--dog-brown),
        -10px 0 0 var(--dog-brown);
}

.dog-head {
    position: absolute;
    top: 20px;
    left: 34px;
    width: 60px;
    height: 50px;
    background: var(--dog-brown);
    box-shadow: 
        5px 5px 0 var(--dog-light),
        -5px 5px 0 var(--dog-brown);
}

.dog-ears {
    position: absolute;
    top: 10px;
    left: 24px;
    width: 20px;
    height: 30px;
    background: var(--dog-dark);
    box-shadow: 60px 0 0 var(--dog-dark);
}

.dog-eyes {
    position: absolute;
    top: 35px;
    left: 45px;
    width: 8px;
    height: 8px;
    background: #000;
    box-shadow: 25px 0 0 #000;
}

.dog-nose {
    position: absolute;
    top: 50px;
    left: 60px;
    width: 10px;
    height: 8px;
    background: #000;
}

.dog-mouth {
    position: absolute;
    top: 60px;
    left: 58px;
    width: 14px;
    height: 4px;
    background: #000;
}

/* Breathing Poses */
.inhale-pose { transform: scale(1.1) translateY(-10px); }
.hold-pose { transform: scale(1.1); }
.exhale-pose { transform: scale(1); translateY(5px); }

/* Controls & Info */
.controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.main-btn, .secondary-btn {
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
}

.main-btn {
    background-color: var(--accent-color);
    color: white;
}

.secondary-btn {
    background-color: var(--secondary-color);
    color: var(--text-color);
}

.cycle-info {
    font-weight: 600;
    color: var(--primary-color);
}

.hidden { display: none; }

.info-section {
    background-color: var(--container-bg);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: var(--shadow);
}

.info-section h2 { margin-bottom: 2rem; }

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.step { text-align: center; }

.step-num {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

footer {
    text-align: center;
    padding: 3rem 0;
    color: var(--primary-color);
}

@media (max-width: 600px) {
    .breathing-layout {
        flex-direction: column;
    }
}
