/**
 * MI Strumenti Plugin Styles
 * Professional meditation tools styling
 */

/* ===========================
   COMMON STYLES
   =========================== */
.mi-timer-container,
.mi-sounds-container,
.mi-breath-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 40px;
    background: var(--mi-white, #ffffff);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.mi-btn {
    display: inline-block;
    padding: 12px 28px;
    font-family: 'Lato', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    border: 2px solid;
    border-radius: 30px;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-transform: uppercase;
}

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

.mi-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.mi-btn-primary {
    background: #c9a96e;
    border-color: #c9a96e;
    color: white;
}

.mi-btn-primary:hover {
    background: #b89454;
    border-color: #b89454;
}

.mi-setting-group {
    margin-bottom: 20px;
}

.mi-setting-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #2d3e50;
}

.mi-setting-group input[type="number"],
.mi-setting-group select {
    width: 100%;
    padding: 10px;
    border: 2px solid #e5e1d8;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.mi-setting-group input[type="number"]:focus,
.mi-setting-group select:focus {
    outline: none;
    border-color: #c9a96e;
}

/* ===========================
   TIMER STYLES
   =========================== */
.mi-timer-presets,
.mi-sounds-presets,
.mi-breath-presets {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e1d8;
}

.mi-preset-select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e5e1d8;
    border-radius: 6px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
}

.mi-timer-settings {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.mi-timer-display {
    text-align: center;
    margin: 60px 0;
}

.mi-timer-circle {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 0 auto 30px;
}

.mi-timer-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.mi-timer-circle-bg {
    fill: none;
    stroke: #f7f4ef;
    stroke-width: 8;
}

.mi-timer-circle-progress {
    fill: none;
    stroke: #c9a96e;
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 565.48;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear;
}

.mi-timer-time {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Cinzel', serif;
    font-size: 4rem;
    font-weight: 600;
    color: #2d3e50;
}

.mi-timer-status {
    font-size: 1.2rem;
    color: #7c8b7f;
    font-style: italic;
}

.mi-timer-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
}

.mi-timer-fullscreen {
    background: transparent;
    border: 2px solid #e5e1d8;
    color: #7c8b7f;
    font-size: 1.5rem;
    padding: 8px 16px;
}

/* Fullscreen Mode */
.mi-timer-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    max-width: none;
    margin: 0;
    border-radius: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: linear-gradient(135deg, #f7f4ef 0%, #e5e1d8 100%);
}

/* ===========================
   SOUNDS MIXER STYLES
   =========================== */
.mi-sounds-master {
    background: #f7f4ef;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.mi-master-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.mi-master-volume {
    margin-bottom: 20px;
}

.mi-master-volume label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #2d3e50;
}

.mi-master-volume-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e5e1d8;
    outline: none;
    -webkit-appearance: none;
}

.mi-master-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #c9a96e;
    cursor: pointer;
}

.mi-master-volume-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #c9a96e;
    cursor: pointer;
    border: none;
}

.mi-sounds-timer,
.mi-sounds-fade {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.mi-sounds-channels {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.mi-sound-channel {
    background: white;
    border: 2px solid #e5e1d8;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s;
}

.mi-sound-channel.active {
    border-color: #c9a96e;
    background: #f7f4ef;
}

.mi-channel-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.mi-channel-toggle {
    width: 40px;
    height: 40px;
    border: 2px solid #e5e1d8;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    font-size: 1.5rem;
    transition: all 0.3s;
}

.mi-sound-channel.active .mi-channel-toggle {
    background: #c9a96e;
    border-color: #c9a96e;
    color: white;
}

.mi-channel-toggle .mi-toggle-icon:before {
    content: '○';
}

.mi-sound-channel.active .mi-channel-toggle .mi-toggle-icon:before {
    content: '●';
}

.mi-channel-name {
    margin: 0;
    font-size: 1.1rem;
    color: #2d3e50;
}

.mi-channel-controls {
    opacity: 0.5;
    pointer-events: none;
    transition: opacity 0.3s;
}

.mi-sound-channel.active .mi-channel-controls {
    opacity: 1;
    pointer-events: auto;
}

.mi-channel-volume-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: #7c8b7f;
}

.mi-channel-volume {
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: #e5e1d8;
    outline: none;
    -webkit-appearance: none;
}

.mi-channel-volume::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #c9a96e;
    cursor: pointer;
}

.mi-channel-volume::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #c9a96e;
    cursor: pointer;
    border: none;
}

/* ===========================
   BREATH TRAINER STYLES
   =========================== */
.mi-breath-custom {
    background: #f7f4ef;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.mi-custom-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.mi-breath-settings {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.mi-breath-visual {
    text-align: center;
    margin: 60px 0;
}

.mi-breath-circle {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 0 auto 40px;
}

.mi-breath-svg {
    width: 100%;
    height: 100%;
}

.mi-breath-circle-animated {
    transition: r 1s ease-in-out;
}

.mi-breath-instruction {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.mi-breath-phase {
    font-family: 'Cinzel', serif;
    font-size: 2rem;
    font-weight: 600;
    color: #2d3e50;
    margin-bottom: 10px;
}

.mi-breath-counter {
    font-size: 4rem;
    font-weight: 700;
    color: #c9a96e;
}

.mi-breath-progress {
    width: 100%;
    height: 8px;
    background: #e5e1d8;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 30px;
}

.mi-breath-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #c9a96e, #b89454);
    transition: width 0.3s ease;
}

.mi-breath-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 30px;
}

.mi-breath-stat {
    text-align: center;
}

.mi-stat-label {
    display: block;
    font-size: 0.9rem;
    color: #7c8b7f;
    margin-bottom: 5px;
}

.mi-stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d3e50;
}

.mi-breath-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

/* ===========================
   SAVE PRESET
   =========================== */
.mi-timer-save-preset,
.mi-sounds-save-preset,
.mi-breath-save-preset {
    display: flex;
    gap: 10px;
    padding-top: 30px;
    border-top: 1px solid #e5e1d8;
}

.mi-preset-name-input {
    flex: 1;
    padding: 12px;
    border: 2px solid #e5e1d8;
    border-radius: 6px;
    font-size: 1rem;
}

.mi-preset-name-input:focus {
    outline: none;
    border-color: #c9a96e;
}

/* ===========================
   ANIMATIONS
   =========================== */
@keyframes breatheIn {
    to {
        r: 120;
        opacity: 0.8;
    }
}

@keyframes breatheOut {
    to {
        r: 50;
        opacity: 1;
    }
}

.mi-breath-circle-animated.inhaling {
    animation: breatheIn 4s ease-in-out;
}

.mi-breath-circle-animated.exhaling {
    animation: breatheOut 4s ease-in-out;
}

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 768px) {
    .mi-timer-container,
    .mi-sounds-container,
    .mi-breath-container {
        padding: 25px;
        margin: 20px;
    }
    
    .mi-timer-settings,
    .mi-breath-settings {
        grid-template-columns: 1fr;
    }
    
    .mi-timer-circle,
    .mi-breath-circle {
        width: 250px;
        height: 250px;
    }
    
    .mi-timer-time {
        font-size: 3rem;
    }
    
    .mi-sounds-channels {
        grid-template-columns: 1fr;
    }
    
    .mi-breath-stats {
        flex-direction: column;
        gap: 20px;
    }
}
