/* Event RSVP Manager Frontend Styles */
/* Basic layout styles - detailed styling handled by theme-integration.css */

.erm-rsvp-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    line-height: 1.6;
    color: #333;
}

.erm-rsvp-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.erm-rsvp-header h1 {
    margin: 0 0 20px 0;
    font-size: 2.5em;
    font-weight: 300;
}

.erm-event-details {
    margin: 0;
    font-size: 1.1em;
    opacity: 0.9;
}

.erm-event-details strong {
    color: #fff;
}

/* RSVP form container should be centered and block */
.erm-rsvp-form-container {
    display: block;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    background: #fff;
    border-radius: 10px;
    padding: 40px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e5e9;
}

#erm-rsvp-form {
    display: block;
    width: 100%;
}

#erm-attendees-container, .erm-attendees-container {
    display: flex;
    flex-direction: column;
    gap: 32px;
    width: 100%;
}

/* Basic attendee section layout - detailed styling in theme-integration.css */
.erm-attendee-section {
    position: relative;
}

.erm-attendee-section h3 {
    margin-bottom: 18px;
    font-size: 1.2em;
    border-bottom: 1.5px solid #3498db;
    padding-bottom: 8px;
}

/* Attendee info row - contains name, dietary, special requirements */
.erm-attendee-info-row {
    margin-bottom: 20px;
}

/* Ensure no unwanted left margin on attendee inputs */
.erm-attendee-info-row .erm-form-row input,
.erm-attendee-info-row .erm-form-row textarea {
    margin-left: 0;
}

/* Desktop: Horizontal layout for attendee info fields */
@media (min-width: 1024px) {
    .erm-attendee-info-row {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 30px;
        align-items: start;
    }
    
    .erm-attendee-info-row .erm-form-row {
        display: flex;
        flex-direction: column;
        margin-bottom: 0;
        min-width: 0; /* Allow shrinking */
    }
    
    .erm-attendee-info-row .erm-form-row label {
        margin-bottom: 8px;
        font-weight: 600;
        color: #2c3e50;
        font-size: 0.95em;
        white-space: nowrap;
    }
    
    .erm-attendee-info-row .erm-form-row input,
    .erm-attendee-info-row .erm-form-row textarea {
        width: 100%;
        margin-bottom: 0;
        min-width: 0; /* Allow shrinking */
    }
}

/* Mobile: Vertical layout for attendee info */
@media (max-width: 1023px) {
    .erm-attendee-info-row {
        display: grid;
        grid-template-columns: 180px 1fr;
        gap: 18px 24px;
        align-items: start;
    }
    
    .erm-attendee-info-row .erm-form-row {
        display: contents;
    }
    
    .erm-attendee-info-row .erm-form-row label {
        grid-column: 1;
        align-self: center;
        margin-bottom: 0;
        font-weight: 600;
        color: #2c3e50;
        font-size: 0.95em;
        text-align: left;
    }
    
    .erm-attendee-info-row .erm-form-row input,
    .erm-attendee-info-row .erm-form-row textarea {
        grid-column: 2;
        margin-bottom: 0;
    }
}

/* Basic form row layout - detailed styling in theme-integration.css */
.erm-form-row {
    margin-bottom: 15px;
}

.erm-form-row label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.97em;
}

/* Basic input styling - detailed styling in theme-integration.css */
.erm-form-row input,
.erm-form-row select,
.erm-form-row textarea {
    width: 100%;
    margin-left: 0;
    box-sizing: border-box;
}

.erm-form-row textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

/* Button styling - ensure theme integration styles take precedence */
.erm-add-attendee {
    text-align: center;
    margin: 30px 0;
}

.erm-add-attendee .button {
    /* Let the theme handle all button styling - don't override anything */
}

.erm-form-submit {
    width: 100%;
    text-align: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #e9ecef;
}

.erm-form-submit .button {
    /* Let the theme handle all button styling - don't override anything */
}

/* Remove attendee button */
.erm-remove-attendee {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #e74c3c;
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    transition: background-color 0.3s ease;
}

.erm-remove-attendee:hover {
    background: #c0392b;
}

/* Form validation */
.erm-form-row input.error,
.erm-form-row select.error,
.erm-form-row textarea.error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

/* RSVP status row */
.erm-form-row.rsvp-status-row {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.erm-form-row.rsvp-status-row label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95em;
}

.erm-form-row.rsvp-status-row .erm-radio-group {
    display: flex;
    flex-direction: row;
    gap: 30px;
    flex-wrap: wrap;
}

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

.erm-radio-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 0;
}

.erm-radio-label {
    margin-left: 8px;
    cursor: pointer;
    font-size: 0.95em;
}

.erm-radio-option input[type="radio"] {
    margin-right: 8px;
}

.erm-form-row.error .erm-radio-group {
    border: 1px solid #e74c3c;
    padding: 10px;
    border-radius: 4px;
}

.erm-form-row.error .erm-radio-option {
    color: #e74c3c;
}

/* Improved Error Messages */
.erm-error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-left: 4px solid #e74c3c;
    color: #991b1b;
    padding: 16px 20px;
    border-radius: 8px;
    margin: 12px 0;
    font-size: 0.95em;
    line-height: 1.5;
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.15);
    font-family: 'Helvetica Neue', Helvetica, sans-serif;
}

.erm-error-message::before {
    content: "⚠";
    font-size: 1.3em;
    color: #e74c3c;
    flex-shrink: 0;
    margin-top: 2px;
    font-weight: bold;
}

.erm-error-message strong {
    font-weight: 600;
    color: #7f1d1d;
}

.erm-error-message p {
    margin: 0;
    padding: 0;
}

.erm-error-message ul {
    margin: 8px 0 0 0;
    padding-left: 20px;
}

.erm-error-message li {
    margin-bottom: 4px;
}

/* Field-specific error messages */
.erm-form-row .erm-error-message {
    margin-top: 8px;
    margin-bottom: 0;
    font-size: 0.9em;
    padding: 12px 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    color: #991b1b;
    box-shadow: 0 1px 4px rgba(231, 76, 60, 0.1);
}

.erm-form-row .erm-error-message::before {
    content: "•";
    color: #e74c3c;
    font-weight: bold;
    margin-right: 6px;
    font-size: 1.1em;
}

/* Form-level error messages */
#erm-messages .erm-error-message {
    margin: 24px 0;
    padding: 20px 24px;
    font-size: 1em;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-left: 4px solid #e74c3c;
    border-radius: 10px;
    color: #991b1b;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.15);
}

#erm-messages .erm-error-message::before {
    content: "⚠";
    font-size: 1.4em;
    color: #e74c3c;
    font-weight: bold;
    margin-right: 10px;
}

/* Success Messages */
.erm-success-message {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-left: 4px solid #22c55e;
    color: #166534;
    padding: 20px 24px;
    border-radius: 10px;
    margin: 24px 0;
    font-size: 1em;
    line-height: 1.6;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.15);
    font-family: 'Helvetica Neue', Helvetica, sans-serif;
}

.erm-success-message::before {
    content: "✓";
    font-size: 1.4em;
    color: #22c55e;
    font-weight: bold;
    flex-shrink: 0;
    margin-top: 2px;
}

.erm-success-message strong {
    font-weight: 600;
    color: #14532d;
}

.erm-success-message p {
    margin: 0;
    padding: 0;
}

.erm-loading {
    text-align: center;
    padding: 24px;
    color: #6c757d;
    background: #f8f9fa;
    border-radius: 10px;
    margin: 24px 0;
    border: 1px solid #e9ecef;
    font-family: 'Helvetica Neue', Helvetica, sans-serif;
    font-size: 1em;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.erm-loading::after {
    content: '';
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid #3498db;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s ease-in-out infinite;
    margin-left: 12px;
    vertical-align: middle;
}

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

.erm-token-form {
    max-width: 400px;
    margin: 0 auto;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.erm-token-form h2 {
    text-align: center;
    margin-bottom: 20px;
}

.erm-token-form input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 1em;
    margin-bottom: 15px;
}

.erm-token-form input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.erm-token-form .button {
    width: 100%;
    background: #3498db;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-size: 1em;
    cursor: pointer;
}

.erm-token-form .button:hover {
    background: #2980b9;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .erm-rsvp-container {
        padding: 10px;
    }
    
    .erm-rsvp-header {
        padding: 20px;
    }
    
    .erm-rsvp-header h1 {
        font-size: 2em;
    }
    
    .erm-rsvp-form-container {
        padding: 20px;
    }
    
    #erm-attendees-container, .erm-attendees-container {
        gap: 20px;
    }
    
    .erm-attendee-section {
        padding: 20px;
    }
    
    .erm-attendee-section h3 {
        font-size: 1.1em;
    }
    
    .erm-attendee-info-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .erm-attendee-info-row .erm-form-row label,
    .erm-attendee-info-row .erm-form-row input,
    .erm-attendee-info-row .erm-form-row textarea {
        grid-column: 1;
    }
    
    .erm-attendee-info-row .erm-form-row label {
        margin-bottom: 8px;
        text-align: left;
    }
    
    .erm-form-row label,
    .erm-form-row input,
    .erm-form-row select,
    .erm-form-row textarea {
        display: block;
        width: 100%;
    }
    
    .erm-form-row.rsvp-status-row label,
    .erm-form-row.rsvp-status-row .erm-radio-group {
        display: block;
        width: 100%;
    }
    
    .erm-radio-group {
        flex-direction: column;
        gap: 8px;
    }
    
    .erm-radio-option {
        margin-bottom: 8px;
    }
    
    .erm-form-submit .button {
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    .erm-rsvp-header h1 {
        font-size: 1.8em;
    }
    
    .erm-rsvp-form-container {
        padding: 15px;
    }
    
    .erm-attendee-section {
        padding: 15px;
    }
    
    .erm-form-submit .button {
        padding: 12px 20px;
        font-size: 1em;
    }
    
    .erm-radio-label {
        font-size: 0.9em;
    }
}

/* Focus states for accessibility */
.erm-form-row input:focus,
.erm-form-row select:focus,
.erm-form-row textarea:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .erm-rsvp-header {
        border: 2px solid #000;
    }
    
    .erm-form-row input,
    .erm-form-row select,
    .erm-form-row textarea {
        border: 2px solid #000;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .erm-form-row input,
    .erm-form-row select,
    .erm-form-row textarea {
        transition: none;
    }
    
    .erm-form-submit .button:hover {
        transform: none;
    }
} 