/* General Styles */
body {
    font-family: 'Noto Sans SC', sans-serif; /* Fallback to Noto Sans SC if Bootstrap Icons font doesn't cover CJK */
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #ffefba, #ffffff); /* Lighter, softer gradient */
    color: #333;
    line-height: 1.6;
    overflow-x: hidden; /* Prevent horizontal scroll on mobile */
}

.container {
    width: 90%; /* More fluid width for mobile */
    max-width: 600px; /* Max width for larger mobile screens */
    margin: 20px auto;
    padding: 20px; /* Increased padding */
    background-color: rgba(255, 255, 255, 0.95); /* Slightly more opaque */
    border-radius: 15px; /* Softer corners */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1); /* Softer shadow */
}

h1, h2 {
    color: #ff8c94; /* Softer, celebratory pink */
    text-align: center;
    margin-bottom: 15px;
}

h1 {
    font-size: 1.8em; /* Adjusted for mobile */
}

h2 {
    font-size: 1.5em; /* Adjusted for mobile */
    border-bottom: 2px solid #ffc0cb; /* Lighter pink for border */
    padding-bottom: 8px;
    margin-top: 25px;
}

.subtitle {
    text-align: center;
    color: #555;
    font-size: 0.9em; /* Adjusted for mobile */
    margin-bottom: 20px;
}

section {
    margin-bottom: 25px;
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
}

/* Greeting Card */
#greeting-card p {
    font-size: 0.95em; /* Adjusted for mobile */
    margin-bottom: 4px;
    text-align: justify;
}

/* Music Player */
#music-player-section {
    text-align: center;
}

#music-player {
    background-color: #fff;
    padding: 1em;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.lyrics-box {
    height: 180px; /* Adjusted for mobile */
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #ffe4e1; /* Lighter pink border */
    border-radius: 8px; /* Slightly more rounded */
    background-color: #fffafa; /* Softer background */
    text-align: center; /* Center lyrics text */
    margin-bottom: 15px;
}

.lyric-line {
    padding: 6px 0;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
    font-size: 0.9em; /* Adjusted for mobile */
}

.lyric-line.active {
    color: #ff7f50; /* Coral color for active lyric */
    font-weight: bold;
}

.lyric-line:hover {
    background-color: #eee;
}

.player-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 10px;
    margin-bottom: 10px; /* Added margin to separate from lyrics */
    flex-wrap: nowrap; /* Ensure controls stay on one line */
}

.player-controls button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin: 0 5px;
    transition: transform 0.2s;
    display: inline-flex; /* Ensure buttons align correctly */
    align-items: center;
    justify-content: center;
}

.player-controls button:hover {
    transform: scale(1.1);
}

.player-controls button svg {
    width: 22px; /* Adjusted for mobile */
    height: 22px;
    fill: #ff8c94; /* Match heading color */
}

.player-controls button svg.active {
    fill: #ff7f50; /* Coral for active control */
}

/* Add visual feedback for loop button click and active state */
#loop-btn:active {
    transform: scale(0.95); /* Slight shrink on click */
}

#loop-btn svg.active {
    /* Optional: Add a more distinct style when loop is active, beyond just color */
    /* For example, a subtle glow or a different stroke */
    filter: drop-shadow(0 0 2px #ff7f50); /* Add a glow effect when active */
}

/* Volume slider styles */
.player-controls input[type="range"] {
    -webkit-appearance: none; /* Override default appearance */
    appearance: none;
    width: 80px; /* Default width, can be adjusted */
    height: 8px; /* Slider track height */
    background: #ddd; /* Slider track color */
    border-radius: 5px;
    cursor: pointer;
    margin-left: 5px; /* Space from volume button */
    vertical-align: middle; /* Align with buttons */
}

.player-controls input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px; /* Thumb width */
    height: 16px; /* Thumb height */
    background: #ff8c94; /* Thumb color, matching other controls */
    border-radius: 50%;
    cursor: pointer;
}

.player-controls input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #ff8c94;
    border-radius: 50%;
    cursor: pointer;
    border: none; /* Remove default border in Firefox */
}

.player-controls input[type="range"]::-ms-thumb {
    width: 16px;
    height: 16px;
    background: #ff8c94;
    border-radius: 50%;
    cursor: pointer;
    border: none; /* Remove default border in IE/Edge */
}

/* Ensure volume button shares common player control button styles */
#volume-btn {
    /* Styles are inherited from .player-controls button, so specific overrides are not usually needed unless for positioning or unique aspects */
    /* Example: margin-left: 10px; is already inline, but could be here if preferred */
}

.time-display {
    font-size: 0.85em; /* Adjusted for mobile */
    color: #666;
    margin-bottom: 8px;
}

/* Email Scheduler */
#email-scheduler .form-group {
    margin-bottom: 15px;
}

#email-scheduler label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 0.9em; /* Adjusted for mobile */
}

#email-scheduler input[type="email"],
#email-scheduler textarea,
#email-scheduler input[type="text"] {
    font-family: 'Noto Sans SC', sans-serif; /* Ensure consistent font family */
    width: calc(100% - 20px); /* Full width with padding */
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.9em; /* Adjusted for mobile */
    box-sizing: border-box;
    /* Ensure consistent font family is applied if not inherited correctly */
    font-family: inherit; 
}

#email-scheduler textarea {
    resize: vertical;
}

.btn-primary,
.btn-secondary {
    padding: 10px 18px;
    border: none;
    border-radius: 20px; /* More rounded buttons */
    cursor: pointer;
    font-size: 0.95em; /* Adjusted for mobile */
    transition: background-color 0.3s, transform 0.2s;
    display: inline-block;
    text-align: center;
    font-weight: bold;
}

.btn-primary {
    background-color: #ff8c94; /* Softer pink */
    color: white;
}

#send-btn {
    margin-top: 15px; /* Add margin to the top of the send button */
}

.btn-primary:hover {
    background-color: #ff7f50; /* Coral on hover */
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: #6c757d; /* A neutral secondary color */
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
    transform: translateY(-2px);
}

#status-message,
#verification-status {
    margin-top: 10px;
    padding: 8px;
    border-radius: 4px;
    font-size: 0.85em; /* Adjusted for mobile */
    text-align: center;
}

.status-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.status-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
    font-size: 0.85em; /* Adjusted for mobile */
    padding: 10px;
    text-align: center;
}

.email-verification-trigger-area {
    display: flex;
    justify-content: space-between; /* Keep space-between for mobile layout */
    align-items: center;
    flex-wrap: wrap; /* Allow wrapping on small screens */
}

.email-verification-trigger-area button {
    margin-bottom: 5px; /* Add some space if they wrap */
}

.email-provider-link {
    font-size: 0.8em; /* Adjusted for mobile */
    color: #007bff;
    text-decoration: none;
}

.email-provider-link:hover {
    text-decoration: underline;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    padding-top: 10vh; /* Position modal nicely on mobile */
}

.modal-content {
    background-color: #fff;
    margin: auto;
    padding: 20px;
    border: 1px solid #888;
    width: 85%; /* Wider for mobile */
    max-width: 400px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    position: relative;
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 24px; /* Adjusted for mobile */
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 15px;
}

.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.modal h3 {
    margin-top: 0;
    color: #d6336c;
    font-size: 1.3em; /* Adjusted for mobile */
}

/* 礼物弹窗和图标样式 */
/* Styling for the gift icon when it's inside player-controls */
.player-controls #gift-icon-container {
    display: inline-flex; /* Align with other flex items */
    align-items: center;
    margin-left: 10px; /* Space between controls and icon */
}

.player-controls #persistent-gift-icon {
    width: 24px; /* Consistent size with other icons */
    height: 24px;
    cursor: pointer;
}

/* Original #gift-icon-container for fallback or other uses if any, ensure it's hidden by default if not used */
#gift-icon-container {
    text-align: center;
    margin-top: 10px;
    display: none; /* 默认隐藏 if not part of controls */
}

#persistent-gift-icon {
    width: 30px;
    height: 30px;
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
}

#persistent-gift-icon:hover {
    transform: scale(1.1);
}

/* 礼物模态框特定样式 */
#gift-modal .modal-content h3 {
    color: #e91e63; /* 礼物主题色 */
    margin-bottom: 15px;
}

#gift-modal .modal-content p {
    margin-bottom: 20px;
    line-height: 1.6;
    text-align: center; /* 提示文字居中 */
}

/* 确保礼物弹窗的按钮也应用通用模态框按钮样式 */
#gift-modal .button-container button {
    flex-basis: 48%;
    margin: 0;
    padding: 12px;
    font-size: 1em;
    border-radius: 8px;
}

#gift-modal .btn-primary {
    background-color: #e91e63; /* 礼物主题色 */
}

#gift-modal .btn-primary:hover {
    background-color: #d81b60; /* 礼物主题色深一点 */
}

#gift-modal .btn-secondary {
    background-color: #aaa; /* 中性灰色 */
}

#gift-modal .btn-secondary:hover {
    background-color: #888;
}

/* Enhanced Modal Buttons */
.modal .form-group {
    margin-bottom: 15px;
}

.modal .btn-primary {
    width: 100%; /* Full width buttons in modal */
    padding: 12px;
    font-size: 1em;
    background-color: #f08ca0; /* Softer pink for modal buttons */
    border-radius: 8px; /* Slightly less rounded for a modern feel */
}

.modal .btn-primary:hover {
    background-color: #e8708a;
}

/* Styles for QQ Login Modal Buttons */
#qq-login-modal-mobile .button-container {
    display: flex;
    justify-content: space-between; /* Distributes space, or use space-around for space on outsides */
    margin-top: 20px;
}

#qq-login-modal-mobile .button-container button {
    flex-basis: 48%; /* Each button takes up roughly half the space, adjust as needed */
    margin: 0; /* Remove individual margins if flex handles spacing */
    padding: 12px; /* Consistent padding */
    font-size: 1em;
    border-radius: 8px;
}

/* Specific styles if needed, though general modal button styles might cover them */
#qq-login-modal-mobile .btn-primary {
    /* background-color: #f08ca0; /* Already defined in .modal .btn-primary */
}

#qq-login-modal-mobile .btn-secondary {
    background-color: #6c757d; /* Ensure secondary button has its style */
    color: white;
}

#qq-login-modal-mobile .btn-secondary:hover {
    background-color: #5a6268;
}

.modal input[type="text"] {
    width: calc(100% - 22px);
    margin-bottom: 10px;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    font-size: 0.8em; /* Adjusted for mobile */
    color: #777;
}

.tip {
    font-size: 0.8em;
    color: #666;
    margin-top: 10px;
    padding: 5px 10px;
    background-color: #f9f9f9;
    border-left: 3px solid #ffc0cb; /* Light pink border */
    border-radius: 0 4px 4px 0;
}

.tip-secure {
    background-color: #e6fff2; /* A light green for secure messages */
    border-left-color: #5cb85c; /* Green border for secure messages */
}

.footer-note {
    font-size: 0.75em;
    color: #999;
    margin-top: 5px;
}

/* Responsive Adjustments - though already mobile-first */
@media (min-width: 600px) {
    .container {
        width: 80%;
        padding: 20px;
    }
    h1 {
        font-size: 2em;
    }
    h2 {
        font-size: 1.6em;
    }
    .subtitle {
        font-size: 1em;
    }
    .lyrics-box {
        height: 200px;
    }
    .lyric-line {
        font-size: 1em;
    }
    .player-controls button svg {
        width: 24px;
        height: 24px;
    }
    .time-display {
        font-size: 0.9em;
    }
    #email-scheduler label,
    #email-scheduler input[type="email"],
    #email-scheduler textarea,
    #email-scheduler input[type="text"] {
        font-size: 1em;
    }
    .btn-primary,
    .btn-secondary {
        font-size: 1em;
    }
    #status-message,
    #verification-status,
    .status-info {
        font-size: 0.9em;
    }
    .email-provider-link {
        font-size: 0.85em;
    }
    .modal-content {
        width: 70%;
    }
    .close-button {
        font-size: 28px;
    }
    .modal h3 {
        font-size: 1.4em;
    }
    footer {
        font-size: 0.9em;
    }
}

/* 礼物弹窗按钮容器样式 */
.gift-button-container {
    display: flex;
    justify-content: space-between; /* 将按钮分布到容器的两端 */
    margin-top: 20px;
}

/* 礼物弹窗按钮通用样式 */
.gift-modal-button {
    flex-grow: 1; /* 让按钮平分容器宽度 */
    margin-left: 5px;
    margin-right: 5px;
    padding: 10px 0; /* 调整内边距使按钮看起来大小一致 */
    text-align: center;
}

/* 第一个按钮（取消）的左边距移除 */
.gift-modal-button:first-child {
    margin-left: 0;
}

/* 最后一个按钮（确认）的右边距移除 */
.gift-modal-button:last-child {
    margin-right: 0;
}