/* Reset và Base Styles - Giữ nguyên */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

/* Container chính - Điều chỉnh padding và box-shadow */
.container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 500px;
    width: 90%;
    position: relative;
    backdrop-filter: blur(10px);
    transition: all 0.5s ease-in-out;
}

/* Điều khiển hiển thị các bước - Giữ nguyên */
.step {
    display: none;
    animation: fadeIn 0.6s ease-in-out;
}

.step.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Typography - Giữ nguyên */
h1 {
    color: #4a5568;
    margin-bottom: 30px;
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* Form Styles - Giữ nguyên */
.input-group {
    margin-bottom: 20px;
    text-align: left;
}

label {
    display: block;
    margin-bottom: 5px;
    color: #4a5568;
    font-weight: bold;
}

input[type="text"],
input[type="date"],
input[type="password"] {
    width: 100%;
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
}

input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Button Styles - Giữ nguyên */
.btn {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 50px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 10px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Error Message - Giữ nguyên */
.error {
    color: #e53e3e;
    margin-top: 10px;
    font-weight: bold;
}

/* Letter Styles - Giữ nguyên */
.letter {
    background-image: 
        repeating-linear-gradient(
            to bottom,
            #ffffff,
            #ffffff 28px,
            #dbeafe 29px
        ),
        linear-gradient(to right, #ff6b6b 2px, transparent 2px); /* đường kẻ đỏ bên trái */
    background-size: 100% 29px, 100% 100%;
    background-position: left 40px top 0, left 0 top 0;
    background-repeat: repeat-y, no-repeat;

    padding: 40px 40px 40px 60px;
    border-radius: 10px;
    line-height: 28px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #2d3748;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
}

.letter h2 {
    margin-bottom: 20px;
    font-size: 2em;
}

.letter p {
    font-size: 1.2em;
    line-height: 1.6;
    margin-bottom: 15px;
}

/* Celebration Styles - Giữ nguyên */
.celebration {
    position: relative;
    background: linear-gradient(45deg, #ff6b6b, #ffd93d, #6bcf7f, #4ecdc4, #45b7d1);
    background-size: 400% 400%;
    animation: gradientShift 3s ease infinite;
    border-radius: 20px;
    padding: 40px;
    overflow: hidden;
}

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

/* Balloon Animation - Giữ nguyên */
.balloons {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
}

.balloon {
    position: absolute;
    width: 30px;
    height: 40px;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(-5deg);
    }
    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

/* Cake Animation - Giữ nguyên */
.cake {
    font-size: 4em;
    animation: bounce 1s infinite;
    margin: 20px 0;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Confetti Animation - Giữ nguyên */
.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #ffd93d;
    animation: confetti-fall 3s linear infinite;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Birthday Song - Giữ nguyên */
.birthday-song {
    margin-top: 20px;
    font-size: 1.5em;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    animation: pulse 2s infinite;
}

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

/* Responsive Design - Giữ nguyên */
@media (max-width: 768px) {
    .container {
        padding: 20px;
        margin: 10px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .letter h2 {
        font-size: 1.5em;
    }
    
    .letter p {
        font-size: 1em;
    }
    
    .btn {
        padding: 12px 25px;
        font-size: 16px;
    }
    
    .cake {
        font-size: 3em;
    }
}

/* --- CÁC ĐIỀU CHỈNH MỚI CHO HÒA HỢP --- */

/* Giao diện hình tròn chứa các gợi ý */
.circle-wrapper {
    /* Đảm bảo kích thước linh hoạt, không cố định */
    width: 100%;
    /* Sử dụng aspect-ratio để giữ hình tròn luôn đúng tỉ lệ */
    aspect-ratio: 1 / 1; 
    max-width: 450px;
    margin: 30px auto;
    border-radius: 50%;
    border: 5px dashed #ffc107;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly; /* Thay thế space-between để cân đối hơn */
    align-items: center;
    padding: 30px; /* Điều chỉnh padding cho cân đối */
    box-sizing: border-box;
    position: relative;
    /* Thêm animation hoặc hiệu ứng nhẹ nhàng */
    animation: rotateBorder 10s linear infinite;
    background: rgba(255, 255, 255, 0.1);
}

/* Gợi ý nằm trên một hàng trong hình tròn */
.hints {
    /* Căn giữa các nút gợi ý một cách linh hoạt */
    display: flex;
    justify-content: center; /* Căn giữa thay vì dàn đều */
    align-items: center;
    gap: 15px; /* Tăng khoảng cách giữa các nút */
    width: 100%;
    flex-wrap: wrap; /* Cho phép xuống dòng trên màn hình nhỏ */
    margin-top: 20px;
}

/* Nút gợi ý hình bóng đèn */
.hint-btn {
    background-color: #f6e05e;
    border: none;
    border-radius: 50%;
    width: 65px; /* Tăng kích thước nút một chút */
    height: 65px;
    font-size: 1.5em; /* Tăng kích thước icon hoặc text bên trong */
    font-weight: bold;
    color: #555;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(255, 223, 0, 0.9);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.hint-btn:hover {
    transform: scale(1.15); /* Tăng hiệu ứng hover */
    background-color: #ffeb3b;
    box-shadow: 0 0 20px rgba(255, 223, 0, 1);
}

/* Hộp câu hỏi */
.question {
    background: #fff5cc;
    border: 2px solid #ffcc00;
    padding: 20px;
    border-radius: 15px;
    margin-top: 30px;
    color: #2d3748;
    font-weight: bold;
    text-align: center;
    display: block; /* Ban đầu để là block để người dùng thấy, có thể dùng JS để ẩn */
    width: 90%;
    max-width: 400px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.8s ease-in-out;
}

/* Ô nhập password */
.password-input {
    width: calc(100% - 20px); /* Điều chỉnh kích thước cho phù hợp */
    padding: 15px;
    border: 2px solid #ffcc00;
    border-radius: 10px;
    font-size: 16px;
    text-align: center;
    margin-top: 25px;
}

/* Thông báo lỗi */
.error {
    color: #e53e3e;
    font-weight: bold;
    margin-top: 10px;
}

@media (max-width: 500px) {
    .circle-wrapper {
        width: 95%;
        padding: 20px;
    }
    .hints {
        flex-direction: column;
        gap: 10px;
    }
    .hint-btn {
        width: 50px;
        height: 50px;
        font-size: 1.2em;
    }
}

/* === THIỆP CHÚC MỪNG SINH NHẬT === */
#step2 {
    background-color: #ffe4e9; /* màu hồng nhạt */
    padding: 40px;
    border-radius: 20px;
    perspective: 1000px;
}

/* Thiệp chúc mừng 3D */
.birthday-card {
    width: 450px;
    height: 350px;
    margin: 20px auto;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s ease;
    cursor: pointer;
}

.birthday-card.flipped {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px;
    box-sizing: border-box;
}

/* Mặt trước thiệp */
.card-front {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e8e 50%, #ff9a9e 100%);
    color: white;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.7);
}

.card-front h2 {
    font-size: 2.2rem;
    margin: 0.5rem 0;
    animation: cardBounce 2s infinite;
    color: white;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8);
}

.card-front .decorations {
    font-size: 2.8rem;
    margin: 1rem 0;
    animation: cardFloat 3s ease-in-out infinite;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.5));
}

.card-front .main-title {
    font-size: 1.8rem;
    font-weight: bold;
    text-align: center;
    color: white;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8);
    letter-spacing: 2px;
}

/* Mặt sau thiệp */
.card-back {
    background: linear-gradient(135deg, #e8f5ff 0%, #fff0f5 100%);
    -webkit-transform: rotateY(180deg);
    transform: rotateY(180deg);
    color: #2d3748;
    text-align: center;
    border: 3px solid #ff6b6b;
}

.card-back h3 {
    color: #e53e3e;
    margin-bottom: 1.2rem;
    font-size: 1.5rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    font-weight: bold;
    line-height: 1.3;
}

.card-back p {
    margin-bottom: 1rem;
    line-height: 1.6;
    font-size: 0.95rem;
    color: #2d3748;
    font-weight: 500;
    text-align: center;
    max-width: 100%;
}

.card-back .signature {
    margin-top: 1.5rem;
    font-style: italic;
    color: #e53e3e;
    font-size: 0.9rem;
    font-weight: bold;
    line-height: 1.4;
}

/* Hướng dẫn sử dụng thiệp */
.card-instruction {
    margin-top: 1.5rem;
    color: #4a5568;
    font-size: 1.1rem;
    font-weight: bold;
    text-shadow: none;
    animation: instructionPulse 2s infinite;
}

/* Animations cho thiệp */
@keyframes cardBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes cardFloat {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-8px);
    }
    100% {
        transform: translateY(0px);
    }
}

@keyframes instructionPulse {
    0%, 100% {
        opacity: 0.7;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.02);
    }
}

/* Hiệu ứng tim bay */
.heart-animation {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.5rem;
    color: #ff69b4;
    animation: heartBeat 1.5s ease-in-out infinite;
}

@keyframes heartBeat {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
    }
}

/* Responsive cho thiệp */
@media (max-width: 768px) {
    .birthday-card {
        width: 380px;
        height: 300px;
    }
    
    .card-front h2 {
        font-size: 1.8rem;
    }
    
    .card-front .decorations {
        font-size: 2.2rem;
    }
    
    .card-front .main-title {
        font-size: 1.4rem;
    }
    
    .card-back h3 {
        font-size: 1.3rem;
    }
    
    .card-back p {
        font-size: 0.9rem;
    }
    
    .card-instruction {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .birthday-card {
        width: 320px;
        height: 280px;
    }
    
    .card-front h2 {
        font-size: 1.5rem;
    }
    
    .card-front .decorations {
        font-size: 1.8rem;
        margin: 0.5rem 0;
    }
    
    .card-front .main-title {
        font-size: 1.2rem;
    }
    
    .card-back {
        padding: 20px;
    }
    
    .card-back h3 {
        font-size: 1.1rem;
        margin-bottom: 0.8rem;
    }
    
    .card-back p {
        font-size: 0.8rem;
        margin-bottom: 0.8rem;
    }
    
    .card-back .signature {
        font-size: 0.8rem;
        margin-top: 1rem;
    }
}
