@import url('https://fonts.googleapis.com/css2?family=Lobster+Two:wght@700&family=Open+Sans:wght@400;700&display=swap');

:root {
    --primary-color: #ffc0cb; /* 粉色 */
    --secondary-color: #fde4f2; /* 淡粉色背景 */
    --accent-color: #d8bfd8;   /* 淡紫色 */
    --gold-accent: #daa520;   /* 淡金色 */
    --text-color: #5c5c5c;
    --header-font: 'Lobster Two', cursive;
    --body-font: 'Open Sans', sans-serif;
}

body {
    font-family: var(--body-font);
    background-color: var(--secondary-color);
    color: var(--text-color);
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 30px 40px;
    max-width: 800px;
    width: 100%;
    text-align: center;
}

header h1 {
    font-family: var(--header-font);
    color: var(--primary-color);
    font-size: 3.5em;
    margin: 0;
}

.love-declaration {
    font-size: 1.2em;
    color: var(--accent-color);
    margin-top: -10px;
    margin-bottom: 30px;
}

h2 {
    font-family: var(--header-font);
    color: var(--accent-color);
    font-size: 2.5em;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    margin-top: 40px;
}

#counter-section h2 {
    border: none;
    margin: 10px 0;
}

.counter-box {
    background: var(--primary-color);
    color: white;
    padding: 20px;
    border-radius: 15px;
    display: inline-block;
    margin: 0 10px;
    box-shadow: 0 4px 15px rgba(255, 192, 203, 0.6);
}

#days {
    font-family: var(--header-font);
    font-size: 6em;
    font-weight: 700;
    line-height: 1;
}

#important-dates-list {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.important-date-item {
    background: #f9f9f9;
    border-radius: 10px;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-left: 5px solid var(--accent-color);
    transition: all 0.3s ease;
}

.important-date-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.important-date-item.imminent {
    border-left-color: var(--gold-accent);
    background: #fffaf0;
}

.date-icon {
    font-size: 2em;
    margin-right: 20px;
}

.date-info {
    text-align: left;
    flex-grow: 1;
}

.date-info h4 {
    margin: 0;
    font-family: var(--body-font);
    font-weight: 700;
    font-size: 1.2em;
    color: #333;
}

.date-info p {
    margin: 5px 0 0;
    font-size: 0.9em;
    color: #777;
}

.date-countdown {
    text-align: center;
    background: var(--accent-color);
    color: white;
    border-radius: 8px;
    padding: 10px 15px;
    min-width: 70px;
}

.important-date-item.imminent .date-countdown {
    background: var(--gold-accent);
}

.date-countdown span {
    font-size: 1.8em;
    font-weight: 700;
    display: block;
    line-height: 1;
}

.date-countdown p {
    margin: 0;
    font-size: 0.8em;
    text-transform: uppercase;
}

#memories-gallery {
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.memory-item {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.07);
    border: 1px solid #eee;
    transition: all 0.3s ease;
}

.memory-item:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

/* 图片切换动画效果 */
.memory-image {
    width: 100%;
    position: relative;
    transition: opacity 0.4s ease-in-out;
    opacity: 0;
    position: absolute;
    top: 0;
    left: 0;
}

.memory-image.active {
    opacity: 1;
    position: relative;
}

.memory-image-container {
    position: relative;
    overflow: hidden;
    min-height: 200px; /* 确保容器高度一致 */
}

/* 轮播导航按钮 */
.image-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.7);
    color: var(--primary-color);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5em;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.memory-item:hover .image-nav {
    opacity: 1;
}

.image-nav.prev {
    left: 10px;
}

.image-nav.next {
    right: 10px;
}

/* 图片指示器样式 */
.image-dots {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.image-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.image-dot.active {
    background: var(--primary-color);
    transform: scale(1.2);
}

.memory-info {
    padding: 15px;
    text-align: left;
}

.memory-info h5 {
    margin: 0 0 5px 0;
    font-family: var(--body-font);
    font-weight: 700;
    font-size: 1.1em;
    color: var(--primary-color);
}

.memory-info p {
    margin: 0;
    font-size: 0.9em;
    color: #666;
}

footer {
    margin-top: 40px;
    font-size: 0.9em;
    color: #aaa;
}

/* Password Overlay Styles */
#password-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95); /* Semi-transparent white background */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.password-prompt {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.password-prompt h2 {
    font-family: var(--header-font);
    color: var(--primary-color);
    font-size: 2.2em;
    margin-bottom: 25px;
    border-bottom: none;
    padding-bottom: 0;
}

#password-input {
    width: calc(100% - 40px);
    padding: 15px 20px;
    margin-bottom: 20px;
    border: 2px solid var(--accent-color);
    border-radius: 10px;
    font-size: 1.1em;
    outline: none;
    transition: border-color 0.3s ease;
}

#password-input:focus {
    border-color: var(--primary-color);
}

#password-submit {
    background: var(--primary-color);
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1.2em;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
}

#password-submit:hover {
    background: #ff8fab; /* Darker pink on hover */
    transform: translateY(-2px);
}

#password-submit:active {
    transform: translateY(0);
}

.error-message {
    color: #e74c3c;
    margin-top: 15px;
    font-size: 1em;
    font-weight: 600;
}

/* Responsive Design */

/* For screens smaller than 768px (e.g., tablets in portrait, larger phones) */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }

    .container {
        padding: 25px 30px;
        border-radius: 15px;
    }

    header h1 {
        font-size: 2.8em;
    }

    .love-declaration {
        font-size: 1.1em;
    }

    h2 {
        font-size: 2em;
        margin-top: 30px;
    }

    #days {
        font-size: 5em;
    }

    .important-date-item {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
        padding: 15px;
    }

    .date-icon {
        margin-right: 0;
        margin-bottom: 10px;
    }

    .date-countdown {
        width: 100%;
        margin-top: 15px;
        padding: 8px 10px;
    }

    .date-countdown span {
        font-size: 1.5em;
    }

    #memories-gallery {
        grid-template-columns: 1fr;
    }

    .password-prompt {
        padding: 30px;
    }

    .password-prompt h2 {
        font-size: 1.8em;
    }

    #password-input {
        width: calc(100% - 30px);
        padding: 12px 15px;
    }

    #password-submit {
        padding: 12px 25px;
        font-size: 1.1em;
    }
}

/* For screens smaller than 480px (e.g., mobile phones) */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 20px;
        border-radius: 10px;
    }

    header h1 {
        font-size: 2.2em;
    }

    .love-declaration {
        font-size: 1em;
    }

    h2 {
        font-size: 1.8em;
        margin-top: 25px;
    }

    #days {
        font-size: 4em;
    }

    .counter-box {
        padding: 15px;
    }

    .important-date-item {
        padding: 10px;
    }

    .date-info h4 {
        font-size: 1.1em;
    }

    .date-info p {
        font-size: 0.85em;
    }

    .memory-info h5 {
        font-size: 1em;
    }

    .memory-info p {
        font-size: 0.8em;
    }

    .password-prompt {
        padding: 20px;
    }

    .password-prompt h2 {
        font-size: 1.5em;
    }

    #password-input {
        width: calc(100% - 20px);
        padding: 10px;
        font-size: 1em;
    }

    #password-submit {
        padding: 10px 20px;
        font-size: 1em;
    }
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    overflow: hidden;
}

.modal-content {
    position: relative;
    margin: auto;
    width: 90%;
    max-width: 1000px;
    height: 90%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.modal-image-container {
    position: relative;
    width: 100%;
    height: 80%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 模态框图片动画 */
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes fadeOut {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(1.05); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

.modal-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border: 5px solid white;
    border-radius: 5px;
    animation: fadeIn 0.3s ease-in-out;
    transition: transform 0.3s ease;
}

.modal-image.slide-in-right {
    animation: slideInRight 0.3s ease-in-out;
}

.modal-image.slide-in-left {
    animation: slideInLeft 0.3s ease-in-out;
}

.modal-image:hover {
    transform: scale(1.02);
}

.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.3);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 2em;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-nav:hover {
    background: rgba(255, 255, 255, 0.5);
}

.modal-nav.prev {
    left: 20px;
}

.modal-nav.next {
    right: 20px;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1010;
    transition: color 0.3s ease;
}

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

.modal-dots {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    gap: 10px;
}

.modal-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-dot.active {
    background: var(--primary-color);
    transform: scale(1.2);
}

.modal-caption {
    color: white;
    text-align: center;
    margin-top: 15px;
    font-size: 1.2em;
    font-weight: 500;
}

/* 添加图片点击效果 */
.memory-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    cursor: pointer;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.memory-image img:hover {
    opacity: 0.9;
    transform: scale(1.03);
}

/* 分页样式 */
.pagination {
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.pagination button {
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9em;
    cursor: pointer;
    transition: background 0.3s ease;
}

.pagination button:hover:not(:disabled) {
    background: #ff8fab;
}

.pagination button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.pagination span {
    font-size: 0.9em;
    color: var(--text-color);
}

