/**
 * Membership RSVP - Frontend Styles
 * Supports both RSVP form and Check-in form.
 */

/* Container */
.mrsvp-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 24px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    color: #333;
    line-height: 1.6;
}

/* Event Header */
.mrsvp-event-header {
    background: linear-gradient(135deg, #1e3a5f 0%, #2c5282 100%);
    color: #fff;
    padding: 32px;
    border-radius: 12px;
    margin-bottom: 24px;
    text-align: center;
}

.mrsvp-event-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 12px 0;
    color: #fff;
}

.mrsvp-event-date,
.mrsvp-event-location {
    font-size: 16px;
    margin: 4px 0;
    opacity: 0.9;
}

/* Check-in Header */
.mrsvp-checkin-header {
    background: linear-gradient(135deg, #22543d 0%, #276749 100%);
}

.mrsvp-checkin-subtitle {
    font-size: 18px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0 0 12px 0;
    opacity: 0.9;
}

/* Steps */
.mrsvp-step {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.mrsvp-step h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 16px 0;
    color: #1e3a5f;
    padding-bottom: 8px;
    border-bottom: 2px solid #e2e8f0;
}

/* Search Form */
.mrsvp-search-form {
    display: flex;
    gap: 12px;
    align-items: center;
}

.mrsvp-search-form input[type="text"] {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s;
    outline: none;
}

.mrsvp-search-form input[type="text"]:focus {
    border-color: #2c5282;
}

/* Buttons */
.mrsvp-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.mrsvp-btn-primary {
    background: #2c5282;
    color: #fff;
}

.mrsvp-btn-primary:hover {
    background: #1e3a5f;
}

.mrsvp-btn-secondary {
    background: #e2e8f0;
    color: #333;
}

.mrsvp-btn-secondary:hover {
    background: #cbd5e0;
}

/* Check-in specific button */
.mrsvp-checkin-container .mrsvp-btn-primary {
    background: #276749;
}

.mrsvp-checkin-container .mrsvp-btn-primary:hover {
    background: #22543d;
}

/* Member Info */
.mrsvp-member-info,
.mrsvp-partner-info,
.mrsvp-dependents-info {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.mrsvp-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.mrsvp-info-item {
    display: flex;
    flex-direction: column;
}

.mrsvp-info-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: #718096;
    margin-bottom: 2px;
}

.mrsvp-info-value {
    font-size: 16px;
    font-weight: 500;
    color: #2d3748;
}

/* Section titles within info blocks */
.mrsvp-section-title {
    font-size: 16px;
    font-weight: 600;
    color: #2c5282;
    margin: 0 0 12px 0;
}

/* Dependents list */
.mrsvp-dependent-item {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 8px;
}

.mrsvp-dependent-item:last-child {
    margin-bottom: 0;
}

/* Form Groups */
.mrsvp-form-group {
    margin-bottom: 20px;
}

.mrsvp-form-group label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
}

.mrsvp-radio-group {
    display: flex;
    gap: 20px;
}

.mrsvp-radio-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 400;
    cursor: pointer;
}

.mrsvp-radio-group input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: #2c5282;
}

.mrsvp-form-group select {
    padding: 10px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    min-width: 120px;
    outline: none;
}

.mrsvp-form-group select:focus {
    border-color: #2c5282;
}

/* Dependent Checkboxes */
.mrsvp-dependent-checkboxes {
    margin-top: 10px;
}

.mrsvp-dependent-checkboxes label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-bottom: 6px;
    cursor: pointer;
    font-weight: 400;
    transition: background 0.2s;
}

.mrsvp-dependent-checkboxes label:hover {
    background: #edf2f7;
}

.mrsvp-dependent-checkboxes input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #2c5282;
}

/* Accommodation Info */
.mrsvp-accommodation-info {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 15px;
}

.mrsvp-accommodation-granted {
    background: #c6f6d5;
    border: 1px solid #68d391;
    color: #22543d;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.mrsvp-accommodation-denied {
    background: #fed7d7;
    border: 1px solid #fc8181;
    color: #742a2a;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.mrsvp-accommodation-info .mrsvp-accommodation-icon {
    font-size: 20px;
    margin-right: 8px;
}

/* Confirmation */
.mrsvp-step-confirmation {
    text-align: center;
}

.mrsvp-step-confirmation h3 {
    color: #22543d;
    border-bottom-color: #68d391;
}

#mrsvp-confirmation-details {
    text-align: left;
    background: #f7fafc;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.mrsvp-confirmation-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
}

.mrsvp-confirmation-item:last-child {
    border-bottom: none;
}

/* Check-in note on RSVP confirmation */
.mrsvp-checkin-note {
    background: #bee3f8;
    border: 1px solid #63b3ed;
    color: #2a4365;
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 15px;
    font-weight: 500;
    text-align: center;
}

/* Check-in Result */
.mrsvp-checkin-result {
    text-align: center;
}

.mrsvp-checkin-result h3 {
    margin: 0 0 8px 0;
}

.mrsvp-checkin-result p {
    margin: 4px 0;
}

/* Badges (reused from admin for dependent status display) */
.mrsvp-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.mrsvp-badge-active {
    background: #d1fae5;
    color: #065f46;
}

.mrsvp-badge-non-active {
    background: #fee2e2;
    color: #991b1b;
}

/* Error & Loading */
.mrsvp-error {
    background: #fed7d7;
    color: #742a2a;
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 12px;
    font-size: 14px;
}

.mrsvp-loading {
    color: #718096;
    font-style: italic;
    padding: 12px 0;
}

/* Already submitted notice */
.mrsvp-already-submitted {
    background: #bee3f8;
    border: 1px solid #63b3ed;
    color: #2a4365;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

/* Print styles */
@media print {
    /* Remove page header and footer */
    @page {
        margin: 15mm;
    }

    /* Hide everything by default */
    body,
    body > * {
        display: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Re-enable display for the chain from body down to the result content */
    body {
        display: block !important;
    }

    /* Show the WordPress content wrapper chain — common theme wrappers */
    body > #page,
    body > #wrapper,
    body > .site,
    body > .wp-site-blocks,
    body > div,
    #page > *,
    #wrapper > *,
    .site > *,
    .wp-site-blocks > *,
    #content,
    #primary,
    #main,
    .site-content,
    .entry-content,
    .page-content,
    .post-content,
    article,
    .type-page,
    .hentry {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        box-shadow: none !important;
        background: none !important;
        position: static !important;
        width: 100% !important;
        max-width: 100% !important;
        float: none !important;
    }

    /* Hide site header, footer, sidebar, nav */
    header,
    footer,
    nav,
    .site-header,
    .site-footer,
    .sidebar,
    .widget-area,
    #secondary,
    .navigation,
    .nav-links,
    .page-title,
    .entry-title,
    .entry-header,
    .entry-footer,
    .comments-area,
    .wp-block-template-part,
    #masthead,
    #colophon,
    .admin-bar #wpadminbar {
        display: none !important;
    }

    /* Show the MRSVP container */
    .mrsvp-container {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        position: static !important;
    }

    /* Hide search step and all buttons */
    .mrsvp-step-search,
    #mrsvp-status-step-search,
    .mrsvp-btn,
    .mrsvp-btn-secondary,
    .mrsvp-btn-primary,
    .mrsvp-search-form,
    #mrsvp-status-print-btn,
    #mrsvp-status-new-search-btn {
        display: none !important;
    }

    /* Show the result area */
    #mrsvp-status-result {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    #mrsvp-status-result-content {
        display: block !important;
    }

    .mrsvp-step {
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Ensure tables print nicely */
    .mrsvp-participants-table {
        width: 100% !important;
    }

    .mrsvp-info-grid {
        page-break-inside: avoid;
    }
}

/* Responsive */
@media (max-width: 600px) {
    .mrsvp-container {
        padding: 12px;
    }

    .mrsvp-event-header {
        padding: 20px;
    }

    .mrsvp-event-title {
        font-size: 22px;
    }

    .mrsvp-search-form {
        flex-direction: column;
    }

    .mrsvp-search-form input[type="text"],
    .mrsvp-search-form .mrsvp-btn {
        width: 100%;
    }

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

    .mrsvp-radio-group {
        flex-direction: column;
        gap: 10px;
    }

    .mrsvp-confirmation-item {
        flex-direction: column;
        gap: 2px;
    }
}