/* --- Shared Container Styles --- */
.noise-generator-container,
.breathing-exercise-container {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 20px 30px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 800px;
    margin: 20px auto;
    text-align: center;
}

.control-button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 1em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.control-button:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* --- Noise Generator Styles --- */

#master-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 25px;
}

#master-controls label {
    font-weight: bold;
}

#master-volume {
    width: 200px;
}

#master-controls .control-button {
    border-radius: 50%;
    width: 40px;
    height: 40px;
}

.timer-control-group {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0,0,0,0.2);
    padding: 5px 10px;
    border-radius: 8px;
}

.timer-checkbox {
    transform: scale(1.2);
    cursor: pointer;
}

.timer-input {
    width: 60px;
    padding: 5px;
    border-radius: 5px;
    border: 1px solid #555;
    background-color: #333;
    color: #fff;
    text-align: center;
    margin-left: 5px;
}

.timer-display {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.1em;
    color: #a2d2ff;
    display: none; /* Hidden by default */
}

.sound-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 25px;
    justify-items: center;
}

.sound-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.sound-icon {
    font-size: 2.5em;
    color: #ccc;
    cursor: pointer;
    transition: color 0.3s, transform 0.3s, border-color 0.3s;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid transparent;
    border-radius: 50%;
}

.sound-icon:hover {
    color: #fff;
}

.sound-icon.active {
    color: #3498db; /* Blue for active */
    border-color: #3498db;
    transform: scale(1.1);
}

.sound-label {
    font-size: 0.9em;
    transition: color 0.3s;
}

.sound-item.active .sound-label {
    color: #3498db;
    font-weight: bold;
}

.volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 5px;
    background: #555;
    border-radius: 5px;
    outline: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s, visibility .2s;
    cursor: pointer;
}

.volume-slider:hover {
    opacity: 1;
}

.sound-item.active .volume-slider {
    opacity: 0.7;
    visibility: visible;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 15px;
    height: 15px;
    background: #3498db;
    cursor: pointer;
    border-radius: 50%;
}

.volume-slider::-moz-range-thumb {
    width: 15px;
    height: 15px;
    background: #3498db;
    cursor: pointer;
    border-radius: 50%;
}

/* --- Breathing Exercise Styles --- */

.breathing-exercise-container h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.8em;
    color: #fff;
}

.breathing-visualizer {
    position: relative;
    width: 150px;
    height: 150px;
    margin: 50px auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.breathing-circle {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: rgba(155, 89, 182, 0.5); /* Purple for exhale state */
    transition: transform 4s ease-in-out, background-color 1s;
    transform: scale(0.5);
}

.breathing-visualizer #breathing-status {
    position: absolute;
    color: #fff;
    font-size: 1.2em;
    font-weight: bold;
}

.breathing-countdown {
    position: absolute;
    top: -30px;
    font-size: 1.2em;
    font-family: 'Courier New', Courier, monospace;
    color: #bde0fe;
    display: none; /* Hidden by default */
}

.breathing-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
}

.breathing-main-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

.breathing-controls .control-button {
    padding: 10px 15px;
    border-radius: 8px;
    flex-shrink: 0; /* Prevent buttons from shrinking */
}

#breathing-mute-button {
    border-radius: 50%;
    width: 40px;
    height: 40px;
    padding: 0;
}

#breathing-start-stop {
    min-width: 85px;
    text-align: center;
}

.breathing-volume-slider {
    width: 120px;
    opacity: 0.7;
    visibility: visible;
    margin: 0 10px;
}

.or-text {
    color: #ccc;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-group label {
    font-size: 0.9em;
}

.control-group input {
    width: 80px;
    padding: 8px;
    border-radius: 5px;
    border: 1px solid #555;
    background-color: #333;
    color: #fff;
    text-align: center;
}

.breathing-description {
    margin-top: 15px;
    font-size: 0.9em;
    color: #ccc;
}

/* --- Responsive Styles --- */
@media (max-width: 680px) {
    .breathing-controls {
        flex-direction: column;
        width: 100%;
        align-items: center;
        gap: 15px;
    }

    .control-group {
        width: 100%;
        max-width: 280px;
        justify-content: space-between; /* Pushes label and input apart */
    }

    .or-text {
        align-self: center; /* Center the 'or' text */
    }

    .breathing-main-controls {
        justify-content: center;
    }

    .breathing-volume-slider {
        width: 100px;
    }
}

@media (max-width: 480px) {
    .sound-controls {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    .sound-icon {
        font-size: 2.2em;
        width: 55px;
        height: 55px;
    }
    .sound-label {
        font-size: 0.85em;
    }
}