/* =========================================================================
   EVENT INVITATION - FESTIVE THEMES CSS
   ========================================================================= */

/* Theme CSS Variables - Default */
:root {
    --primary-color: #4a69bd;
    --secondary-color: #6a89cc;
    --text-color: #333;
    --text-light: #666;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --card-bg: rgba(255, 255, 255, 0.95);
    --card-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

/* Theme: Tết Nguyên Đán */
[data-theme="tet"] {
    --primary-color: #d4181b;
    --secondary-color: #ffd700;
    --bg-gradient: linear-gradient(135deg, #d4181b 0%, #8B0000 100%);
    --card-bg: rgba(255, 253, 240, 0.98);
}

/* Theme: Ngày Nhà Giáo 20/11 */
[data-theme="teachers-day"] {
    --primary-color: #e74c3c;
    --secondary-color: #f39c12;
    --bg-gradient: linear-gradient(135deg, #ff6b6b 0%, #f39c12 100%);
}

/* Theme: Giáng Sinh */
[data-theme="christmas"] {
    --primary-color: #165b33;
    --secondary-color: #c41e3a;
    --bg-gradient: linear-gradient(135deg, #1a472a 0%, #0f2818 100%);
    --text-color: #1a1a1a;
    --card-bg: rgba(255, 255, 255, 0.97);
}

/* Theme: Party / Sinh nhật */
[data-theme="party"] {
    --primary-color: #9b59b6;
    --secondary-color: #e91e63;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #f093fb 100%);
}

/* Theme: Lễ kỷ niệm */
[data-theme="anniversary"] {
    --primary-color: #c9a227;
    --secondary-color: #8b7355;
    --bg-gradient: linear-gradient(135deg, #3d3d3d 0%, #1a1a1a 100%);
    --card-bg: rgba(255, 255, 255, 0.98);
}

/* Theme: Tất niên - Year End Party */
[data-theme="year-end-party"] {
    --primary-color: #ffd700;
    --secondary-color: #1a1a2e;
    --bg-gradient: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    --text-color: #1a1a1a;
}

/* Theme: Khai trương - Khánh thành */
[data-theme="grand-opening"] {
    --primary-color: #e74c3c;
    --secondary-color: #ffd700;
    --bg-gradient: linear-gradient(135deg, #c0392b 0%, #e74c3c 100%);
}

/* =========================================================================
   BASE STYLES
   ========================================================================= */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=Roboto:wght@300;400;500&display=swap');

* {
    box-sizing: border-box;
}

body {
    background: var(--bg-gradient);
    font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    overflow-x: hidden;
    position: relative;
}

/* Particle Canvas Background */
#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* =========================================================================
   3D ENVELOPE REVEAL ANIMATION
   ========================================================================= */
#envelope-wrapper {
    position: relative;
    perspective: 1500px;
    z-index: 10;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    cursor: pointer;
    width: 100%;
    max-width: 600px;
}

#envelope-wrapper.envelope-closed {
    display: flex;
}

.envelope-front {
    width: 100%;
    padding: 80px 40px;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    text-align: center;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    backface-visibility: hidden;
}

.envelope-front::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--primary-color));
    border-radius: 16px 16px 0 0;
}

.envelope-seal {
    font-size: 80px;
    margin-bottom: 20px;
    animation: pulse-glow 2s ease-in-out infinite;
}

.envelope-front p {
    font-size: 1.2rem;
    color: var(--text-light);
    margin: 0;
    animation: fade-in-up 1s ease-out;
}

#envelope-wrapper.envelope-opening .envelope-front {
    transform: rotateX(-180deg);
}

#envelope-wrapper.envelope-opened {
    display: none;
}

/* =========================================================================
   INVITATION CONTAINER
   ========================================================================= */
.invitation-container {
    max-width: 600px;
    width: 100%;
    z-index: 10;
    position: relative;
}

.invitation-card {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
    text-align: center;
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.invitation-card.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.invitation-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--primary-color));
    background-size: 200% 100%;
    animation: shimmer 3s ease-in-out infinite;
}

/* =========================================================================
   INVITATION HEADER
   ========================================================================= */
.invitation-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 40px 30px;
    position: relative;
    overflow: hidden;
}

.invitation-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
    animation: rotate-slow 20s linear infinite;
}

.invitation-header h1 {
    margin: 0;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2.5rem;
    font-weight: 700;
    position: relative;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    animation: fade-in-up 0.8s ease-out;
}

/* =========================================================================
   INVITATION BODY
   ========================================================================= */
.invitation-body {
    padding: 40px 30px;
}

.event-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 25px;
    animation: fade-in-up 0.8s ease-out 0.2s both;
}

.invitation-body p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-color);
    animation: fade-in-up 0.8s ease-out 0.3s both;
}

/* =========================================================================
   EVENT DETAILS
   ========================================================================= */
.event-details {
    background: linear-gradient(135deg, rgba(248, 249, 250, 0.8) 0%, rgba(233, 236, 239, 0.8) 100%);
    border-left: 4px solid var(--primary-color);
    text-align: left;
    padding: 25px;
    margin: 30px 0;
    border-radius: 12px;
    backdrop-filter: blur(5px);
    animation: fade-in-up 0.8s ease-out 0.4s both;
}

.event-details p {
    font-size: 1rem;
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.event-details p:last-child {
    margin-bottom: 0;
}

.event-details strong {
    color: var(--primary-color);
    min-width: 100px;
}

/* =========================================================================
   RSVP SECTION
   ========================================================================= */
.rsvp-section {
    background: linear-gradient(135deg, rgba(248, 249, 250, 0.9) 0%, rgba(233, 236, 239, 0.9) 100%);
    padding: 40px 30px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    animation: fade-in-up 0.8s ease-out 0.5s both;
}

.rsvp-section h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 25px;
    color: var(--text-color);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
    font-weight: 600;
    padding: 14px 40px;
    font-size: 1.1rem;
    border-radius: 50px;
    color: white;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
}

.btn-primary:hover::before {
    left: 100%;
}

/* =========================================================================
   FORM STYLES
   ========================================================================= */
.form-label {
    font-weight: 500;
    text-align: left;
    display: block;
    margin-bottom: 8px;
    color: var(--text-color);
}

.form-control {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 105, 189, 0.1);
    outline: none;
}

.form-check-label {
    font-weight: 400;
    cursor: pointer;
}

.thank-you-message {
    margin-top: 25px;
    font-size: 1.3rem;
    font-weight: 600;
    color: #28a745;
    animation: scale-in 0.5s ease-out;
}

/* =========================================================================
   FLOATING DECORATIONS
   ========================================================================= */
#theme-decorations {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    overflow: hidden;
}

.floating-decoration {
    position: absolute;
    top: -50px;
    animation: float-down linear infinite;
    opacity: 0.7;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* =========================================================================
   ANIMATIONS
   ========================================================================= */
@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scale-in {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse-glow {

    0%,
    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.3));
    }

    50% {
        transform: scale(1.05);
        filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.5));
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

@keyframes rotate-slow {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

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

    10% {
        opacity: 0.7;
    }

    90% {
        opacity: 0.7;
    }

    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* =========================================================================
   RESPONSIVE
   ========================================================================= */
@media (max-width: 768px) {
    .invitation-header h1 {
        font-size: 1.8rem;
    }

    .event-title {
        font-size: 1.3rem;
    }

    .invitation-body {
        padding: 25px 20px;
    }

    .event-details {
        padding: 20px;
    }

    .rsvp-section {
        padding: 25px 20px;
    }

    .envelope-seal {
        font-size: 60px;
    }

    .envelope-front {
        padding: 60px 30px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .invitation-header {
        padding: 30px 20px;
    }

    .invitation-header h1 {
        font-size: 1.5rem;
    }

    .btn-primary {
        padding: 12px 30px;
        font-size: 1rem;
    }
}