/**
 * Event Registration Form Styles
 *
 * @package Event_Registration
 */

/* ==========================================================================
   Base Styles & Reset
   ========================================================================== */

.event-registration-container * {
    box-sizing: border-box;
}

.event-registration-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    padding: 20px;
    min-height: 100vh;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.event-registration-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

@media (min-width: 1024px) {
    .event-registration-container {
        grid-template-columns: 2fr 1fr;
    }
}

.event-registration-form-wrapper {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.order-summary-sidebar {
    position: relative;
}

@media (min-width: 1024px) {
    .order-summary {
        position: sticky;
        top: 20px;
    }
}

/* ==========================================================================
   Form Styles
   ========================================================================== */

.event-registration-form {
    padding: 30px;
}

/* Currency Selector */
.currency-selector {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border: 1px solid #e9ecef;
}

.currency-selector label {
    font-weight: 600;
    margin-right: 15px;
    color: #495057;
}

.currency-selector select {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    background: #fff;
    font-size: 14px;
    min-width: 200px;
}

/* Section Headers */
.billing-section h2,
.attendees-section h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
    font-size: 24px;
    font-weight: 600;
}

/* Form Groups */
.form-section {
    margin-bottom: 30px;
    padding: 20px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background: #fafafa;
}

.form-section h4 {
    color: #495057;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (min-width: 768px) {
    .form-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.required {
    color: #e74c3c;
    font-weight: bold;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Radio Groups */
.radio-group {
    display: flex;
    gap: 20px;
    margin-top: 8px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: normal;
}

.radio-label input[type="radio"] {
    width: auto;
    margin: 0;
}

/* ==========================================================================
   Attendee Form Styles
   ========================================================================== */

.attendees-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.attendee-count {
    background: #3498db;
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.attendee-form {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.attendee-form:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.attendee-header {
    background: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.attendee-title {
    margin: 0;
    color: #495057;
    font-size: 16px;
    font-weight: 600;
}

.attendee-actions {
    display: flex;
    gap: 10px;
}

.btn-toggle-form,
.btn-remove-attendee {
    background: none;
    border: 1px solid #ced4da;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.btn-remove-attendee {
    color: #e74c3c;
    border-color: #e74c3c;
}

.btn-remove-attendee:hover {
    background: #e74c3c;
    color: #fff;
}

.attendee-form-content {
    padding: 20px;
}

/* Student ID Upload */
.student-id-upload {
    margin-top: 15px;
}

.file-upload-wrapper {
    border: 2px dashed #ced4da;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: border-color 0.3s ease;
}

.file-upload-wrapper:hover {
    border-color: #3498db;
}

.file-upload-info {
    margin-top: 10px;
    color: #6c757d;
}

.file-preview {
    margin-top: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
}

.file-actions {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* Ticket Type Display */
.ticket-type-display {
    background: #e8f4f8;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #3498db;
}

.ticket-type-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ticket-type-name {
    font-weight: 600;
    color: #2c3e50;
}

.ticket-type-price {
    font-weight: bold;
    color: #27ae60;
    font-size: 16px;
}

/* ==========================================================================
   Pricing Section
   ========================================================================== */

.pricing-section {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
}

.coupon-group {
    margin-bottom: 20px;
}

.coupon-input-wrapper {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.coupon-input-wrapper input {
    flex: 1;
}

.btn-apply-coupon {
    background: #28a745;
    color: #fff;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.btn-apply-coupon:hover {
    background: #218838;
}

.coupon-result {
    margin-top: 10px;
    padding: 10px;
    border-radius: 4px;
    font-size: 14px;
}

.coupon-result.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.coupon-result.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.price-display {
    background: #fff;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.price-breakdown {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.price-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price-line.final-price {
    font-weight: bold;
    font-size: 16px;
    padding-top: 8px;
    border-top: 1px solid #e9ecef;
    color: #27ae60;
}

/* ==========================================================================
   Order Summary Styles
   ========================================================================== */

.order-summary {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.order-summary-header {
    background: #2c3e50;
    color: #fff;
    padding: 20px;
    text-align: center;
}

.order-summary-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.order-summary-content {
    padding: 20px;
}

.currency-selector-summary .currency-options {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.currency-option {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    font-size: 14px;
}

.summary-section {
    margin-bottom: 20px;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
}

.summary-line .label {
    font-weight: 600;
    color: #495057;
}

.summary-line .value {
    font-weight: bold;
    color: #2c3e50;
}

.summary-divider {
    height: 1px;
    background: #e9ecef;
    margin: 20px 0;
}

.attendees-summary {
    min-height: 100px;
}

.attendee-summary-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    border: 1px solid #e9ecef;
}

.attendee-info {
    margin-bottom: 10px;
}

.attendee-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.attendee-details {
    font-size: 14px;
    color: #6c757d;
}

.coupon-info {
    display: block;
    margin-top: 5px;
    color: #28a745;
    font-weight: 600;
}

.attendee-pricing {
    border-top: 1px solid #e9ecef;
    padding-top: 10px;
}

.total-section {
    background: #e8f4f8;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.total-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 18px;
}

.total-line .label {
    font-weight: bold;
    color: #2c3e50;
}

.total-line .value {
    font-weight: bold;
    color: #27ae60;
    font-size: 24px;
}

.checkout-section {
    text-align: center;
    margin-top: 30px;
}

.checkout-note {
    margin-top: 10px;
    font-size: 12px;
    color: #6c757d;
}

/* ==========================================================================
   Button Styles
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    justify-content: center;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: #3498db;
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background: #2980b9;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #95a5a6;
    color: #fff;
}

.btn-secondary:hover:not(:disabled) {
    background: #7f8c8d;
}

.btn-large {
    padding: 16px 32px;
    font-size: 16px;
}

.add-attendee-container {
    text-align: center;
    margin: 30px 0;
}

.attendee-limit-notice {
    display: block;
    margin-top: 10px;
    color: #6c757d;
    font-size: 12px;
}

.form-submit {
    text-align: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #e9ecef;
}

/* ==========================================================================
   Summary Details
   ========================================================================== */

.summary-details {
    margin-top: 20px;
}

.btn-toggle-details {
    background: none;
    border: none;
    color: #3498db;
    cursor: pointer;
    font-size: 14px;
    padding: 10px 0;
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
}

.details-content {
    margin-top: 15px;
}

.price-structure,
.event-info,
.terms-info {
    margin-bottom: 20px;
}

.price-structure h4,
.event-info h4,
.terms-info h4 {
    color: #495057;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 600;
}

.price-table {
    background: #f8f9fa;
    border-radius: 4px;
    overflow: hidden;
}

.price-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 10px;
    padding: 8px 12px;
    border-bottom: 1px solid #e9ecef;
    font-size: 12px;
}

.price-row:last-child {
    border-bottom: none;
}

.ticket-type {
    color: #495057;
}

.price-thb,
.price-usd {
    text-align: right;
    font-weight: 600;
}

.event-details p,
.terms-content ul {
    margin: 0;
    font-size: 12px;
    color: #6c757d;
}

.terms-content ul {
    padding-left: 20px;
}

/* ==========================================================================
   Loading & Messages
   ========================================================================== */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loading-spinner-small {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-overlay p {
    color: #fff;
    font-size: 16px;
    margin: 0;
}

.error-messages,
.success-messages {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.error-messages {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.success-messages {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.no-attendees {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.loading-summary {
    text-align: center;
    padding: 20px;
    color: #6c757d;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .event-registration-container {
        padding: 10px;
        grid-template-columns: 1fr;
    }
    
    .event-registration-form {
        padding: 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .radio-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .coupon-input-wrapper {
        flex-direction: column;
    }
    
    .attendee-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .attendee-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .order-summary {
        margin-top: 30px;
    }
    
    .price-row {
        grid-template-columns: 1fr;
        gap: 5px;
        text-align: left;
    }
    
    .price-thb,
    .price-usd {
        text-align: left;
    }
}

@media (max-width: 480px) {
    .event-registration-container {
        padding: 5px;
    }
    
    .event-registration-form {
        padding: 15px;
    }
    
    .order-summary-content {
        padding: 15px;
    }
    
    .btn-large {
        padding: 14px 24px;
        font-size: 14px;
    }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
.btn:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .event-registration-container {
        border: 2px solid #000;
    }
    
    .form-group input,
    .form-group select {
        border: 2px solid #000;
    }
}

/* Print styles */
@media print {
    .order-summary-sidebar {
        display: none;
    }
    
    .attendee-actions,
    .add-attendee-container,
    .form-submit {
        display: none;
    }
    
    .attendee-form {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}
