/* Base Styles */
:root {
    --primary-color: #3a7bd5;
    --secondary-color: #00d2ff;
    --text-color: #333;
    --light-text: #fff;
    --background-color: #f5f9ff;
    --card-bg: #ffffff;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    --transition-speed: 0.3s;
    --breathing-duration: 4s;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 2s ease;
}

.app-container {
    width: 100%;
    max-width: 500px;
    background-color: var(--card-bg);
    border-radius: 20px;
    box-shadow: var(--shadow);
    overflow: hidden;
    margin: 20px;
}

header {
    text-align: center;
    padding: 30px 20px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    color: var(--light-text);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 5px;
}

main {
    padding: 20px;
}

/* Setup Screen */
.setup-screen {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.setup-section {
    margin-bottom: 10px;
}

.setup-section h2 {
    margin-bottom: 15px;
    font-size: 1.3rem;
    color: var(--primary-color);
}

.theme-options,
.duration-options,
.sound-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.theme-btn,
.duration-btn,
.sound-btn {
    padding: 12px 20px;
    border: 2px solid var(--primary-color);
    background-color: transparent;
    color: var(--primary-color);
    border-radius: 30px;
    cursor: pointer;
    font-size: 1rem;
    transition: all var(--transition-speed);
    flex: 1;
    min-width: 80px;
    text-align: center;
}

.theme-btn:hover,
.duration-btn:hover,
.sound-btn:hover {
    background-color: rgba(58, 123, 213, 0.1);
}

.theme-btn.active,
.duration-btn.active,
.sound-btn.active {
    background-color: var(--primary-color);
    color: white;
}

.start-btn {
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 15px;
    border-radius: 30px;
    font-size: 1.2rem;
    cursor: pointer;
    width: 100%;
    margin-top: 20px;
    transition: transform var(--transition-speed);
}

.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Meditation Screen */
.meditation-screen {
    text-align: center;
    padding: 20px 0;
}

.timer-display {
    font-size: 3rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 30px;
}

.breathing-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 250px;
    margin-bottom: 30px;
}

.breathing-circle {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 1.5rem;
    box-shadow: 0 0 30px rgba(58, 123, 213, 0.5);
    transition: transform var(--breathing-duration) ease-in-out;
}

.breathing-circle.inhale {
    transform: scale(1.3);
    animation: inhale var(--breathing-duration) ease-in-out;
}

.breathing-circle.exhale {
    transform: scale(1);
    animation: exhale var(--breathing-duration) ease-in-out;
}

@keyframes inhale {
    from { transform: scale(1); }
    to { transform: scale(1.3); }
}

@keyframes exhale {
    from { transform: scale(1.3); }
    to { transform: scale(1); }
}

.progress-container {
    width: 100%;
    height: 10px;
    background-color: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 30px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    width: 0%;
    transition: width 1s linear;
}

.end-btn {
    background-color: #f5f5f5;
    color: var(--text-color);
    border: 1px solid #ddd;
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.end-btn:hover {
    background-color: #e0e0e0;
}

/* Completion Screen */
.completion-screen {
    text-align: center;
    padding: 40px 20px;
}

.completion-screen h2 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.completion-screen p {
    margin-bottom: 30px;
    font-size: 1.2rem;
}

.completion-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn {
    padding: 12px 25px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 1rem;
    transition: all var(--transition-speed);
}

#newSessionButton {
    background-color: var(--primary-color);
    color: white;
    border: none;
}

#repeatSessionButton {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

#newSessionButton:hover {
    background-color: #2a6ac0;
}

#repeatSessionButton:hover {
    background-color: rgba(58, 123, 213, 0.1);
}

/* Utility Classes */
.hidden {
    display: none;
}

/* Theme-specific styles */
body.focus-theme {
    background: linear-gradient(135deg, #3a7bd5, #00d2ff);
}

body.relax-theme {
    background: linear-gradient(135deg, #8360c3, #2ebf91);
}

body.sleep-theme {
    background: linear-gradient(135deg, #141e30, #243b55);
}

/* Responsive Design */
@media (max-width: 480px) {
    .app-container {
        margin: 10px;
        border-radius: 15px;
    }
    
    header {
        padding: 20px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .breathing-container {
        height: 200px;
    }
    
    .breathing-circle {
        width: 150px;
        height: 150px;
        font-size: 1.2rem;
    }
    
    .timer-display {
        font-size: 2.5rem;
    }
}