/**
 * EventHub - Submission Form Styles
 *
 * Styles für das Frontend-Einreichungsformular.
 * Folgt BEM-Naming und nutzt CSS-Variablen.
 *
 * @package EventHub
 * @since 1.0.0
 */

/* ==========================================================================
   FALLBACK VARIABLES (falls eventhub-variables.css nicht geladen)
   ========================================================================== */

.eventhub-submission-page {
    --eventhub-spacing-xs: 0.25rem;
    --eventhub-spacing-sm: 0.5rem;
    --eventhub-spacing-md: 1rem;
    --eventhub-spacing-lg: 1.5rem;
    --eventhub-spacing-xl: 2rem;
    --eventhub-color-primary: #0073aa;
    --eventhub-color-primary-dark: #005a87;
    --eventhub-color-primary-light: #f0f7fc;
    --eventhub-color-text-muted: #666;
    --eventhub-color-bg-alt: #f9f9f9;
    --eventhub-color-bg-input: #fff;
    --eventhub-color-border: #ddd;
    --eventhub-color-border-input: #8c8f94;
    --eventhub-color-surface-hover: #eaeaea;
    --eventhub-color-cancelled: #dc3545;
    --eventhub-font-size-xs: 0.75rem;
    --eventhub-font-size-sm: 0.875rem;
    --eventhub-font-size-base: 1rem;
    --eventhub-font-size-lg: 1.25rem;
    --eventhub-font-size-xl: 1.5rem;
    --eventhub-font-size-2xl: 1.75rem;
    --eventhub-font-weight-medium: 500;
    --eventhub-font-weight-semibold: 600;
    --eventhub-font-weight-bold: 700;
    --eventhub-border-radius: 4px;
    --eventhub-border-radius-lg: 8px;
    --eventhub-dropdown-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    --eventhub-transition: 0.2s ease;
}

/* ==========================================================================
   CONTAINER & LAYOUT
   ========================================================================== */

.eventhub-submission-page {
    padding: var(--eventhub-spacing-xl, 2rem) 0;
}

.eventhub-submission-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 var(--eventhub-spacing-md, 1rem);
}

/* ==========================================================================
   HEADER
   ========================================================================== */

.eventhub-submission-header {
    text-align: center;
    margin-bottom: var(--eventhub-spacing-xl);
}

.eventhub-submission-title {
    font-size: var(--eventhub-font-size-2xl);
    font-weight: var(--eventhub-font-weight-bold);
    margin: 0 0 var(--eventhub-spacing-sm);
}

.eventhub-submission-intro {
    color: var(--eventhub-color-text-muted);
    font-size: var(--eventhub-font-size-lg);
    margin: 0;
}

/* ==========================================================================
   SUCCESS MESSAGE
   ========================================================================== */

.eventhub-submission-success {
    text-align: center;
    padding: var(--eventhub-spacing-xl);
    background: #d4edda;
    border-radius: var(--eventhub-border-radius-lg);
    border: 1px solid #c3e6cb;
}

.eventhub-submission-success__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: #28a745;
    color: #fff;
    border-radius: 50%;
    font-size: 32px;
    margin-bottom: var(--eventhub-spacing-md);
}

.eventhub-submission-success h2 {
    font-size: var(--eventhub-font-size-xl);
    color: #155724;
    margin: 0 0 var(--eventhub-spacing-sm);
}

.eventhub-submission-success p {
    color: #155724;
    margin: 0 0 var(--eventhub-spacing-lg);
}

/* ==========================================================================
   ERROR MESSAGES
   ========================================================================== */

.eventhub-submission-errors {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: var(--eventhub-border-radius);
    padding: var(--eventhub-spacing-md);
    margin-bottom: var(--eventhub-spacing-lg);
    color: #721c24;
}

.eventhub-submission-errors strong {
    display: block;
    margin-bottom: var(--eventhub-spacing-sm);
}

.eventhub-submission-errors ul {
    margin: 0;
    padding-left: var(--eventhub-spacing-lg);
}

.eventhub-submission-errors li {
    margin-bottom: var(--eventhub-spacing-xs);
}

/* ==========================================================================
   FORM SECTIONS
   ========================================================================== */

.eventhub-form-section {
    background: var(--eventhub-color-bg-alt);
    border-radius: var(--eventhub-border-radius-lg);
    padding: var(--eventhub-spacing-lg);
    margin-bottom: var(--eventhub-spacing-lg);
}

.eventhub-form-section__title {
    font-size: var(--eventhub-font-size-lg);
    font-weight: var(--eventhub-font-weight-semibold);
    margin: 0 0 var(--eventhub-spacing-md);
}

.eventhub-form-section__description {
    color: var(--eventhub-color-text-muted);
    font-size: var(--eventhub-font-size-sm);
    margin: calc(-1 * var(--eventhub-spacing-sm)) 0 var(--eventhub-spacing-md);
}

.eventhub-form-section--contact {
    background: #f0f6fc;
    border: 1px solid #c5d9ed;
}

.eventhub-form-section--submit {
    background: transparent;
    padding: var(--eventhub-spacing-lg) 0;
}

/* ==========================================================================
   FORM FIELDS
   ========================================================================== */

.eventhub-form-field {
    margin-bottom: var(--eventhub-spacing-md);
}

.eventhub-form-field:last-child {
    margin-bottom: 0;
}

.eventhub-form-field--compact {
    margin-top: var(--eventhub-spacing-sm);
}

.eventhub-form-field > label {
    display: block;
    font-weight: var(--eventhub-font-weight-medium);
    margin-bottom: var(--eventhub-spacing-xs);
}

.eventhub-form-field--required > label::after {
    content: ' *';
    color: var(--eventhub-color-cancelled);
}

.eventhub-form-field__hint {
    font-size: var(--eventhub-font-size-sm);
    color: var(--eventhub-color-text-muted);
    margin: var(--eventhub-spacing-xs) 0 0;
}

.eventhub-form-field__hint-inline {
    font-weight: normal;
    font-size: var(--eventhub-font-size-sm);
    color: var(--eventhub-color-text-muted);
}

/* Inputs */
.eventhub-form-field input[type='text'],
.eventhub-form-field input[type='email'],
.eventhub-form-field input[type='tel'],
.eventhub-form-field input[type='url'],
.eventhub-form-field input[type='date'],
.eventhub-form-field input[type='time'],
.eventhub-form-field textarea,
.eventhub-form-field select,
.eventhub-select {
    width: 100%;
    padding: var(--eventhub-spacing-sm) var(--eventhub-spacing-md);
    border: 1px solid var(--eventhub-color-border-input);
    border-radius: var(--eventhub-border-radius);
    background: var(--eventhub-color-bg-input);
    font-size: var(--eventhub-font-size-base);
    font-family: inherit;
    transition:
        border-color var(--eventhub-transition),
        box-shadow var(--eventhub-transition);
}

.eventhub-form-field input:focus,
.eventhub-form-field textarea:focus,
.eventhub-form-field select:focus {
    outline: none;
    border-color: var(--eventhub-color-primary);
    box-shadow: 0 0 0 3px var(--eventhub-color-primary-light);
}

.eventhub-form-field textarea {
    resize: vertical;
    min-height: 120px;
}

/* Error state */
.eventhub-form-field--error input,
.eventhub-form-field--error textarea,
.eventhub-form-field--error select {
    border-color: var(--eventhub-color-cancelled);
}

.eventhub-form-field--error input:focus,
.eventhub-form-field--error textarea:focus {
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15);
}

/* ==========================================================================
   FORM GRID
   ========================================================================== */

.eventhub-form-grid {
    display: grid;
    gap: var(--eventhub-spacing-md);
}

.eventhub-form-grid--1col {
    grid-template-columns: 1fr;
}

.eventhub-form-grid--2col {
    grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 576px) {
    .eventhub-form-grid--2col {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   CHECKBOXES & RADIOS
   ========================================================================== */

.eventhub-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--eventhub-spacing-sm);
}

.eventhub-checkbox-item {
    display: flex;
    align-items: flex-start;
    gap: var(--eventhub-spacing-sm);
    cursor: pointer;
    font-weight: normal;
}

.eventhub-checkbox-item input[type='checkbox'],
.eventhub-checkbox-item input[type='radio'] {
    margin: 0;
    flex-shrink: 0;
    margin-top: 0.2em;
    margin-right: 0.25em;
}

.eventhub-checkbox-item span {
    line-height: 1.4;
}

.eventhub-checkbox-item--required span::after {
    content: ' *';
    color: var(--eventhub-color-cancelled);
}

/* Disabled state for max categories */
.eventhub-checkbox-item.is-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.eventhub-checkbox-item.is-disabled input {
    pointer-events: none;
}

/* ==========================================================================
   RADIO CARDS (Event-Typ)
   ========================================================================== */

.eventhub-radio-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--eventhub-spacing-md);
}

@media (max-width: 576px) {
    .eventhub-radio-cards {
        grid-template-columns: 1fr;
    }
}

.eventhub-radio-card {
    display: block;
    cursor: pointer;
}

.eventhub-radio-card input[type='radio'] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.eventhub-radio-card__content {
    display: block;
    padding: var(--eventhub-spacing-md);
    background: var(--eventhub-color-bg-input);
    border: 2px solid var(--eventhub-color-border);
    border-radius: var(--eventhub-border-radius);
    transition: all var(--eventhub-transition);
}

.eventhub-radio-card__content strong {
    display: block;
    margin-bottom: var(--eventhub-spacing-xs);
}

.eventhub-radio-card__content small {
    display: block;
    color: var(--eventhub-color-text-muted);
    font-size: var(--eventhub-font-size-sm);
}

.eventhub-radio-card input:checked + .eventhub-radio-card__content {
    border-color: var(--eventhub-color-primary);
    background: var(--eventhub-color-primary-light);
}

.eventhub-radio-card:hover .eventhub-radio-card__content {
    border-color: var(--eventhub-color-primary);
}

.eventhub-radio-card input:focus-visible + .eventhub-radio-card__content {
    box-shadow: 0 0 0 3px var(--eventhub-color-primary-light);
}

/* ==========================================================================
   IMAGE UPLOAD
   ========================================================================== */

.eventhub-image-upload {
    position: relative;
}

.eventhub-image-upload__input {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.eventhub-image-upload__preview {
    border: 2px dashed var(--eventhub-color-border);
    border-radius: var(--eventhub-border-radius);
    padding: var(--eventhub-spacing-xl);
    text-align: center;
    background: var(--eventhub-color-bg-input);
    transition: all var(--eventhub-transition);
}

.eventhub-image-upload:hover .eventhub-image-upload__preview,
.eventhub-image-upload.is-dragover .eventhub-image-upload__preview {
    border-color: var(--eventhub-color-primary);
    background: var(--eventhub-color-primary-light);
}

.eventhub-image-upload__placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--eventhub-spacing-sm);
    color: var(--eventhub-color-text-muted);
}

.eventhub-image-upload__icon {
    font-size: 48px;
    line-height: 1;
}

.eventhub-image-upload__placeholder small {
    font-size: var(--eventhub-font-size-sm);
}

/* Preview mit Bild */
.eventhub-image-upload__preview.has-image {
    padding: 0;
    border-style: solid;
    overflow: hidden;
}

.eventhub-image-upload__preview.has-image img {
    display: block;
    width: 100%;
    height: auto;
}

.eventhub-image-upload__remove {
    position: absolute;
    top: var(--eventhub-spacing-sm);
    right: var(--eventhub-spacing-sm);
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    line-height: 32px;
    text-align: center;
    padding: 0;
    z-index: 3;
    transition: background var(--eventhub-transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.eventhub-image-upload__remove span {
    display: block;
    line-height: 1;
    transition: color var(--eventhub-transition);
}

.eventhub-image-upload__remove:hover {
    background: rgba(0, 0, 0, 0.7);
}

.eventhub-image-upload__remove:hover span {
    color: var(--eventhub-color-cancelled);
}

/* Image Rights */
.eventhub-image-rights {
    margin-top: var(--eventhub-spacing-md);
    padding: var(--eventhub-spacing-md);
    background: #fff3cd;
    border-radius: var(--eventhub-border-radius);
    border: 1px solid #ffc107;
}

/* ==========================================================================
   AUTOCOMPLETE
   ========================================================================== */

.eventhub-autocomplete-wrapper {
    position: relative;
}

.eventhub-autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--eventhub-color-bg-input);
    border: 1px solid var(--eventhub-color-border);
    border-top: none;
    border-radius: 0 0 var(--eventhub-border-radius)
        var(--eventhub-border-radius);
    box-shadow: var(--eventhub-dropdown-shadow);
    z-index: 100;
    max-height: 300px;
    overflow-y: auto;
    display: none;
}

.eventhub-autocomplete-results.is-open {
    display: block;
}

.eventhub-autocomplete-item {
    padding: var(--eventhub-spacing-sm) var(--eventhub-spacing-md);
    cursor: pointer;
    border-bottom: 1px solid var(--eventhub-color-border);
    transition: background var(--eventhub-transition);
}

.eventhub-autocomplete-item:last-child {
    border-bottom: none;
}

.eventhub-autocomplete-item:hover,
.eventhub-autocomplete-item.is-focused {
    background: var(--eventhub-color-primary-light);
}

.eventhub-autocomplete-item__name {
    font-weight: var(--eventhub-font-weight-medium);
}

.eventhub-autocomplete-item__info {
    font-size: var(--eventhub-font-size-sm);
    color: var(--eventhub-color-text-muted);
}

.eventhub-autocomplete-empty {
    padding: var(--eventhub-spacing-md);
    text-align: center;
    color: var(--eventhub-color-text-muted);
}

.eventhub-autocomplete-loading {
    padding: var(--eventhub-spacing-md);
    text-align: center;
}

/* ==========================================================================
   SELECTED ITEM
   ========================================================================== */

.eventhub-selected-item {
    display: inline-flex;
    align-items: center;
    gap: var(--eventhub-spacing-sm);
    padding: var(--eventhub-spacing-sm) var(--eventhub-spacing-md);
    background: var(--eventhub-color-primary-light);
    border: 1px solid var(--eventhub-color-primary);
    border-radius: var(--eventhub-border-radius-pill);
    margin-bottom: var(--eventhub-spacing-md);
}

.eventhub-selected-item__name {
    font-weight: var(--eventhub-font-weight-medium);
}

.eventhub-selected-item__remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: transparent;
    border: none;
    color: var(--eventhub-color-primary-dark);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0;
    transition: color var(--eventhub-transition);
}

.eventhub-selected-item__remove:hover {
    color: var(--eventhub-color-cancelled);
}

/* ==========================================================================
   ADDITIONAL DATES
   ========================================================================== */

.eventhub-additional-dates__list {
    display: flex;
    flex-direction: column;
    gap: var(--eventhub-spacing-sm);
    margin-bottom: var(--eventhub-spacing-md);
}

.eventhub-additional-date {
    display: flex;
    align-items: center;
    gap: var(--eventhub-spacing-sm);
}

.eventhub-additional-date input[type='date'] {
    flex: 1;
}

.eventhub-additional-date__remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid var(--eventhub-color-border);
    border-radius: var(--eventhub-border-radius);
    cursor: pointer;
    color: var(--eventhub-color-text-muted);
    transition: all var(--eventhub-transition);
}

.eventhub-additional-date__remove:hover {
    background: var(--eventhub-color-cancelled);
    border-color: var(--eventhub-color-cancelled);
    color: #fff;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.eventhub-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--eventhub-spacing-sm);
    padding: var(--eventhub-spacing-sm) var(--eventhub-spacing-lg);
    border: none;
    border-radius: var(--eventhub-border-radius);
    font-size: var(--eventhub-font-size-base);
    font-weight: var(--eventhub-font-weight-medium);
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--eventhub-transition);
}

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

.eventhub-btn--primary:hover {
    background: var(--eventhub-color-primary-dark);
}

.eventhub-btn--secondary {
    background: var(--eventhub-color-bg-input);
    color: var(--eventhub-color-text);
    border: 1px solid var(--eventhub-color-border);
}

.eventhub-btn--secondary:hover {
    background: var(--eventhub-color-surface-hover);
}

.eventhub-btn--small {
    padding: var(--eventhub-spacing-xs) var(--eventhub-spacing-md);
    font-size: var(--eventhub-font-size-sm);
}

.eventhub-btn--large {
    padding: var(--eventhub-spacing-md) var(--eventhub-spacing-xl);
    font-size: var(--eventhub-font-size-lg);
}

.eventhub-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ==========================================================================
   FORM ACTIONS
   ========================================================================== */

.eventhub-form-actions {
    text-align: center;
    margin-top: var(--eventhub-spacing-lg);
}

/* ==========================================================================
   RECAPTCHA NOTICE
   ========================================================================== */

.eventhub-recaptcha-notice {
    text-align: center;
    font-size: var(--eventhub-font-size-sm);
    color: var(--eventhub-color-text-muted);
    margin-top: var(--eventhub-spacing-md);
}

.eventhub-recaptcha-notice a {
    color: inherit;
    text-decoration: underline;
}

/* ==========================================================================
   LOADING STATE
   ========================================================================== */

.eventhub-submission-form.is-submitting {
    pointer-events: none;
    opacity: 0.7;
}

.eventhub-submission-form.is-submitting .eventhub-btn--primary::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: eventhub-spinner 0.8s linear infinite;
    margin-left: var(--eventhub-spacing-sm);
}

@keyframes eventhub-spinner {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 768px) {
    .eventhub-submission-container {
        padding: 0 var(--eventhub-spacing-sm);
    }

    .eventhub-form-section {
        padding: var(--eventhub-spacing-md);
    }

    .eventhub-submission-title {
        font-size: var(--eventhub-font-size-xl);
    }

    .eventhub-submission-intro {
        font-size: var(--eventhub-font-size-base);
    }
}
