/* ============================================
   event_forms.css
   Forms, RSVP Sections, and Comments
   ============================================ */

/* ============================================
   Forms & RSVP Sections
   ============================================ */
.rsvp-section {
    background: transparent;
    border: none;
    padding: 2.5rem 0;
}

.rsvp-form-container {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Form Controls */
.form-control,
.form-select {
    border: 1.5px solid #e1e5eb;
    border-radius: 8px;
    padding: 0.625rem 0.875rem;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background-color: #fafbfc;
}

.form-control:focus,
.form-select:focus {
    background: white;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.15rem rgba(91, 124, 153, 0.15);
    outline: none;
}

.form-control::placeholder {
    color: #adb5bd;
}

/* Invalid state */
.form-control.is-invalid,
.form-select.is-invalid {
    border-color: var(--danger-color);
}

.invalid-feedback {
    color: var(--danger-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: none;
}

.form-control.is-invalid ~ .invalid-feedback,
.form-select.is-invalid ~ .invalid-feedback {
    display: block;
}

/* Form Labels */
.form-label {
    font-weight: 500;
    color: var(--text-on-light);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-label .required {
    color: var(--danger-color);
    margin-left: 0.25rem;
}

/* Floating Labels */
.form-floating {
    position: relative;
}

.form-floating > .form-control {
    padding: 1.625rem 0.75rem 0.625rem;
    line-height: 1.25;
}

.form-floating > label {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    padding: 1rem 0.75rem;
    pointer-events: none;
    border: 1px solid transparent;
    transform-origin: 0 0;
    transition: opacity 0.1s ease-in-out, transform 0.1s ease-in-out;
}

.form-floating > .form-control::placeholder {
    color: transparent;
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
    opacity: 0.65;
    transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
    color: var(--primary-color);
}

/* Form Groups */
.mb-3 {
    margin-bottom: 1rem;
}

/* Buttons */
.btn {
    padding: 0.625rem 1.25rem;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #4A6785;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(91, 124, 153, 0.3);
}

.btn-success {
    background: var(--success-color);
    color: white;
    font-weight: 600;
}

.btn-success:hover {
    background: #3A6348;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 124, 89, 0.3);
}

/* Registered/Accepted state buttons */
.btn-success[disabled],
.btn-registered {
    background: linear-gradient(135deg, var(--success-color), #5A8D68);
    color: white;
    opacity: 1;  /* Full opacity for better visibility */
    cursor: default;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(74, 124, 89, 0.2);
}

.btn-success[disabled]:hover,
.btn-registered:hover {
    transform: none;  /* No hover effect for disabled state */
    background: linear-gradient(135deg, var(--success-color), #5A8D68);
}

/* Waitlisted state */
.btn-warning {
    background: var(--warning-color);
    color: var(--dark-color);
    font-weight: 600;
}

.btn-warning[disabled] {
    background: linear-gradient(135deg, var(--warning-color), #D4B865);
    color: var(--dark-color);
    opacity: 1;
    cursor: default;
    box-shadow: 0 2px 8px rgba(244, 162, 97, 0.2);
}

/* Info state */
.btn-info {
    background: var(--info-color);
    color: white;
    font-weight: 600;
}

.btn-info[disabled] {
    background: linear-gradient(135deg, var(--info-color), #5A88B8);
    color: white;
    opacity: 1;
    cursor: default;
    box-shadow: 0 2px 8px rgba(108, 155, 209, 0.2);
}

.btn-secondary {
    background: var(--secondary-color);
    color: var(--text-on-light);
}

.btn-secondary:hover {
    background: #D8DDE3;
    transform: translateY(-1px);
}

.btn-outline-primary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
}

/* General disabled state (for other buttons) */
.btn[disabled]:not(.btn-success):not(.btn-warning):not(.btn-info) {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Submit button loading state */
.btn-submit[disabled] {
    position: relative;
    color: transparent;
}

.btn-submit[disabled]::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
}

/* ============================================
   Attendance Options (Checkboxes)
   ============================================ */

/* Refined Attendance Options Styling */
.attendance-options {
    background: rgba(247, 249, 251, 0.4) !important; /* Very subtle background */
    border: 1px solid rgba(91, 124, 153, 0.08) !important; /* Almost invisible border */
    border-radius: 10px !important;
    padding: 1.25rem !important;
    margin: 1.5rem 0 !important;
    transition: all 0.3s ease;
}

/* Subtle hover effect to show it's interactive */
.attendance-options:hover {
    background: rgba(247, 249, 251, 0.6) !important;
    border-color: rgba(91, 124, 153, 0.15) !important;
}

/* Less prominent heading */
.attendance-options h5 {
    color: var(--primary-color) !important;
    font-size: 0.95rem !important; /* Smaller than before */
    font-weight: 600 !important;
    margin-bottom: 1rem !important;
    opacity: 0.85; /* Slightly faded */
}

/* Checkbox styling refinement */
.attendance-options .form-check {
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem !important;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.attendance-options .form-check:hover {
    background: rgba(91, 124, 153, 0.03);
}

/* Checkbox label improvements */
.attendance-options .form-check-label {
    color: var(--text-on-light);
    font-size: 0.95rem;
    cursor: pointer;
}

.attendance-options .form-check-label span {
    font-weight: 500;
    color: var(--text-on-light);
}

.attendance-options .form-check-label small {
    color: var(--muted-text);
    opacity: 0.8;
    font-size: 0.825rem;
    margin-top: 0.25rem;
}

/* Custom checkbox styling for better integration */
.attendance-options .form-check-input {
    border-color: rgba(91, 124, 153, 0.3);
    background-color: transparent;
}

.attendance-options .form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.attendance-options .form-check-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(91, 124, 153, 0.15);
}

/* Alternative minimal style - if you want even less prominence */
.attendance-options.minimal {
    background: transparent !important;
    border: none !important;
    border-top: 1px solid rgba(91, 124, 153, 0.1) !important;
    border-radius: 0 !important;
    padding: 1.5rem 0 !important;
}

.attendance-options.minimal h5 {
    font-size: 0.9rem !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--muted-text) !important;
}

/* For direct page arrivals - make the form header more prominent */
.rsvp-page-direct .rsvp-hero-section {
    padding: 3.5rem 2.5rem 2.5rem;
    background: linear-gradient(135deg,
        var(--primary-color) 0%,
        #3d5368 100%);
}

.rsvp-page-direct .rsvp-main-title {
    font-size: 2.25rem;
    margin-bottom: 0.75rem;
}

.rsvp-page-direct .event-info-bar {
    padding-top: 0.5rem;
    margin-top: 1rem;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .attendance-options {
        margin: 1rem 0 !important;
        padding: 1rem !important;
    }

    .attendance-options h5 {
        font-size: 0.9rem !important;
    }

    .attendance-options .form-check-label {
        font-size: 0.9rem;
    }
}

/* Checkbox container styling */
.form-check {
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: white;
    border-radius: 8px;
    border: 1px solid rgba(91, 124, 153, 0.15);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

/* Hover state */
.form-check:hover {
    background: rgba(91, 124, 153, 0.05);
    border-color: rgba(91, 124, 153, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(91, 124, 153, 0.1);
}

/* When checkbox is checked */
.form-check:has(.form-check-input:checked) {
    background: rgba(91, 124, 153, 0.08);
    border-color: rgba(91, 124, 153, 0.4);
    box-shadow: 0 0 0 3px rgba(91, 124, 153, 0.05);
}

/* Hover on checked state */
.form-check:has(.form-check-input:checked):hover {
    background: rgba(91, 124, 153, 0.12);
    border-color: rgba(91, 124, 153, 0.5);
    box-shadow: 0 0 0 3px rgba(91, 124, 153, 0.08);
}

/* Checkbox input styling */
.form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.125rem;
    border: 2px solid #dee2e6;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    z-index: 2;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transform: scale(1.05);
}

/* Label styling */
.form-check-label {
    font-weight: 500;
    color: var(--text-on-light);
    cursor: pointer;
    margin-left: 0.5rem;
    transition: color 0.2s ease;
    display: block;
    padding-left: 1.75rem;
    user-select: none;
}

.form-check:hover .form-check-label {
    color: var(--primary-color);
}

.form-check-label small {
    display: block;
    color: var(--muted-text);
    font-weight: 400;
    margin-top: 0.25rem;
    font-size: 0.875rem;
}

/* Add a subtle animation when checked */
@keyframes checkPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1.05); }
}

.form-check-input:checked {
    animation: checkPulse 0.3s ease;
}

/* ============================================
   Comments Section
   ============================================ */
.comments-section {
    background: transparent;
    margin-bottom: 1.5rem;
}

.comments-section h5 {
    color: var(--text-on-light);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
}

.comments-section h5::before {
    content: "💬";
    margin-right: 0.5rem;
    font-size: 1.1rem;
}

.comments-section .form-control {
    border: 1.5px solid #e1e5eb;
    border-radius: 8px;
    font-size: 1rem;
    resize: vertical;
    min-height: 80px;
    background-color: #fafbfc;
    padding: 0.75rem;
    transition: all 0.2s ease;
}

.comments-section .form-control:focus {
    background: white;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.15rem rgba(91, 124, 153, 0.15);
}

.comments-section .form-control::placeholder {
    color: #adb5bd;
    font-size: 0.95rem;
}

/* ============================================
   Logged-in User Info
   ============================================ */
.logged-in-info {
    text-align: center;
    padding: 1.5rem 0;
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.7),
        rgba(232, 236, 240, 0.3)
    );
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 2px dotted var(--primary-color);
}

.logged-in-info .user-avatar {
    width: 72px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
}

.logged-in-info h5 {
    color: var(--text-on-light);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.logged-in-info p {
    color: var(--muted-text);
    margin-bottom: 1.5rem;
}

.logged-in-info .attendance-options,
.logged-in-info .comments-section {
    text-align: left;
}

/* ============================================
   Form Validation
   ============================================ */
.needs-validation .form-control:invalid,
.needs-validation .form-select:invalid {
    border-color: var(--danger-color);
}

.needs-validation .form-control:valid,
.needs-validation .form-select:valid {
    border-color: var(--success-color);
}

/* ============================================
   Google Sign-in Button
   ============================================ */
.btn-google {
    background: linear-gradient(135deg, #FFFFFF 0%, #FAFBFC 100%);
    color: #3c4043;
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 0.875rem 2rem;
    border-radius: 24px;
    font-weight: 600;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.875rem;
    transition: all 0.3s ease;
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.08),
        0 1px 3px rgba(0, 0, 0, 0.06),
        inset 0 1px 2px rgba(255, 255, 255, 1);
    max-width: fit-content;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.btn-google:hover {
    background: linear-gradient(135deg, #FFFFFF 0%, #F3F4F6 100%);
    border-color: rgba(66, 133, 244, 0.3);
    transform: translateY(-2px);
    box-shadow:
        0 8px 24px rgba(66, 133, 244, 0.15),
        0 4px 12px rgba(0, 0, 0, 0.08),
        inset 0 1px 2px rgba(255, 255, 255, 1);
    color: #1a73e8;
}

.btn-google:active {
    transform: translateY(0);
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.08),
        inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-google img {
    width: 22px;
    height: 22px;
    margin-right: 0.25rem;
}

.btn-google span {
    letter-spacing: 0.25px;
}

/* Center the Google button in its container */
.google-signin-container {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}

/* Alternative styling for when it's in a card */
.card-body .btn-google {
    margin: 1.5rem auto;
    display: flex;
}

/* Tab pane content */
.tab-pane {
    padding-top: 0;  /* Removed padding-top */
}

/* Page Hero Section (RSVP Tab) */
.page-hero {
    background: linear-gradient(135deg,
        rgba(247, 249, 251, 0.8),
        rgba(232, 236, 240, 0.6)
    );
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    margin-top: 2rem;  /* Add some spacing from tabs */
    text-align: left;  /* Left align content */
}

.page-hero h3 {
    color: var(--primary-color);  /* Use primary color instead of black */
    font-weight: 600;
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
    text-align: left;
}

.page-hero .text-muted {
    color: var(--text-description);
    font-size: 1rem;
    text-align: left;
    opacity: 0.85;
}

/* Ensure proper checkbox interaction */
.form-check * {
    pointer-events: auto;
}

/* One-click RSVP container styling */
.one-click-rsvp-container {
    text-align: center;
    padding: 2rem 1rem;
}

.one-click-rsvp-container h4 {
    color: var(--text-on-light);
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.one-click-rsvp-container p {
    color: var(--muted-text);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

/* RSVP Form Container Heading */
.rsvp-form-container h4 {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-align: left;
}

.rsvp-form-container .text-muted {
    color: var(--text-description);
    opacity: 0.85;
    margin-bottom: 1.5rem;
    text-align: left;
}
