/* 呼吸练习插件样式 */


/* 暗黑模式 */
.dark .breath-modal-content{
     background:var(--color-grey-600);
}

.dark .duration-input-wrapper{
     background:var(--color-grey-600);
     border: 1px solid var(--color-grey-600);
}

.dark .setup-title,
.dark .breath-modal-header h3,
.dark .duration-label,
.dark .duration-unit,
.dark .duration-input{
    color:white;
}

.dark .sound-btn,
.dark .pattern-btn,
.dark .duration-btn{
    background-color:var(--color-grey-500);
}

/* 弹窗蒙层 */
.breath-modal-mask {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
    background: rgba(0, 0, 0, 0.75);
    z-index: 100000;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    transition: background 0.5s ease-in-out, backdrop-filter 0.5s ease-in-out;
}

/* 练习模式下的蒙层 */
.breath-modal-mask.practice-mode {
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
	-webkit-backdrop-filter: blur(5px);
}

/* 练习模式下的蒙层 */
.breath-modal-mask.practice-mode {
    background: rgba(0, 0, 0, 0.75);
}

/* 弹窗内容 */
.breath-modal-content {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalFadeIn 0.3s ease-out;
    transition: background 0.5s ease-in-out, box-shadow 0.5s ease-in-out, overflow 0.5s ease-in-out;
}

/* 练习模式下的弹窗内容 */
.breath-modal-content.practice-mode {
    background: transparent;
    box-shadow: none;
    overflow: visible;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

/* 练习模式下隐藏弹窗头部 */
.breath-modal-content.practice-mode .breath-modal-header {
    display: none;
}

/* 练习模式下隐藏设置页面 */
.breath-modal-content.practice-mode .breathing-setup {
    display: none !important;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* 弹窗头部 */
.breath-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px 15px;
    /* border-bottom: 1px solid #e9ecef; */
}

.breath-modal-header h3 {
    margin: 0;
    font-size: 1.5em;
}

.breath-modal-close {
    background-color: transparent;
    color: inherit;
    border: none;
    display: inline-block;
    padding: 0 .5rem;
    margin: -.25rem -.5rem;
    font-size: 1.5rem;
    font-weight: 400;
    opacity: .5;
    line-height: 1;
    align-self: flex-start
}

.breath-modal-close:hover {
    color: var(--color-primary);
}

/* 设置页面 */
.breathing-setup {
    padding: 30px;
    text-align: center;
    min-height: 500px;
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.breathing-setup.fade-out {
    opacity: 0;
    transform: scale(0.95);
}

.breathing-setup.fade-in {
    opacity: 1;
    transform: scale(1);
}

.setup-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    /*margin-bottom: 30px;*/
}

.pattern-label {
    font-size: 1rem;
    color: #666;
    margin-bottom: 15px;
    font-weight: 500;
}

.pattern-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

/* 练习页面 */
.breathing-practice {
    padding: 30px;
    text-align: center;
    min-height: 500px;
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
    background: transparent;
    overflow: visible;
    position: relative;
    z-index: 10;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.breathing-practice.fade-out {
    opacity: 0;
    transform: scale(0.95);
}

.breathing-practice.fade-in {
    opacity: 1;
    transform: scale(1);
}

/* 统计信息 */
.breathing-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
    /*padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);*/
    width: 300px;
    margin-left: auto;
    margin-right: auto;
}

/* 练习页面的统计信息 */
.breathing-practice .breathing-stats {
    margin-top: 20px;
    margin-bottom: 40px;
}

.stat-item {
    text-align: center;
    width: 120px;
    flex: none;
}

.stat-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
    width: 80px;
    text-align: center;
    font-family: 'Courier New', monospace;
    margin: 0 auto;
}

/* 呼吸圆圈容器 */
.breathing-circle-container {
    position: relative;
    width: 100vw;
    height: 400px;
    margin: 40px 0;
    overflow: visible;
    left: 50%;
    transform: translateX(-50%);
}

.breathing-circle {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: transparent;
    transition: transform 4s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border: 4px solid rgba(255, 255, 255, 0.9);
    box-shadow: 
        0 0 30px rgba(255, 255, 255, 0.8),
        0 0 60px rgba(255, 255, 255, 0.6),
        0 0 90px rgba(255, 255, 255, 0.4);
    animation: glowPulse 3s ease-in-out infinite;
    z-index: 100;
}

@keyframes glowPulse {
    0%, 100% {
        filter: brightness(1) drop-shadow(0 0 15px rgba(255, 255, 255, 0.5));
    }
    50% {
        filter: brightness(1.3) drop-shadow(0 0 25px rgba(255, 255, 255, 0.8));
    }
}

.breathing-circle.exhale {
    transform: translate(-50%, -50%) scale(0.5);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 
        0 0 20px rgba(255, 255, 255, 0.5),
        0 0 40px rgba(255, 255, 255, 0.3),
        0 0 60px rgba(255, 255, 255, 0.2);
    transition: transform 6s ease-in-out, border-color 3s ease-in-out, border-width 3s ease-in-out, box-shadow 4s ease-in-out;
	animation: none;
}

.breathing-circle.inhale {
    transform: translate(-50%, -50%) scale(1.3);
    border-color: rgba(255, 255, 255, 1);
    border-width: 6px;
    box-shadow: 
        0 0 40px rgba(255, 255, 255, 0.9),
        0 0 80px rgba(255, 255, 255, 0.7),
        0 0 120px rgba(255, 255, 255, 0.5);
    transition: transform 5s ease-in-out, border-color 1s ease-in-out, border-width 1s ease-in-out, box-shadow 1s ease-in-out;
	animation: none;
}

.breathing-circle.hold {
    transform: translate(-50%, -50%) scale(1.3);
    border-color: rgba(255, 255, 255, 1);
    border-width: 6px;
    box-shadow: 
        0 0 35px rgba(255, 255, 255, 0.8),
        0 0 70px rgba(255, 255, 255, 0.6),
        0 0 120px rgba(255, 255, 255, 0.5);
    transition: transform 5s ease-in-out, border-color 1s ease-in-out, border-width 1s ease-in-out, box-shadow 1s ease-in-out;
    animation: none;
}

.breathing-circle.completion {
    transform: translate(-50%, -50%) scale(1.2);
    border-color: rgba(255, 215, 0, 1);
    border-width: 6px;
    box-shadow: 
        0 0 50px rgba(255, 215, 0, 0.9),
        0 0 100px rgba(255, 215, 0, 0.7),
        0 0 150px rgba(255, 215, 0, 0.5);
    animation: completionPulse 2s ease-in-out infinite;
    transition: transform 1s ease-in-out, border-color 1s ease-in-out, border-width 1s ease-in-out, box-shadow 1s ease-in-out;
}

@keyframes completionPulse {
    0%, 100% {
        filter: brightness(1) drop-shadow(0 0 20px rgba(255, 215, 0, 0.8));
    }
    50% {
        filter: brightness(1.5) drop-shadow(0 0 30px rgba(255, 215, 0, 1));
    }
}

.breathing-text {
    color: white;
    font-size: 2.5rem;
    font-weight: 300;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 101;
    text-align: center;
    width: 100%;
    transition: opacity 0.4s ease-in-out;
}



/* 呼吸指导文字 */
.breathing-instruction {
    font-size: 1.3rem;
    margin: 25px 0;
    color: white;
    font-weight: 500;
    min-height: 35px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: opacity 0.4s ease-in-out;
}

/* 控制按钮 */
.breathing-controls {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* 练习页面的按钮样式 */
.start-breathing {
    background: var(--color-primary);
    color: white;
}

.btn-danger {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    
}

.btn-secondary {
    background-color: #f8f9fa;
    color: #666;
    border: 1px solid #dee2e6;
}

.btn-secondary:hover {
    background-color: #e9ecef;
    transform: translateY(-1px);
}

/* 呼吸模式选择 */
.breathing-patterns {
    margin-top: 25px;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.pattern-btn {
    padding: 8px 16px;
    border-radius: 6px;
    background-color: var(--color-grey-40);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.pattern-btn:hover,
.pattern-btn.active {
    background-color: color-mix(in srgb, var(--color-primary), transparent 60%);
    color: white;
}

/* 练习时长设置 */
.breathing-duration {
    text-align: center;
    padding: 20px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 12px;
    /* border: 1px solid rgba(102, 126, 234, 0.1); */
    white-space: nowrap;
}

/* 音效选择设置 */
.breathing-sound {
    margin-top: 20px;
    text-align: center;
}

.sound-label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 10px;
    font-weight: 500;
}

.sound-buttons {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.sound-btn {
    padding: 6px 12px;
    border-radius: 4px;
    background-color: var(--color-grey-40);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.8rem;
}

.sound-btn:hover,
.sound-btn.active {
    color: white;
    background-color:  color-mix(in srgb, var(--color-primary), transparent 60%);
}

.duration-label {
    font-size: 1rem;
    color: #333;
    margin-bottom: 15px;
    font-weight: 600;
}

.duration-input-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.duration-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    /* border: 2px solid #e9ecef; */
    border-radius: 8px;
    padding: 4px;
    transition: all 0.3s ease;
}

.duration-input-wrapper:focus-within {
    border-color: var(--color-primary);
}

.duration-btn {
    width: 40px;
    height: 40px;
    border: none;
    background:  #f8f9fa;
    color:  var(--color-primary);
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

/*.duration-btn:hover {
    background: var(--color-primary);
    color: white;
}*/

.duration-btn:active {
    transform: scale(0.95);
}

.duration-display {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 16px;
    min-width: 80px;
    justify-content: center;
}


.duration-input {
    width: 60px;
    padding: 8px 12px;
    border: none;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    background: transparent;
}

.duration-unit {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
    padding-right: 8px;
}

.duration-input:focus {
    outline: none;
    box-shadow: 0 0px 0 var(--color-primary)  !important;
}

.duration-unit {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}



/* 会话计时器 */
.session-timer {
    margin-top: 20px;
    font-size: 1rem;
    color: #666;
}

/* 触发按钮样式 */
/* .breath-plugin-trigger {
    cursor: pointer;
    transition: all 0.2s ease;
}

.breath-plugin-trigger:hover {
    opacity: 0.8;
} */

/* 响应式设计 */
@media (max-width: 768px) {
    .breath-modal-content {
        margin: 10px;
        max-width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
    }
    
    .breathing-setup,
    .breathing-practice {
        padding: 20px;
        min-height: 400px;
    }
    
    .breathing-stats {
        flex-direction: row;
        gap: 10px;
        flex-wrap: wrap;
    }
    
    .breathing-stats .stat-item {
        flex: 1;
        min-width: 80px;
    }
    
    .breathing-stats .stat-value {
        min-width: 50px;
        font-size: 1.5rem;
    }
    
    .breathing-practice .breathing-stats {
        margin-top: 20px;
    }
    
    .breathing-circle-container {
        width: 100vw;
        height: 320px;
        overflow: visible;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .breathing-circle {
        width: 250px;
        height: 250px;
    }
    

    
    .breathing-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .breathing-patterns {
        flex-direction: column;
        align-items: center;
    }

    .duration-input-wrapper {
        max-width: 200px;
        margin: 0 auto;
    }
    
    .duration-btn {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .duration-display {
        padding: 0 12px;
        min-width: 70px;
    }
    
    .breathing-instruction {
        font-size: 1.1rem;
    }
    
    .breath-modal-header {
        padding: 15px 20px 10px;
    }
    
    .breath-modal-header h3 {
        font-size: 1.3rem;
    }
}

/* 滚动条样式 */
.breath-modal-content::-webkit-scrollbar {
    width: 6px;
}

.breath-modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.breath-modal-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.breath-modal-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 动画效果 */
@keyframes breatheIn {
    0% { transform: scale(1); }
    100% { transform: scale(1.4); }
}

@keyframes breatheOut {
    0% { transform: scale(1.4); }
    100% { transform: scale(0.8); }
}

/* 焦点样式 */
.btn:focus,
.pattern-btn:focus,
.breath-modal-close:focus {
    outline: none;
}

/* 加载状态 */
.breathing-circle.loading {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* 倒计时样式 */
.breathing-text.countdown {
    font-size: 3rem;
    font-weight: 700;
    color: white;
}

/* 按钮禁用状态 */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
} 