/* 
* styles.css
* File CSS cho trang web "Những Lời Yêu Thương"
* File này chứa tất cả các định dạng và hiệu ứng cho trang web
*/

@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@400;700&family=Montserrat:wght@300;400;500;600&family=Pacifico&display=swap');

:root {
    --primary-color: #ff7e9d;
    --primary-dark: #e86a89;
    --secondary-color: #fff8fa;
    --accent-color: #ffb6c9;
    --accent-dark: #ff9fb2;
    --title-color: #ff6b8b;
    --text-color: #555;
    --heading-color: #333;
    --shadow: 0 10px 25px rgba(255, 126, 157, 0.15);
    --card-shadow: 0 15px 35px rgba(255, 126, 157, 0.2);
    --border-radius: 20px;
    --spacing-unit: 20px;
    --gradient-bg: linear-gradient(135deg, #fff8fa, #fff);
    --card-gradient: linear-gradient(135deg, #fff, #fff8fa);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    background: var(--gradient-bg);
    color: var(--text-color);
    overflow-x: hidden;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: calc(var(--spacing-unit) * 2);
    position: relative;
    overflow: hidden;
}

/* Nền trái tim nổi bật */
.heart-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.03;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50"><path fill="%23ff7e9d" d="M25 39.7l-.6-.5C11.5 28.7 8 25 8 19c0-5 4-9 9-9 4.1 0 6.4 2.3 8 4.1 1.6-1.8 3.9-4.1 8-4.1 5 0 9 4 9 9 0 6-3.5 9.7-16.4 20.2l-.6.5z"/></svg>');
    background-size: 80px;
    animation: heart-bg-move 60s linear infinite;
}

@keyframes heart-bg-move {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 500px 500px;
    }
}

/* Định dạng phần header */
header {
    text-align: center;
    margin: calc(var(--spacing-unit) * 2) 0 calc(var(--spacing-unit) * 3);
    position: relative;
    padding: calc(var(--spacing-unit) * 2);
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 126, 157, 0.05),
        transparent
    );
    transform: rotate(45deg);
    animation: shine 8s linear infinite;
    z-index: -1;
}

@keyframes shine {
    0% {
        top: -100%;
        left: -100%;
    }
    100% {
        top: 100%;
        left: 100%;
    }
}

header h1 {
    font-family: 'Pacifico', cursive;
    font-size: clamp(2.5rem, 8vw, 4rem);
    color: var(--title-color);
    margin-bottom: calc(var(--spacing-unit) / 2);
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.1);
    letter-spacing: 1px;
}

header h2 {
    font-weight: 500;
    font-size: clamp(1rem, 4vw, 1.5rem);
    color: var(--primary-color);
    letter-spacing: 1px;
}

/* Định dạng Swiper slider */
.swiper {
    width: 100%;
    padding-top: calc(var(--spacing-unit) * 2);
    padding-bottom: calc(var(--spacing-unit) * 4);
    margin-bottom: calc(var(--spacing-unit) * 3);
    overflow: visible !important;
}

.swiper::before {
    content: '';
    position: absolute;
    bottom: 10px;
    left: 10%;
    width: 80%;
    height: 20px;
    background: rgba(0,0,0,0.05);
    border-radius: 50%;
    filter: blur(10px);
    z-index: -1;
}

.swiper-slide {
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.5s, opacity 0.5s;
    height: auto;
}

.swiper-slide-active {
    transform: scale(1.05);
    z-index: 2;
}

.card {
    background: var(--card-gradient);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: all 0.4s ease;
    max-width: 100%;
    position: relative;
    margin: var(--spacing-unit) 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

@media (min-width: 769px) {
    .card {
        max-width: 90%;
        margin: 0 auto;
    }
    
    .swiper-wrapper {
        align-items: stretch;
    }
    
    .card img {
        height: 350px;
        object-fit: cover;
    }
}

.card:hover {
    transform: translateY(-15px);
    box-shadow: 0 20px 40px rgba(255, 126, 157, 0.3);
}

.card-image-wrapper {
    position: relative;
    overflow: hidden;
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: var(--border-radius);
}

.card-image-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, 
        rgba(255, 126, 157, 0.1), 
        transparent 40%, 
        transparent 60%, 
        rgba(255, 255, 255, 0.3));
    pointer-events: none;
}

.card img {
    width: 100%;
    object-fit: cover;
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: var(--border-radius);
    transition: transform 0.5s ease;
    filter: brightness(1.03);
}

.card:hover img {
    transform: scale(1.05);
}

.card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 70%, rgba(255, 255, 255, 0.8));
    pointer-events: none;
}

.card-content {
    padding: calc(var(--spacing-unit) * 1.5);
    text-align: center;
    background: rgba(255, 255, 255, 0.9);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.card-content h3 {
    font-family: 'Dancing Script', cursive;
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: calc(var(--spacing-unit) / 2);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.05);
}

.card-content p {
    font-size: 0.95rem;
    color: var(--text-color);
    line-height: 1.5;
}

/* Phần ghi chú yêu thương */
.love-notes {
    margin: calc(var(--spacing-unit) * 4) 0;
    text-align: center;
    padding: calc(var(--spacing-unit) * 3);
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.love-notes::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(255, 126, 157, 0.05) 0%, transparent 70%);
    z-index: -1;
}

.love-notes h2 {
    font-family: 'Dancing Script', cursive;
    font-size: clamp(2rem, 5vw, 2.5rem);
    color: var(--primary-color);
    margin-bottom: calc(var(--spacing-unit) * 2);
    position: relative;
    display: inline-block;
}

.love-notes h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(to right, transparent, var(--accent-color), transparent);
}

.notes-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: calc(var(--spacing-unit) * 1.5);
    justify-content: center;
}

/* Blindbox styling */
.note {
    background: white;
    padding: var(--spacing-unit);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    min-height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
    cursor: pointer;
    transition: all 0.4s ease;
    background-image: linear-gradient(135deg, var(--accent-color) 0%, white 100%);
    transform-style: preserve-3d;
    perspective: 1000px;
    overflow: hidden;
}

.note:hover {
    transform: translateY(-8px) rotateY(10deg);
    box-shadow: 0 15px 30px rgba(255, 126, 157, 0.25);
}

.note::before {
    content: "Mở ra";
    font-size: 1.2rem;
    display: block;
    font-family: 'Dancing Script', cursive;
    color: var(--primary-color);
    position: relative;
    z-index: 2;
    font-weight: bold;
}

.note::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.8) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.note:hover::after {
    opacity: 1;
}

.note p {
    display: none;
}

/* Hiệu ứng trái tim */
.heart-animation {
    position: fixed;
    bottom: calc(var(--spacing-unit) * 1.5);
    right: calc(var(--spacing-unit) * 1.5);
    z-index: 10;
    animation: pulse 1.5s infinite;
    filter: drop-shadow(0 5px 15px rgba(255, 126, 157, 0.4));
}

.heart {
    background-color: var(--primary-color);
    display: inline-block;
    height: 35px;
    position: relative;
    transform: rotate(45deg);
    width: 35px;
}

.heart:before,
.heart:after {
    content: "";
    background-color: var(--primary-color);
    border-radius: 50%;
    height: 35px;
    position: absolute;
    width: 35px;
}

.heart:before {
    top: -17.5px;
    left: 0;
}

.heart:after {
    left: -17.5px;
    top: 0;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* Phần footer */
footer {
    text-align: center;
    padding: calc(var(--spacing-unit) * 2) 0;
    margin-top: calc(var(--spacing-unit) * 3);
    border-top: 1px solid rgba(255, 126, 157, 0.2);
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(255, 126, 157, 0.05) 0%, transparent 70%);
    z-index: -1;
}

footer p {
    font-family: 'Dancing Script', cursive;
    font-size: 1.6rem;
    color: var(--primary-color);
    position: relative;
    display: inline-block;
}

footer p::before,
footer p::after {
    content: '❤️';
    font-size: 1.2rem;
    margin: 0 10px;
    position: relative;
    top: -2px;
}

/* Hiệu ứng nổi bọt trái tim */
.bubble-container {
    position: fixed;
    bottom: -100px;
    width: 100%;
    height: 100%;
    z-index: -2;
    pointer-events: none;
}

.bubble {
    position: absolute;
    bottom: 0;
    background: var(--primary-color);
    border-radius: 50%;
    opacity: 0.3;
    animation: float 10s infinite ease-in;
}

.bubble:nth-child(1) {
    width: 40px;
    height: 40px;
    left: 10%;
    animation-duration: 12s;
}

.bubble:nth-child(2) {
    width: 20px;
    height: 20px;
    left: 20%;
    animation-duration: 16s;
    animation-delay: 1s;
}

.bubble:nth-child(3) {
    width: 50px;
    height: 50px;
    left: 35%;
    animation-duration: 14s;
    animation-delay: 2s;
}

.bubble:nth-child(4) {
    width: 80px;
    height: 80px;
    left: 50%;
    animation-duration: 20s;
    animation-delay: 0s;
}

.bubble:nth-child(5) {
    width: 35px;
    height: 35px;
    left: 55%;
    animation-duration: 18s;
    animation-delay: 1s;
}

.bubble:nth-child(6) {
    width: 45px;
    height: 45px;
    left: 65%;
    animation-duration: 16s;
    animation-delay: 3s;
}

.bubble:nth-child(7) {
    width: 25px;
    height: 25px;
    left: 75%;
    animation-duration: 12s;
    animation-delay: 2s;
}

.bubble:nth-child(8) {
    width: 80px;
    height: 80px;
    left: 80%;
    animation-duration: 22s;
    animation-delay: 1s;
}

@keyframes float {
    0% {
        transform: translateY(0) rotate(0);
        opacity: 0.3;
    }
    100% {
        transform: translateY(-1000px) rotate(720deg);
        opacity: 0;
    }
}

/* Hiệu ứng khung viền lấp lánh cho card */
.card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--primary-color), #ffdd59, #ff9ff3, var(--primary-color));
    z-index: -1;
    border-radius: calc(var(--border-radius) + 2px);
    animation: glowing 5s linear infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover::before {
    opacity: 1;
}

@keyframes glowing {
    0% {
        background-position: 0 0;
    }
    50% {
        background-position: 400% 0;
    }
    100% {
        background-position: 0 0;
    }
}

/* Hiệu ứng nút chuyển slide custom */
.swiper-button-next,
.swiper-button-prev {
    background-color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
    background-color: var(--primary-color);
    transform: scale(1.1);
}

.swiper-button-next::after,
.swiper-button-prev::after {
    font-size: 18px;
    color: var(--primary-color);
    transition: color 0.3s ease;
}

.swiper-button-next:hover::after,
.swiper-button-prev:hover::after {
    color: white;
}

.swiper-pagination-bullet {
    background-color: var(--primary-color);
    opacity: 0.5;
    transition: all 0.3s ease;
}

.swiper-pagination-bullet-active {
    opacity: 1;
    background-color: var(--primary-color);
    transform: scale(1.2);
}

/* Thêm responsive cho màn hình nhỏ */
@media (max-width: 768px) {
    :root {
        --spacing-unit: 15px;
    }
    
    .container {
        padding: var(--spacing-unit);
    }
    
    .swiper {
        padding-bottom: calc(var(--spacing-unit) * 2);
    }
    
    .card {
        max-width: 95%;
        margin: 0 auto;
    }
    
    .card img {
        height: 200px;
        object-fit: cover;
    }
    
    .card-content {
        padding: calc(var(--spacing-unit) * 0.7);
    }
    
    .card-content h3 {
        font-size: 1.2rem;
        margin-bottom: 5px;
    }
    
    .card-content p {
        font-size: 0.8rem;
        line-height: 1.3;
    }
    
    .notes-container {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .heart-animation {
        bottom: calc(var(--spacing-unit) / 2);
        right: calc(var(--spacing-unit) / 2);
    }
    
    /* Điều chỉnh nút điều hướng trên mobile */
    .swiper-button-next,
    .swiper-button-prev {
        width: 30px;
        height: 30px;
    }
    
    .swiper-button-next::after,
    .swiper-button-prev::after {
        font-size: 14px;
    }
}

/* Thêm responsive cho màn hình rất nhỏ */
@media (max-width: 480px) {
    :root {
        --spacing-unit: 10px;
    }
    
    .card {
        max-width: 100%;
    }
    
    .card img {
        height: 150px;
    }
    
    .card-content h3 {
        font-size: 1rem;
    }
    
    .card-content p {
        font-size: 0.7rem;
    }
    
    .notes-container {
        grid-template-columns: 1fr;
    }
    
    .note {
        min-height: 100px;
    }
}

/* Thêm hiệu ứng modal cho blindbox */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    padding: calc(var(--spacing-unit) * 2);
    border-radius: var(--border-radius);
    max-width: 90%;
    width: 400px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    text-align: center;
    position: relative;
    animation: modalAppear 0.5s ease-out;
    overflow: hidden;
    background: linear-gradient(135deg, #fff, #fff8fa);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(255, 126, 157, 0.05) 0%, transparent 70%);
    z-index: -1;
}

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

.modal-message {
    font-family: 'Dancing Script', cursive;
    font-size: 1.6rem;
    color: var(--primary-color);
    margin: var(--spacing-unit) 0;
    word-wrap: break-word;
    max-width: 100%;
    overflow-wrap: break-word;
    white-space: normal;
    line-height: 1.5;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.05);
}

.modal-close {
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
    color: white;
    border: none;
    padding: calc(var(--spacing-unit) / 1.5) calc(var(--spacing-unit) * 1.5);
    border-radius: 30px;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-weight: bold;
    margin-top: var(--spacing-unit);
    transition: all 0.3s ease;
    font-size: 1rem;
    box-shadow: 0 5px 15px rgba(255, 126, 157, 0.3);
}

.modal-close:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(255, 126, 157, 0.4);
    background: linear-gradient(to right, var(--primary-dark), var(--accent-dark));
}

.modal-heart {
    font-size: 3.5rem;
    margin-bottom: calc(var(--spacing-unit) / 2);
    display: inline-block;
    animation: pulse 1.5s infinite;
    filter: drop-shadow(0 5px 10px rgba(255, 126, 157, 0.3));
}

/* Thêm chạm vào trái tim sẽ thay đổi */
.heart-animation {
    cursor: pointer;
}

/* Thêm hiệu ứng typing cho modal */
.typing {
    border-right: 3px solid var(--primary-color);
    white-space: normal !important;
    overflow: hidden;
    margin: 0 auto;
    animation: blink-caret 0.75s step-end infinite;
    width: auto !important;
    max-width: 100%;
    min-height: 50px;
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: var(--primary-color) }
}

.heart-icon {
    color: var(--primary-color);
    display: inline-block;
    margin: 0 10px;
    animation: heartBeat 1.5s infinite;
    font-size: 0.8em;
}

@keyframes heartBeat {
    0% {
        transform: scale(1);
    }
    20% {
        transform: scale(1.3);
    }
    40% {
        transform: scale(1);
    }
    60% {
        transform: scale(1.3);
    }
    80% {
        transform: scale(1);
    }
} 