/* RSVP Modal Styles */
#rsvpModal {
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.4s ease-in-out;
}

/* Modal dialog centering and sizing */
#rsvpModal .modal-dialog {
    max-width: 500px;
    margin: auto;
    display: flex;
    align-items: center;
    min-height: calc(100vh - 2rem);
    padding: 1rem;
}

/* Modal content styling */
#rsvpModal .modal-content {
    background: linear-gradient(135deg, #ffffff 0%, #fefefe 100%);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    padding: 2.5rem;
    position: relative;
    width: 100%;
    margin: auto;
    border: 1px solid rgba(212, 163, 115, 0.2);
    transform: scale(0.95);
    animation: modalSlideIn 0.4s ease-out forwards;
}

/* Modal slide-in animation */
@keyframes modalSlideIn {
    from {
        transform: scale(0.95) translateY(-20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* Form styling */
#rsvpForm {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Form group styling */
#rsvpForm .mb-3 {
    margin-bottom: 0 !important;
}

/* Form labels */
#rsvpForm .form-label {
    font-family: "Playfair Display", serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.75rem;
    display: block;
}

/* Form inputs and select */
#rsvpForm .form-control {
    border: 2px solid #e8e8e8;
    border-radius: 12px;
    padding: 1rem;
    font-size: 1rem;
    font-family: "Roboto", sans-serif;
    transition: all 0.3s ease;
    width: 100%;
    background-color: #fafafa;
}

#rsvpForm .form-control:focus {
    border-color: #d4a373;
    box-shadow: 0 0 0 3px rgba(212, 163, 115, 0.1);
    outline: none;
    background-color: #ffffff;
    transform: translateY(-2px);
}

#rsvpForm .form-control:hover {
    border-color: #d4a373;
    background-color: #ffffff;
}

/* Select dropdown */
#rsvpForm select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d4a373' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.2rem;
    cursor: pointer;
}

/* Textarea */
#rsvpForm textarea.form-control {
    resize: vertical;
    min-height: 120px;
    font-family: "Roboto", sans-serif;
}

/* Submit button */
#rsvpForm .btn-primary {
    background: linear-gradient(135deg, #d4a373 0%, #c19654 100%);
    border: none;
    font-family: "Playfair Display", serif;
    font-size: 1.2rem;
    font-weight: 600;
    padding: 1rem 2rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    margin-top: 1rem;
    box-shadow: 0 4px 15px rgba(212, 163, 115, 0.4);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#rsvpForm .btn-primary:hover {
    background: linear-gradient(135deg, #c19654 0%, #a8804a 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(212, 163, 115, 0.6);
}

#rsvpForm .btn-primary:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(212, 163, 115, 0.4);
}

/* Close button */
#rsvpModal .btn-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #e8e8e8;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

#rsvpModal .btn-close svg {
    stroke: #666;
    width: 24px;
    height: 24px;
    transition: all 0.3s ease;
}

#rsvpModal .btn-close:hover {
    background: rgba(212, 163, 115, 0.1);
    border-color: #d4a373;
    transform: rotate(90deg) scale(1.1);
}

#rsvpModal .btn-close:hover svg {
    stroke: #d4a373;
}

/* Guest count group animation */
#guestCountGroup {
    transition: all 0.4s ease;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
}

#guestCountGroup[style*="display: block"] {
    max-height: 200px;
    opacity: 1;
}

/* Animation for modal fade-in */
@keyframes fadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(8px);
    }
}

/* Input validation states */
#rsvpForm .form-control:invalid {
    border-color: #e74c3c;
}

#rsvpForm .form-control:valid {
    border-color: #27ae60;
}

/* Loading state for submit button */
#rsvpForm .btn-primary:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #rsvpModal .modal-dialog {
        margin: 0.5rem;
        min-height: calc(100vh - 1rem);
        padding: 0.5rem;
    }

    #rsvpModal .modal-content {
        padding: 2rem;
        border-radius: 16px;
    }

    #rsvpForm .form-label {
        font-size: 1rem;
    }

    #rsvpForm .form-control {
        font-size: 1rem;
        padding: 0.875rem;
    }

    #rsvpForm .btn-primary {
        font-size: 1.1rem;
        padding: 0.875rem 1.5rem;
    }

    #rsvpModal .btn-close {
        top: 1rem;
        right: 1rem;
        width: 44px;
        height: 44px;
    }
}

@media (max-width: 480px) {
    #rsvpModal .modal-content {
        padding: 1.5rem;
        border-radius: 12px;
    }

    #rsvpForm .form-control {
        padding: 0.75rem;
    }

    #rsvpForm .btn-primary {
        font-size: 1rem;
        padding: 0.75rem 1.25rem;
    }
}

/* Focus management for accessibility */
#rsvpModal:focus-within .modal-content {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

/* Smooth transitions for all interactive elements */
#rsvpModal * {
    box-sizing: border-box;
}

/* Enhanced visual hierarchy */
#rsvpForm {
    counter-reset: step-counter;
}

#rsvpForm .mb-3::before {
    counter-increment: step-counter;
    content: counter(step-counter);
    position: absolute;
    left: -2.5rem;
    top: 0;
    width: 1.5rem;
    height: 1.5rem;
    background: linear-gradient(135deg, #d4a373 0%, #c19654 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    opacity: 0.7;
}

@media (max-width: 768px) {
    #rsvpForm .mb-3::before {
        display: none;
    }
}
