/* ============================================
   Bar Mitzvah Invitation - Orel Shachar Mahtabi
   Modern, Animated, RTL Hebrew Design
   ============================================ */

/* === Variables === */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #111122;
    --bg-card: rgba(255, 255, 255, 0.03);
    --gold: #d4af37;
    --gold-light: #f5e6c4;
    --gold-dark: #b8960c;
    --gold-glow: rgba(212, 175, 55, 0.3);
    --white: #ffffff;
    --gray: #9ca3af;
    --gray-light: #d1d5db;
    --font-main: 'Heebo', 'Assistant', sans-serif;
    --radius: 16px;
    --radius-sm: 8px;
    --transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === Reset & Base === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-main);
    background: var(--bg-primary);
    color: var(--white);
    overflow-x: hidden;
    direction: rtl;
    line-height: 1.6;
}

/* === Scrollbar === */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 3px; }

/* === Loading Screen === */
.loader {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.loader.hidden { opacity: 0; visibility: hidden; }

.loader-content { text-align: center; }

.loader-star {
    font-size: 4rem;
    color: var(--gold);
    animation: pulse-glow 1.5s ease-in-out infinite;
    margin-bottom: 1.5rem;
}

.loader-text {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--gold), var(--gold-light), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 2rem;
}

.loader-bar {
    width: 200px;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin: 0 auto;
}

.loader-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold), var(--gold-light));
    border-radius: 3px;
    animation: loading 2s ease-in-out forwards;
}

@keyframes loading {
    0% { width: 0; }
    100% { width: 100%; }
}

/* === Particles Canvas === */
#particles {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

/* === Navigation === */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1rem 2rem;
    transition: var(--transition);
    background: transparent;
}

.navbar.scrolled {
    background: rgba(10, 10, 15, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(212, 175, 55, 0.1);
    padding: 0.7rem 2rem;
}

.nav-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.nav-links a {
    color: var(--white);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.7;
    transition: var(--transition);
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    right: 0;
    width: 0;
    height: 2px;
    background: var(--gold);
    transition: width 0.3s ease;
}

.nav-links a:hover { opacity: 1; color: var(--gold); }
.nav-links a:hover::after { width: 100%; }

/* === Hero Section === */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 2rem;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(212, 175, 55, 0.05) 0%, transparent 70%);
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 600px;
    animation: fadeInUp 1s ease-out 2s both;
}

.hero-badge {
    font-size: 1rem;
    color: var(--gold);
    opacity: 0.6;
    margin-bottom: 1.5rem;
    letter-spacing: 2px;
}

/* Hero Photo */
.hero-photo-container {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto 1.5rem;
}

.hero-photo-glow {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, var(--gold), var(--gold-light), var(--gold-dark), var(--gold));
    animation: rotate-glow 4s linear infinite;
    filter: blur(2px);
}

@keyframes rotate-glow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.hero-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    position: relative;
    z-index: 1;
    border: 4px solid var(--bg-primary);
    transition: transform 0.5s ease;
}

.hero-photo:hover { transform: scale(1.05); }

/* Parents (divorced - separated left/right) */
.hero-parents {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
    margin-bottom: 1rem;
}

.parent-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--gold-light);
    letter-spacing: 0.5px;
}

.parent-separator {
    color: var(--gold);
    font-size: 0.9rem;
    opacity: 0.4;
}

.hero-invite {
    font-size: 1rem;
    color: var(--gray-light);
    margin-bottom: 0.8rem;
    font-weight: 300;
    margin-top: 0.5rem;
}

/* Hero Name */
.hero-name { margin-bottom: 0.5rem; }

.name-line {
    display: block;
    font-size: 3.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--gold), var(--gold-light), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
    filter: drop-shadow(0 0 30px var(--gold-glow));
}

.name-line.family {
    font-size: 2.5rem;
    font-weight: 700;
    opacity: 0.9;
}

.hero-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 1rem 0;
}

.hero-divider::before,
.hero-divider::after {
    content: '';
    width: 80px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.divider-star {
    color: var(--gold);
    font-size: 1.2rem;
    animation: pulse-glow 2s ease-in-out infinite;
}

.hero-event-summary {
    background: rgba(212, 175, 55, 0.06);
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: var(--radius);
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
}

.hero-date {
    font-size: 1rem;
    color: var(--gold-light);
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.hero-venue {
    font-size: 0.9rem;
    color: var(--gray-light);
    margin-bottom: 0.5rem;
}

.hero-times {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.85rem;
    color: var(--gray);
}

/* === Countdown (inside hero) === */
.countdown-grid {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.countdown-item { text-align: center; }

.countdown-card {
    background: var(--bg-card);
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: var(--radius);
    padding: 1rem 1.5rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: var(--transition);
    min-width: 75px;
}

.countdown-card:hover {
    border-color: var(--gold);
    box-shadow: 0 0 30px var(--gold-glow);
    transform: translateY(-3px);
}

.countdown-number {
    font-size: 2.2rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.countdown-label {
    display: block;
    margin-top: 0.5rem;
    color: var(--gray);
    font-size: 0.8rem;
    font-weight: 500;
}

/* CTA Button */
.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2.5rem;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: var(--bg-primary);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    border-radius: 50px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.hero-cta::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hero-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px var(--gold-glow);
}

.hero-cta:hover::before { opacity: 1; }

.hero-cta span,
.hero-cta svg {
    position: relative;
    z-index: 1;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
}

.scroll-arrow {
    width: 24px;
    height: 24px;
    border-right: 2px solid var(--gold);
    border-bottom: 2px solid var(--gold);
    transform: rotate(45deg);
    animation: scroll-bounce 2s ease-in-out infinite;
    opacity: 0.5;
}

@keyframes scroll-bounce {
    0%, 100% { transform: rotate(45deg) translateY(0); opacity: 0.5; }
    50% { transform: rotate(45deg) translateY(10px); opacity: 1; }
}

/* === Sections Common === */
.section-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section-title {
    font-size: 2.2rem;
    font-weight: 900;
    text-align: center;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-subtitle {
    text-align: center;
    color: var(--gray);
    font-size: 1.05rem;
    margin-bottom: 2.5rem;
}

/* === Reveal Animation === */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    transition-delay: var(--delay, 0s);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* === Details Section === */
.details-section {
    position: relative;
    z-index: 1;
    padding: 4rem 0;
    background: linear-gradient(180deg, transparent, rgba(212, 175, 55, 0.02), transparent);
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.2rem;
    margin-bottom: 2rem;
}

.detail-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius);
    padding: 1.5rem 1.2rem;
    text-align: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: var(--transition);
}

.detail-card:hover {
    border-color: rgba(212, 175, 55, 0.3);
    transform: translateY(-3px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.detail-icon {
    font-size: 2.2rem;
    margin-bottom: 0.8rem;
}

.detail-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 0.4rem;
}

.detail-card p {
    color: var(--gray-light);
    font-size: 0.9rem;
}

.detail-sub {
    color: var(--gray) !important;
    font-size: 0.8rem !important;
    margin-top: 0.2rem;
}

/* === Waze Button === */
.waze-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    width: fit-content;
    margin: 1.5rem auto;
    padding: 1rem 2.5rem;
    background: linear-gradient(135deg, #33ccff, #00a8e8);
    color: var(--white);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    border-radius: 50px;
    transition: var(--transition);
    box-shadow: 0 4px 20px rgba(51, 204, 255, 0.3);
}

.waze-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(51, 204, 255, 0.5);
}

.waze-icon { flex-shrink: 0; }

/* === Map === */
.map-container {
    margin: 1.5rem 0;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* === Gallery Section === */
.gallery-section {
    position: relative;
    z-index: 1;
    padding: 4rem 0;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.gallery-item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 3/4;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.gallery-item:hover img { transform: scale(1.1); }

/* === RSVP Section === */
.rsvp-section {
    position: relative;
    z-index: 1;
    padding: 4rem 0;
    background: linear-gradient(180deg, transparent, rgba(212, 175, 55, 0.03), transparent);
}

.rsvp-card {
    max-width: 500px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius);
    padding: 2rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Form Layout */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
}

.form-group { margin-bottom: 1rem; }

.form-group input[type="text"],
.form-group input[type="tel"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: var(--white);
    font-family: var(--font-main);
    font-size: 1rem;
    transition: var(--transition);
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--gold);
    box-shadow: 0 0 20px var(--gold-glow);
}

.form-group textarea {
    resize: vertical;
    min-height: 60px;
}

.form-group select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23d4af37' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 1rem center;
}

/* Attendance Options */
.attendance-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.attendance-option input { display: none; }

.option-card {
    padding: 1.5rem 1rem;
    text-align: center;
    border-radius: var(--radius);
    border: 2px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: var(--transition);
}

.option-card:hover { border-color: rgba(212, 175, 55, 0.3); }

.attendance-option input:checked + .option-yes {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
    box-shadow: 0 0 30px rgba(34, 197, 94, 0.15);
}

.attendance-option input:checked + .option-no {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.15);
}

.option-emoji {
    display: block;
    font-size: 2rem;
    margin-bottom: 0.3rem;
}

.option-text {
    font-weight: 600;
    font-size: 1rem;
}

/* Guests Group */
.guests-group { margin-bottom: 1rem; }

.guests-label {
    display: block;
    text-align: center;
    color: var(--gray-light);
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* Guest Counter */
.guest-counter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.counter-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid var(--gold);
    background: transparent;
    color: var(--gold);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-main);
}

.counter-btn:hover {
    background: var(--gold);
    color: var(--bg-primary);
}

.guest-counter input {
    width: 60px;
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    background: transparent;
    border: none;
    color: var(--gold);
    font-family: var(--font-main);
}

/* Buttons */
.btn {
    padding: 0.9rem 2rem;
    border: none;
    border-radius: 50px;
    font-family: var(--font-main);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-submit {
    width: 100%;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: var(--white);
    font-size: 1.1rem;
    padding: 1rem;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.btn-submit:hover {
    box-shadow: 0 5px 25px rgba(34, 197, 94, 0.4);
}

/* Success Message */
.success-message {
    text-align: center;
    padding: 2rem;
    animation: fadeInUp 0.6s ease;
}

.success-icon {
    font-size: 4rem;
    color: var(--gold);
    margin-bottom: 1rem;
    animation: pulse-glow 1.5s ease-in-out infinite;
}

.success-message h3 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 0.5rem;
}

.success-message p {
    color: var(--gray-light);
    font-size: 1.1rem;
}

/* === Footer === */
.footer {
    position: relative;
    z-index: 1;
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.footer-link {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.7rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 50px;
    color: var(--gray-light);
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.9rem;
}

.footer-link:hover {
    border-color: var(--gold);
    color: var(--gold);
    transform: translateY(-2px);
}

.footer-star {
    font-size: 1.5rem;
    color: var(--gold);
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

.footer p {
    color: var(--gray);
    font-size: 0.95rem;
}

/* === Confetti Canvas === */
.confetti-canvas {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
}

/* === Lightbox === */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    cursor: pointer;
}

.lightbox.active { opacity: 1; visibility: visible; }

.lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: var(--radius);
    transform: scale(0.9);
    transition: transform 0.4s ease;
}

.lightbox.active img { transform: scale(1); }

/* === Animations === */
@keyframes pulse-glow {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 10px var(--gold-glow)); }
    50% { transform: scale(1.1); filter: drop-shadow(0 0 25px var(--gold-glow)); }
}

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

/* === Responsive === */
@media (max-width: 768px) {
    .nav-links {
        gap: 1rem;
        font-size: 0.85rem;
    }

    .hero-photo-container {
        width: 170px;
        height: 170px;
    }

    .hero-parents { font-size: 1.2rem; }
    .hero-invite { font-size: 0.9rem; }

    .name-line { font-size: 2.5rem; }
    .name-line.family { font-size: 1.8rem; }

    .countdown-grid { gap: 0.6rem; }
    .countdown-card { padding: 0.8rem 1rem; min-width: 65px; }
    .countdown-number { font-size: 1.8rem; }
    .countdown-label { font-size: 0.7rem; }

    .section-title { font-size: 1.8rem; }

    .details-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.8rem;
    }

    .gallery-grid { gap: 0.5rem; }

    .rsvp-card { padding: 1.5rem; }
}

@media (max-width: 480px) {
    .nav-links {
        gap: 0.6rem;
        font-size: 0.75rem;
    }

    .hero-photo-container {
        width: 140px;
        height: 140px;
    }

    .hero-parents { font-size: 1.1rem; }

    .name-line { font-size: 2rem; }
    .name-line.family { font-size: 1.4rem; }

    .countdown-grid { gap: 0.4rem; }
    .countdown-card { padding: 0.6rem 0.7rem; min-width: 55px; }
    .countdown-number { font-size: 1.4rem; }

    .details-grid { grid-template-columns: 1fr; }

    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.4rem;
    }

    .section-title { font-size: 1.5rem; }

    .rsvp-card { padding: 1.2rem; }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
}
