/* Participant Controls and Form Styles - Design System Integration */

/* Design tokens are loaded separately via design-tokens.css */
/* This file now uses the centralized token system */

/* Participant Controls */
.participant-controls {
    display: flex;
    align-items: center;
    gap: var(--ers-space-3);
    margin-top: var(--ers-space-4);
}

.participant-controls button {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    border: 2px solid #F26522;
    background: transparent;
    color: #F26522;
    font-size: 1.25rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.participant-controls button:hover:not(:disabled) {
    background: var(--ers-color-primary);
    color: var(--ers-color-bg-body);
}

.participant-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.participant-count {
    font-size: var(--ers-font-size-lg);
    font-weight: var(--ers-font-weight-bold);
    color: var(--ers-color-text-primary);
    min-width: var(--ers-space-8);
    text-align: center;
}

/* Participant Form Card */
.participant-form-card {
    background: #111111;
    border: 1px solid #F26522;
    border-radius: 1rem;
    padding: 2rem;
    margin-top: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    position: relative;
    width: 100%;
    max-width: 100%;
}

/* Form Header */
.form-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
    grid-column: 1 / -1;
}

.form-header .programme-section__heading {
    margin: 0;
    flex: 0 1 auto;
    text-align: left;
}

/* Delete Button */
.delete-participant-btn {
    background: transparent;
    border: 2px solid #ff4444;
    color: #ff4444;
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.25rem;
    font-weight: bold;
    margin-left: 1rem;
    flex-shrink: 0;
}

.delete-participant-btn:hover {
    background: #ff4444;
    color: #ffffff;
    transform: scale(1.1);
}

.delete-icon {
    line-height: 1;
}

.participant-form-card .programme-section__heading {
    font-family: var(--ers-font-family-heading);
    font-weight: 400 !important;
    letter-spacing: var(--ers-letter-spacing-anton) !important;
    font-size: 1.5rem;
    color: #F26522;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Participant Forms Container */
.participant-forms {
    width: 100%;
    max-width: 100%;
}

/* Form Grid Layout */
.participant-form-card {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
    width: 100% !important;
    box-sizing: border-box;
}

.participant-form-card .participant-form {
    display: contents; /* Makes the form div not affect grid layout */
}

@media (min-width: 768px) {
    .participant-form-card {
        grid-template-columns: 1fr 1fr !important;
        gap: 1rem 1.5rem !important;
    }
    
    /* Ensure form fields don't have unexpected widths */
    .participant-form-card .ers-form-group:not(.full-width) {
        grid-column: span 1;
    }
}

/* Form Groups */
.ers-form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
    grid-column: span 1;
}

.ers-form-group.full-width {
    grid-column: 1 / -1 !important;
}

/* Section headings should span full width */
.ers-section-heading {
    grid-column: 1 / -1;
}

/* Ensure specific form elements span correctly */
.participant-form-card .form-header {
    grid-column: 1 / -1; /* Form header spans full width */
}

/* Debug: Uncomment to visualize grid layout during development */
/*
.participant-form-card {
    border: 2px dashed red !important;
}
.ers-form-group {
    border: 1px dashed blue !important;
}
*/

/* Labels */
.ers-label {
    font-family: var(--ers-font-family-heading);
    font-weight: 400 !important;
    letter-spacing: var(--ers-letter-spacing-anton) !important;
    font-size: 0.875rem;
    font-weight: 400;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

/* Inputs */
.ers-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--secondary-40);
    border-radius: 0.5rem;
    background: #111111;
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.2;
    transition: all 0.3s ease;
    outline: none;
    box-sizing: border-box;
    min-width: 0; /* Prevents flex/grid items from overflowing */
}

.ers-input::placeholder {
    color: #b0b0b0;
    opacity: 0.7;
}

.ers-input:focus {
    border-color: #F26522;
    box-shadow: 0 0 0 3px rgba(242, 101, 34, 0.1);
    transform: translateY(-1px);
}

.ers-input:hover {
    border-color: #F26522;
    transform: translateY(-1px);
}

.ers-input.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.ers-input.success {
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

/* Field Error Messages */
.field-error {
    color: #ef4444;
    font-size: 0.75rem;
    margin-top: 0.25rem;
    min-height: 1rem;
    display: none;
}

.field-error.show {
    display: block;
    animation: slideIn 0.3s ease-out;
}

.field-success {
    color: #22c55e;
    font-size: 0.75rem;
    margin-top: 0.25rem;
    min-height: 1rem;
    display: none;
}

.field-success.show {
    display: block;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Section Headings */
.ers-section-heading {
    font-family: var(--ers-font-family-heading);
    font-weight: 400 !important;
    letter-spacing: var(--ers-letter-spacing-anton) !important;
    font-size: 1.125rem;
    font-weight: bold;
    color: #F26522;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 1.5rem 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #F26522;
    grid-column: 1 / -1;
}

/* Vehicle elements should span full width */
.vehicle-divider,
.vehicle-heading {
    grid-column: 1 / -1;
}

/* Vehicle field display states */
.vehicle-heading {
    display: none;
}

.vehicle-heading.show {
    display: block;
}

.vehicle-field {
    display: none;
}

.vehicle-field.show {
    display: block;
}

/* Divider */
.ers-divider {
    height: 2px;
    background: #F26522;
    border: none;
    border-radius: 1px;
    margin: 0.5rem 0;
    grid-column: 1 / -1;
}

/* Registration Status */
.registration-closed {
    background: rgba(255, 0, 0, 0.1);
    border: 2px solid #ff0000;
    color: #ff0000;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-weight: bold;
    text-align: center;
    margin-top: 1rem;
}

/* Bottom Participant Controls */
.bottom-participant-controls {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #111111;
    border: 1px solid #F26522;
    border-radius: 0.5rem;
    display: none;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.bottom-participant-controls.show {
    display: flex;
}

.bottom-participant-controls .participant-controls {
    margin: 0;
}

/* Participant Limit Indicator */
.participant-limit-indicator {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 200px;
}

.limit-text {
    font-size: 0.875rem;
    color: #ffffff;
    font-weight: 500;
}

.limit-progress {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.limit-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #F26522, #ff8c42);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.limit-progress-bar.limit-reached {
    background: linear-gradient(90deg, #ff4444, #ff6666);
    animation: pulse 1s ease-in-out;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Responsive adjustments for bottom controls */
@media (max-width: 767px) {
    .bottom-participant-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .participant-limit-indicator {
        min-width: auto;
    }
}

/* Date Display Styles */
.card-events-section__date-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.date-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #F26522;
    color: #111111;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    width: 4.5rem; /* Fixed width to accommodate "Dimanche" */
    text-align: center;
}

.day-number {
    font-family: var(--ers-font-family-heading);
    font-weight: 400 !important;
    letter-spacing: var(--ers-letter-spacing-anton) !important;
    font-size: 1.5rem;
    font-weight: 400;
    line-height: 1;
}

.day-name {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}

.date-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.month-year {
    color: var(--secondary);
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
}

.deadline-text {
    font-size: 0.75rem;
    color: #F26522;
    font-weight: 500;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Event Card Meta Styles */
.event-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin-top: 1rem;
}

/* Event Card Heading */
.card-events-section__heading {
    font-size: var(--text-l);
    color: var(--bg-body);
    margin: 0 0 1rem 0;
    font-family: var(--ers-font-family-heading);
    font-weight: 400 !important;
    letter-spacing: var(--ers-letter-spacing-anton) !important;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.event-card-meta .day-badge {
    background: #F26522;
    color: #111111;
    padding: 0.5rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.deadline-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.deadline-date {
    font-family: var(--ers-font-family-heading);
    font-weight: 400 !important;
    letter-spacing: var(--ers-letter-spacing-anton) !important;
    font-size: 1.25rem;
    font-weight: 400;
    color: #F26522;
}

.deadline-label {
    font-size: 0.75rem;
    color: var(--secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Responsive adjustments */
@media (max-width: 767px) {
    .participant-form-card {
        padding: 1.5rem;
        grid-template-columns: 1fr !important; /* Force single column on mobile */
        gap: 1rem !important;
    }
    
    .participant-form-card .programme-section__heading {
        font-size: 1.25rem;
    }
    
    .ers-input {
        padding: 0.625rem 0.875rem;
        font-size: 0.8rem;
        line-height: 1.1;
    }
    
    /* All form groups take full width on mobile */
    .participant-form-card .ers-form-group {
        grid-column: 1 / -1 !important;
    }

    .date-badge {
        padding: 0.5rem 0.75rem;
        min-width: 2.5rem;
    }

    .day-number {
        font-size: 1.25rem;
    }

    .day-name {
        font-size: 0.7rem;
    }

    .month-year {
        font-size: 0.8rem;
    }

    .deadline-text {
        font-size: 0.7rem;
    }

    .event-card-meta {
        gap: 0.5rem;
    }

    .event-card-meta .day-badge {
        padding: 0.375rem 0.625rem;
        font-size: 0.8rem;
    }

    .deadline-date {
        font-size: 1rem;
    }

    .deadline-label {
        font-size: 0.7rem;
    }
} 