/* 🎨 Ultra-Modern RSVP Page - 2025 Edition */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --success: #22c55e;
    --success-dark: #16a34a;
    --danger: #ef4444;
    --danger-dark: #dc2626;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* 🌈 Animated Background */
.rsvp-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
}

.bg-gradient {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    z-index: -2;
}

.bg-shapes {
    position: fixed;
    inset: 0;
    z-index: -1;
}

/* Balloon shapes - refined look 🎈 */
.shape {
    position: absolute;
    border-radius: 50%;
    aspect-ratio: 1 / 1;
    filter: blur(22px) drop-shadow(0 20px 40px rgba(0,0,0,0.08));
    opacity: 0.55;
}

/* glossy highlight */
.shape::before {
    content: "";
    position: absolute;
    top: 14%;
    left: 18%;
    width: 28%;
    height: 28%;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.65), rgba(255,255,255,0) 65%);
    transform: rotate(-10deg);
}

.shape-1 {
    width: clamp(200px, 34vw, 520px);
    background:
      radial-gradient(circle at 30% 25%, rgba(255,255,255,0.22), rgba(255,255,255,0) 45%),
      radial-gradient(circle at 50% 55%, #ff6b9d 0%, #c44569 70%);
    top: -10%;
    left: -10%;
    animation: balloon-float-a 18s ease-in-out infinite;
}

.shape-2 {
    width: clamp(120px, 22vw, 360px);
    background:
      radial-gradient(circle at 30% 25%, rgba(255,255,255,0.22), rgba(255,255,255,0) 45%),
      radial-gradient(circle at 50% 55%, #feca57 0%, #ff9ff3 70%);
    bottom: -10%;
    right: -10%;
    animation: balloon-float-b 22s ease-in-out infinite reverse;
    animation-delay: 6s;
}

.shape-3 {
    width: clamp(150px, 28vw, 420px);
    background:
      radial-gradient(circle at 30% 25%, rgba(255,255,255,0.22), rgba(255,255,255,0) 45%),
      radial-gradient(circle at 50% 55%, #48dbfb 0%, #0abde3 70%);
    top: 60%;
    left: 70%;
    animation: balloon-float-c 20s ease-in-out infinite;
    animation-delay: 3s;
}

/* Additional balloon for ultrawide balance */
.shape-4 {
    width: clamp(90px, 20vw, 300px);
    background:
      radial-gradient(circle at 30% 25%, rgba(255,255,255,0.22), rgba(255,255,255,0) 45%),
      radial-gradient(circle at 50% 55%, #34d399 0%, #059669 70%);
    top: 78%;
    left: 8%;
    animation: balloon-float-b 26s ease-in-out infinite alternate;
    animation-delay: 4s;
}


/* Simplify balloons on small screens to avoid clutter */
@media (max-width: 640px) {
    .shape { filter: blur(18px); opacity: 0.35; }
    .shape-1 { width: clamp(140px, 45vw, 280px); top: -8%; left: -18%; }
    .shape-2 { display: none; }
    .shape-3 { width: clamp(90px, 28vw, 180px); top: 68%; left: 68%; }
    .shape-4 { display: none; }
}

/* Re-center balloons on ultrawide so they don't drift off to edges */
@media (min-width: 1600px) {
    .shape-1 { left: -5%; top: -6%; }
    .shape-2 { right: -5%; bottom: -8%; }
    .shape-3 { left: 62%; top: 58%; }
    .shape-4 { left: 68%; top: 14%; }
}


/* Balloon floating animations - slight variations for organic randomness */
@keyframes balloon-float-a {
  0%,100% { transform: translate(0,0) rotate(0deg) scale(1); }
  25%     { transform: translate(40px,-60px) rotate(6deg) scale(1.03); }
  50%     { transform: translate(-20px,-120px) rotate(-4deg) scale(0.985); }
  75%     { transform: translate(-35px,-50px) rotate(5deg) scale(1.02); }
}
@keyframes balloon-float-b {
  0%,100% { transform: translate(0,0) rotate(0deg) scale(1); }
  20%     { transform: translate(-35px,-45px) rotate(-5deg) scale(1.04); }
  50%     { transform: translate(25px,-90px) rotate(4deg) scale(0.98); }
  80%     { transform: translate(10px,-55px) rotate(-3deg) scale(1.01); }
}
@keyframes balloon-float-c {
  0%,100% { transform: translate(0,0) rotate(0deg) scale(1); }
  30%     { transform: translate(30px,-70px) rotate(3deg) scale(1.02); }
  55%     { transform: translate(-25px,-110px) rotate(-6deg) scale(1); }
  85%     { transform: translate(-15px,-60px) rotate(5deg) scale(1.02); }
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        opacity: 0.3;
    }
    25% {
        transform: translate(40px, -25px) scale(1.05) rotate(5deg);
        opacity: 0.35;
    }
    50% {
        transform: translate(-15px, 35px) scale(0.95) rotate(-3deg);
        opacity: 0.25;
    }
    75% {
        transform: translate(-35px, -15px) scale(1.08) rotate(8deg);
        opacity: 0.32;
    }
}

/* 🌍 Language Selector */
.lang-selector {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    display: flex;
    gap: 0.5rem;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 0.5rem;
    border-radius: 100px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.lang-flag {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    background: transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.lang-flag img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.lang-flag:hover {
    transform: scale(1.15);
}

.lang-flag.active {
    box-shadow: 0 0 0 3px white, 0 0 0 5px var(--primary);
    transform: scale(1.1);
}

/* 🎴 RSVP Card */
.rsvp-card {
    max-width: 520px;
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(40px);
    border-radius: 32px;
    padding: 2.5rem;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 10;
    margin: 0 auto;
}

.rsvp-invite-card {
    max-width: 560px;
}

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

/* 🎊 Brand Header */
.brand-header {
    text-align: center;
    margin-bottom: 1rem;
}

.logo-img {
    width: 80px;
    height: 80px;
    margin-bottom: 1rem;
    animation: logoFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 4px 12px rgba(99, 102, 241, 0.3));
}

.brand-name {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), #764ba2, #f093fb);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 1px;
    margin: 0;
    animation: gradientShift 4s ease infinite;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-8px) rotate(2deg); }
}

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

/* 📝 Invite Header */
.invite-header {
    text-align: center;
    margin-bottom: 2rem;
}

.invite-label {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.event-name {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

/* 📊 Info Grid */
.info-grid {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    margin-bottom: 1.75rem;
}

.info-box-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.info-box {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.8));
    border-radius: 16px;
    border: 2px solid rgba(99, 102, 241, 0.2);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.08);
    transition: all 0.3s ease;
}

.info-box:hover {
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
    background: linear-gradient(135deg, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0.9));
}

.info-box-full {
    width: 100%;
}

.info-icon {
    font-size: 1.75rem;
    line-height: 1;
}

.info-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
}

.info-text strong {
    font-size: 1rem;
    font-weight: 600;
    color: #171717;
}

/* 🎯 Action Buttons */
.action-btns {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.action-btn {
    flex: 1;
    padding: 1.25rem;
    border: none;
    border-radius: 16px;
    font-size: 1.125rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.action-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.action-btn:hover::before {
    opacity: 1;
}

.action-btn.accept {
    background: linear-gradient(135deg, var(--success), var(--success-dark));
    color: white;
    box-shadow: 0 8px 24px rgba(34, 197, 94, 0.3);
}

.action-btn.accept:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(34, 197, 94, 0.4);
}

.action-btn.decline {
    background: linear-gradient(135deg, var(--danger), var(--danger-dark));
    color: white;
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.3);
}

.action-btn.decline:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(239, 68, 68, 0.4);
}

.btn-emoji {
    font-size: 1.5rem;
}

/* 📱 App Hint */
.app-hint {
    text-align: center;
    padding-top: 1.5rem;
    margin-top: 1.5rem;
    border-top: 2px dashed rgba(99, 102, 241, 0.2);
}

.app-hint-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.app-hint-features {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
    color: #374151;
}

.app-hint-features span {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.app-hint p {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 1rem;
}

.mini-badges {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.mini-badges a {
    display: inline-block;
    animation: pulse 2s ease-in-out infinite;
}

.mini-badges a:nth-child(1) {
    animation-delay: 0s;
}

.mini-badges a:nth-child(2) {
    animation-delay: 0.3s;
}

.mini-badges img {
    height: 36px;
    transition: transform 0.2s;
    display: block;
}

.mini-badges img:hover {
    transform: scale(1.1);
    animation: none;
}

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

/* 📝 RSVP Form */
.rsvp-details {
    animation: fadeIn 0.4s ease-out;
}

.field {
    margin-bottom: 1.25rem;
}

.field-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.field label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #171717;
    margin: 0;
}

.label-icon {
    margin-right: 0.25rem;
}

.input-field {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s;
    background: white;
}

.input-field:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.field small {
    font-size: 0.75rem;
    color: #6b7280;
    white-space: nowrap;
}

.field small.below-input {
    display: block;
    margin-top: 0.5rem;
}

/* 🔢 Counter */
.counter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 1rem;
    background: white;
    border-radius: 16px;
}

.counter-btn {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.counter-btn:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.counter-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.counter-num {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    min-width: 60px;
    text-align: center;
}

/* 🚀 Submit Buttons */
.submit-btns {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.submit-btn {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.submit-btn.back {
    background: rgba(0, 0, 0, 0.05);
    color: #171717;
}

.submit-btn.back:hover {
    background: rgba(0, 0, 0, 0.1);
}

.submit-btn.accept {
    background: linear-gradient(135deg, var(--success), var(--success-dark));
    color: white;
}

.submit-btn.decline {
    background: linear-gradient(135deg, var(--danger), var(--danger-dark));
    color: white;
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.submit-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ✅ Success & Error States */
.success-state, .error-state {
    text-align: center;
}

/* 🎂 Themed Image Banner */
.themed-image-banner {
    width: calc(100% + 5rem);
    margin: -2.5rem -2.5rem 2rem -2.5rem;
    border-radius: 32px 32px 0 0;
    overflow: hidden;
    max-height: 200px;
    position: relative;
}

.themed-image-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.success-emoji, .error-emoji {
    font-size: 5rem;
    margin-bottom: 1.5rem;
    animation: bounce 1s ease-out;
}

.success-state h1, .error-state h2 {
    font-size: 2rem;
    font-weight: 800;
    color: #171717;
    margin-bottom: 1rem;
}

.success-msg {
    font-size: 1.125rem;
    color: #6b7280;
    margin-bottom: 2.5rem;
}

/* 🎁 App Promo */
.app-promo {
    margin-top: 3rem;
    padding-top: 2.5rem;
    border-top: 2px dashed rgba(0, 0, 0, 0.1);
}

.app-promo h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.app-features {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2rem;
    text-align: left;
}

.app-features span {
    font-size: 1rem;
    color: #171717;
}

.store-badges {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.store-badges a {
    display: inline-block;
    animation: pulse 2s ease-in-out infinite;
}

.store-badges a:nth-child(1) {
    animation-delay: 0s;
}

.store-badges a:nth-child(2) {
    animation-delay: 0.3s;
}

.store-badges img {
    height: 48px;
    transition: transform 0.2s;
    display: block;
}

.store-badges img:hover {
    transform: scale(1.1);
    animation: none;
}

/* ⏳ Loader */
.loader-wrap {
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(40px);
    border-radius: 32px;
    padding: 3rem;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    max-width: 400px;
    width: 100%;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.loader {
    width: 80px;
    height: 80px;
    margin: 0 auto 2rem;
    position: relative;
}

.loader-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 4px solid transparent;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.loader-ring:nth-child(1) {
    animation-delay: -0.45s;
    border-top-color: var(--primary);
}

.loader-ring:nth-child(2) {
    animation-delay: -0.3s;
    border-top-color: #764ba2;
}

.loader-ring:nth-child(3) {
    animation-delay: -0.15s;
    border-top-color: #f093fb;
}

.loader-text {
    font-size: 1.125rem;
    font-weight: 600;
    color: #171717;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 📱 Responsive */
@media (max-width: 640px) {
    .rsvp-page {
        padding: 1rem;
    }

    .lang-selector {
        top: 1rem;
        right: 1rem;
        padding: 0.375rem;
    }

    .lang-flag {
        width: 36px;
        height: 36px;
    }

    .rsvp-card {
        padding: 2rem 1.5rem;
        border-radius: 24px;
    }

    .event-name {
        font-size: 1.5rem;
    }

    .info-box-row {
        grid-template-columns: 1fr;
    }

    .action-btns {
        flex-direction: column;
    }

    .submit-btns {
        flex-direction: column-reverse;
    }

    .store-badges {
        flex-direction: column;
        align-items: center;
    }
}
