/**
 * 模态窗口和互动情绪系统的样式
 * 用于处理加载过程中的互动窗口
 */

/* ===== 模态窗口基础样式 ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.mood-modal {
    width: 90%;
    max-width: 480px;
    background-color: #fff;
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.5s ease, opacity 0.5s ease;
    position: relative;
    overflow: hidden;
}

.mood-modal.active {
    transform: translateY(0);
    opacity: 1;
}

/* ===== 模态内容样式 ===== */
.mood-modal h2 {
    color: #ff6b6b;
    margin-bottom: 15px;
    font-size: 26px;
    font-family: 'Ma Shan Zheng', cursive;
}

.mood-modal p {
    color: #2d3436;
    margin-bottom: 20px;
    line-height: 1.6;
    font-size: 16px;
}

.mood-question {
    font-weight: bold;
    color: #2d3436;
    margin: 20px 0;
    font-size: 18px;
}

/* ===== 表情容器 ===== */
.emoji-container {
    font-size: 48px;
    margin-bottom: 15px;
    animation: float 3s infinite ease-in-out;
    transition: transform 0.3s;
}

.emoji-pop {
    animation: pop 0.5s ease;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes pop {
    0% { transform: scale(0.8); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* ===== 按钮样式 ===== */
.mood-options {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
}

.mood-option {
    padding: 12px 20px;
    background-color: #f0f0f0;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-size: 16px;
    color: #2d3436;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.mood-option:hover {
    background-color: #e0e0e0;
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.mood-option.primary {
    background-color: #ff6b6b;
    color: white;
}

.mood-option.primary:hover {
    background-color: #ff5252;
}

/* 按钮脉冲效果 */
.pulse-button {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(255, 107, 107, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 107, 107, 0); }
}

/* 按钮点击波纹效果 */
.ripple {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.7);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

@keyframes ripple {
    0% { transform: scale(0); opacity: 1; }
    100% { transform: scale(4); opacity: 0; }
}

/* ===== 进度条样式 ===== */
.forgiveness-progress {
    width: 100%;
    height: 8px;
    background-color: #f0f0f0;
    border-radius: 4px;
    margin: 20px 0;
    overflow: hidden;
}

.forgiveness-bar {
    height: 100%;
    width: 0;
    background-color: #ff6b6b;
    border-radius: 4px;
}

/* ===== 心形动画 ===== */
.mood-hearts {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.floating-heart {
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: #ff6b6b;
    transform: rotate(45deg);
    opacity: 0.3;
    animation: float-heart 10s infinite linear;
}

.floating-heart:before,
.floating-heart:after {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: #ff6b6b;
    border-radius: 50%;
}

.floating-heart:before {
    top: -50%;
    left: 0;
}

.floating-heart:after {
    top: 0;
    left: -50%;
}

@keyframes float-heart {
    0% { transform: rotate(45deg) translateY(0) translateX(0); opacity: 0.3; }
    50% { opacity: 0.5; }
    100% { transform: rotate(45deg) translateY(-100px) translateX(50px); opacity: 0.1; }
}

.flying-heart {
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: #ff6b6b;
    transform: rotate(45deg);
    opacity: 0.8;
    z-index: 10;
}

.flying-heart:before,
.flying-heart:after {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: #ff6b6b;
    border-radius: 50%;
}

.flying-heart:before {
    top: -50%;
    left: 0;
}

.flying-heart:after {
    top: 0;
    left: -50%;
}

@keyframes flyHeart {
    0% { transform: rotate(45deg) scale(0.8); opacity: 0.9; }
    20% { transform: rotate(45deg) scale(1.2); opacity: 1; }
    100% { transform: rotate(45deg) translateY(-100px) scale(0.8); opacity: 0; }
}

/* ===== 爆炸心形动画 ===== */
.explosion-heart {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: #ff6b6b;
    transform: rotate(45deg) translate(-50%, -50%);
    z-index: 10;
}

.explosion-heart:before,
.explosion-heart:after {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: #ff6b6b;
    border-radius: 50%;
}

.explosion-heart:before {
    top: -50%;
    left: 0;
}

.explosion-heart:after {
    top: 0;
    left: -50%;
}

@keyframes explode {
    0% { 
        transform: rotate(45deg) translate(-50%, -50%) scale(0); 
        opacity: 1; 
    }
    50% { 
        opacity: 0.8; 
    }
    100% { 
        transform: rotate(45deg) translate(calc(-50% + var(--end-x)), calc(-50% + var(--end-y))) scale(1); 
        opacity: 0; 
    }
}

/* ===== 特殊消息样式 ===== */
.special-message {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(255, 107, 107, 0.9);
    color: white;
    padding:.8rem 1.5rem;
    border-radius: 20px;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 11;
    opacity: 1;
    transition: opacity 1s;
}

/* 主页面淡入动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 音乐按钮注意动画 */
@keyframes attention-pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(255, 107, 107, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 107, 107, 0); }
}

.music-control .attention {
    animation: attention-pulse 1.5s infinite;
}

/* 容器淡入动画 */
.container {
    opacity: 0;
    transition: opacity 1s ease;
}

/* ===== 响应式样式 ===== */
@media (max-width: 640px) {
    .mood-modal {
        padding: 20px;
    }
    
    .mood-modal h2 {
        font-size: 22px;
    }
    
    .mood-modal p {
        font-size: 14px;
    }
    
    .mood-options {
        flex-direction: column;
    }
    
    .mood-option {
        width: 100%;
    }
}

/* 模态窗口特殊样式 */

/* 彻夜难眠反思模态窗口样式 */
#modal_night .mood-modal {
    background: linear-gradient(135deg, #1a2a3a, #2c3e50);
    color: #ecf0f1;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

#modal_night .emoji-container {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

#modal_night .mood-options button {
    background-color: #3498db;
    color: white;
}

#modal_night .mood-options button:hover {
    background-color: #2980b9;
}

#modal_night .mood-options button.primary {
    background-color: #e74c3c;
}

#modal_night::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200' viewBox='0 0 800 800'%3E%3Cg fill='none' stroke='%233498db' stroke-width='1'%3E%3Cpath d='M769 229L1037 260.9M927 880L731 737 520 660 309 538 40 599 295 764 126.5 879.5 40 599-197 493 102 382-31 229 126.5 79.5-69-63'/%3E%3Cpath d='M-31 229L237 261 390 382 603 493 308.5 537.5 101.5 381.5M370 905L295 764'/%3E%3Cpath d='M520 660L578 842 731 737 840 599 603 493 520 660 295 764 309 538 390 382 539 269 769 229 577.5 41.5 370 105 295 -36 126.5 79.5 237 261 102 382 40 599 -69 737 127 880'/%3E%3Cpath d='M520-140L578.5 42.5 731-63M603 493L539 269 237 261 370 105M902 382L539 269M390 382L102 382'/%3E%3Cpath d='M-222 42L126.5 79.5 370 105 539 269 577.5 41.5 927 80 769 229 902 382 603 493 731 737M295-36L577.5 41.5M578 842L295 764M40-201L127 80M102 382L-261 269'/%3E%3C/g%3E%3Cg fill='%233498db'%3E%3Ccircle cx='769' cy='229' r='5'/%3E%3Ccircle cx='539' cy='269' r='5'/%3E%3Ccircle cx='603' cy='493' r='5'/%3E%3Ccircle cx='731' cy='737' r='5'/%3E%3Ccircle cx='520' cy='660' r='5'/%3E%3Ccircle cx='309' cy='538' r='5'/%3E%3Ccircle cx='295' cy='764' r='5'/%3E%3Ccircle cx='40' cy='599' r='5'/%3E%3Ccircle cx='102' cy='382' r='5'/%3E%3Ccircle cx='127' cy='80' r='5'/%3E%3Ccircle cx='370' cy='105' r='5'/%3E%3Ccircle cx='578' cy='42' r='5'/%3E%3Ccircle cx='237' cy='261' r='5'/%3E%3Ccircle cx='390' cy='382' r='5'/%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.15;
    z-index: -1;
}

/* 添加光晕效果，突出高亮文本 */
#modal_night .highlighted-text {
    position: relative;
    z-index: 1;
    border-left: 5px solid #3498db;
    background-color: rgba(52, 152, 219, 0.8);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4), 0 0 20px rgba(52, 152, 219, 0.4);
    margin: 15px 0;
    font-size: 17px;
    color: #ffffff;
    text-shadow: 0 2px 3px rgba(0, 0, 0, 0.9);
    animation: textFadeIn 0.8s ease-in-out;
}

@keyframes textFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 为你谱写的旋律模态窗口样式 */
#modal_music .mood-modal {
    background: linear-gradient(135deg, #8e44ad, #9b59b6);
    color: white;
    box-shadow: 0 10px 30px rgba(142, 68, 173, 0.3);
}

#modal_music .emoji-container {
    background: linear-gradient(135deg, #f1c40f, #f39c12);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

#modal_music .mood-modal::after {
    content: '';
    position: absolute;
    top: 10px;
    right: 10px;
    width: 60px;
    height: 60px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath fill='rgba(255,255,255,0.2)' d='M470.4 1.5C452.4-2.7 434.7 3 411.9 6c-44.6 5.8-109.9 14-164.3 14s-119.9-8.2-164.8-14c-22.7-3-40.4-8.7-58.5-4.5C7.7 5.7 0 18.6 0 34.9V400c0 16.4 7.7 29.2 24.5 33.5 18.1 4.2 35.7-1.5 58.5-4.5 45-5.8 111.1-14 165-14s119.9 8.2 164.3 14c22.7 3 40.4 8.7 58.4 4.5 16.8-4.3 24.5-17.1 24.5-33.5V34.9c0-16.3-7.7-29.2-24.8-33.4zm-42.2 36c-19.5-1.2-39.1 0-58.3 0-46.3 0-98.6-6.3-147.8-6.3s-101.5 6.3-147.8 6.3c-19.3 0-38.8-1.2-58.3 0v-3.1c54.7-7.8 111.5-12.6 167.6-12.6s112.9 4.8 167.6 12.6v3.1zm0 40.8c-6.2-.8-11.8-1.8-18.3-2.1-52.3-2.4-104.8-4.5-159.9-4.5s-107.6 2.1-159.9 4.5c-6.5.3-12.1 1.3-18.3 2.1v-31.4c54.8-6.9 111.6-11 167.7-11s112.9 4.1 167.7 11v31.4zM167.6 228.6c0-65.2 32.5-97.6 97.4-97.6s97.4 32.4 97.4 97.6c0 64.9-32.5 97.4-97.4 97.4s-97.4-32.5-97.4-97.4zm79.2-22.4l-40.1 17.3c-2.3 1-3.7 3.3-3.7 5.8v34.5c0 2.5 1.4 4.8 3.7 5.8l40.1 17.3c2.2 1 4.8 0 6.1-2.5 0-.3.3-.3.3-.5V209c0-2.5-1.4-4.8-3.7-5.8-1.6-.8-3-1-3-1z'%3E%3C/path%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.2;
}

#modal_music .mood-options button {
    background-color: #f1c40f;
    color: #34495e;
}

#modal_music .mood-options button:hover {
    background-color: #f39c12;
    transform: scale(1.05);
}

#modal_music .mood-options button.primary {
    background-color: #e74c3c;
    color: white;
}

#modal_music .mood-options button.primary:hover {
    background-color: #c0392b;
}

/* 音符动画 */
#modal_music .mood-modal {
    overflow: hidden;
}

#modal_music .mood-modal::before {
    content: '♪';
    position: absolute;
    color: rgba(255, 255, 255, 0.2);
    font-size: 24px;
    animation: note-float 10s linear infinite;
    left: 10%;
    top: -10px;
}

#modal_music .mood-modal p:first-of-type::after {
    content: '♫';
    position: absolute;
    color: rgba(255, 255, 255, 0.2);
    font-size: 32px;
    animation: note-float 15s linear infinite;
    animation-delay: 3s;
    right: 10%;
    top: 40%;
}

@keyframes note-float {
    0% { transform: translateY(0) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-100px) rotate(20deg); opacity: 0; }
}

/* 高亮文本样式 - 提高在深色背景上的可读性 */
.highlighted-text {
    color: #ffffff;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
    background-color: rgba(52, 152, 219, 0.7);
    padding: 12px 18px;
    border-radius: 8px;
    margin-bottom: 18px;
    line-height: 1.8;
    letter-spacing: 1px;
    border-left: 4px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* 修改彻夜难眠反思模态窗口样式 */
#modal_night .mood-modal {
    background: linear-gradient(135deg, #1a2a3a, #2c3e50);
    color: #ecf0f1;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

#modal_night h2 {
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    font-size: 30px;
    margin-bottom: 25px;
    font-weight: 700;
    letter-spacing: 1.5px;
    background-color: rgba(52, 152, 219, 0.3);
    padding: 8px 15px;
    border-radius: 8px;
    display: inline-block;
}

#modal_night .emoji-container {
    background: linear-gradient(135deg, #3498db, #2980b9);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#modal_night .mood-options button {
    background-color: #3498db;
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#modal_night .mood-options button:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

#modal_night .mood-options button.primary {
    background-color: #e74c3c;
}

#modal_night .mood-options button.primary:hover {
    background-color: #c0392b;
}

/* 修改重要文本的边框和背景，让文本更加突出 */
#modal_night .highlighted-text {
    border-left: 5px solid #3498db;
    background-color: rgba(52, 152, 219, 0.7);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    margin: 15px 0;
} 