/*
 * form.css – Formular-Styles für Online-Demo JG
 * Plugin : online-demo-jg | Version: 1.0.0
 *
 * CSS-Variablen sind in map.css auf :root definiert und stehen hier
 * zur Verfügung, weil map.css zuerst geladen wird. Auf Seiten ohne
 * Karte (nur [demo_formular]) werden sie hier erneut deklariert.
 */

:root {
    --odj-yellow: #ffcc00;
    --odj-orange: #f39100;
    --odj-red:    #e30613;
}

/* ===================================================================
   FORMULAR LAYOUT
   =================================================================== */

.odj-form-wrapper {
    max-width: 100%;
    width: 100%;
    margin:    2rem auto;
    padding:   0 1rem;
}

.odj-form {
    width: 100%;
    max-width: 100%;
}

.odj-form__field {
    margin-bottom: 1.5rem;
}

.odj-form__label {
    display:       block;
    font-weight:   600;
    margin-bottom: 0.4rem;
    font-size:     0.95rem;
    color:         #222;
}

.odj-form__required {
    color:       var(--odj-red);
    margin-left: 3px;
}

.odj-form__hint {
    font-size:   0.82rem;
    color:       #888;
    margin-left: 6px;
}

/* Selects und Textareas */
.odj-form__select,
.odj-form__textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.95rem;
    font-family: inherit;
    box-sizing: border-box;
    line-height: 1.4;
    height: auto;
    min-height: 2.5rem;
    transition: border-color 0.15s;
}

.odj-form__select:focus,
.odj-form__textarea:focus {
    border-color: #ffcc00;
    outline: none;
    box-shadow: 0 0 0 3px rgba(255,204,0,0.2);
}

.odj-form__textarea {
    resize:     vertical;
    min-height: 100px;
}

/* Input-Felder */
.odj-form__input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.95rem;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.15s;
}

.odj-form__input:focus {
    border-color: #ffcc00;
    outline: none;
    box-shadow: 0 0 0 3px rgba(255,204,0,0.2);
}

/* ===================================================================
   ZEICHENZÄHLER
   =================================================================== */

.odj-form__char-count {
    text-align: right;
    font-size:  0.82rem;
    color:      #888;
    margin-top: 4px;
}

/* Warnung: < 20 Zeichen verbleibend */
.odj-form__char-count--warn {
    color:       var(--odj-red);
    font-weight: 700;
}

/* ===================================================================
   DATEI-UPLOAD & BILDVORSCHAU
   =================================================================== */

.odj-form__file {
    display:       block;
    margin-bottom: 0.4rem;
    font-size:     0.9rem;
    cursor:        pointer;
}

.odj-form__image-preview {
    margin-top: 8px;
}

.odj-form__image-preview img {
    max-width:     200px;
    border-radius: 4px;
    display:       block;
    border:        1px solid #ddd;
}

.odj-form__image-preview p {
    font-size: 0.8rem;
    color:     #666;
    margin:    4px 0 0;
}

/* ===================================================================
   HINWEIS-BOXEN (rollenbasiert)
   =================================================================== */

.odj-notice {
    padding:       0.9rem 1rem;
    border-radius: 6px;
    margin-bottom: 1.2rem;
    font-size:     0.9rem;
    line-height:   1.55;
}

.odj-notice p {
    margin: 0;
}

/* Gast: warme gelbe Akzentfarbe */
.odj-notice--guest {
    background:   #fff8e1;
    border-left:  4px solid var(--odj-yellow);
    color:        #5a4000;
}

/* Mitglied: kühles Blau */
.odj-notice--member {
    background:   #e3f2fd;
    border-left:  4px solid #2196f3;
    color:        #0d3a5c;
}

/* ===================================================================
   CHECKBOXEN
   =================================================================== */

.odj-form__field--checkbox {
    margin-bottom: 1.2rem;
}

.odj-checkbox {
    display:     flex;
    align-items: flex-start;
    gap:         0.5rem;
    cursor:      pointer;
    font-size:   0.9rem;
    line-height: 1.5;
}

.odj-checkbox__input {
    margin-top:   3px;
    cursor:       pointer;
    flex-shrink:  0;
    width:        16px;
    height:       16px;
    accent-color: var(--odj-yellow);
}

.odj-checkbox__label {
    color: #333;
}

/* ===================================================================
   SUBMIT-BUTTON
   =================================================================== */

.odj-form__actions {
    margin-top: 1.5rem;
}

.odj-form__submit-btn {
    background:    var(--odj-yellow);
    color:         #333;
    border:        none;
    padding:       0.75rem 2.5rem;
    font-size:     1rem;
    font-weight:   700;
    border-radius: 4px;
    cursor:        pointer;
    transition:    background 0.15s ease, color 0.15s ease;
    font-family:   inherit;
}

.odj-form__submit-btn:hover,
.odj-form__submit-btn:focus {
    background: var(--odj-orange);
    color:      #fff;
    outline:    none;
}

.odj-form__submit-btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(243, 145, 0, 0.4);
}

.odj-form__submit-btn:disabled {
    background: #ccc;
    color:      #888;
    cursor:     not-allowed;
}

/* ===================================================================
   FEEDBACK-MELDUNGEN
   =================================================================== */

.odj-form__feedback {
    padding:       0.9rem 1rem;
    border-radius: 4px;
    margin-top:    1rem;
    font-size:     0.9rem;
    display:       none; /* Standard: ausgeblendet */
}

/* Erfolg: grün */
.odj-form__feedback--success {
    display:    block;
    background: #d4edda;
    color:      #155724;
    border:     1px solid #c3e6cb;
}

/* Fehler: rot */
.odj-form__feedback--error {
    display:    block;
    background: #f8d7da;
    color:      #721c24;
    border:     1px solid #f5c6cb;
}

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

@media (max-width: 480px) {
    .odj-form-wrapper {
        padding: 0 0.5rem;
        margin:  1rem auto;
    }

    .odj-form__submit-btn {
        width: 100%;
    }

    /* Mindest-Schriftgröße 16px verhindert Auto-Zoom auf iOS */
    .odj-form__select,
    .odj-form__textarea {
        font-size: 16px;
    }
}

/* ===================================================================
   BEITRAGS-TABELLE
   =================================================================== */

.odj-no-beitraege {
    color: #888;
    font-style: italic;
}

.odj-beitraege-table-wrapper {
    max-width: 100%;
    overflow-x: auto;
}

.odj-beitraege-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
}

.odj-beitraege-table thead {
    background: #f5f5f5;
    border-bottom: 2px solid #ddd;
}

.odj-beitraege-table th {
    padding: 0.8rem;
    text-align: left;
    font-weight: 700;
    color: #333;
}

.odj-beitraege-table td {
    padding: 0.8rem;
    border-bottom: 1px solid #eee;
}

.odj-beitraege-table tbody tr:hover {
    background: #f9f9f9;
}

.odj-table__date {
    width: 100px;
    white-space: nowrap;
    color: #666;
    font-size: 0.9rem;
}

.odj-table__name {
    font-weight: 600;
    min-width: 120px;
}

.odj-table__role {
    width: 120px;
}

.odj-table__statement {
    max-width: 300px;
    word-break: break-word;
    color: #333;
    font-style: italic;
    padding-left: 0.8rem;
    border-left: 3px solid #ffcc00;
}

.odj-table__image {
    width: 80px;
    text-align: center;
}

.odj-table__img {
    max-width: 60px;
    height: auto;
    border-radius: 4px;
    display: inline-block;
}

.odj-table__no-image {
    color: #ccc;
    font-size: 0.9rem;
}

.odj-col-image {
    width: 80px;
}


.odj-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.odj-badge--member {
    background: #e3f2fd;
    color: #1565c0;
}

.odj-badge--guest {
    background: #fff8e1;
    color: #b8860b;
}

/* ===================================================================
   RESPONSIVE SUCHFELD (Positions-Karte)
   =================================================================== */

@media (max-width: 480px) {
    /* Suchfeld-Wrapper: untereinander statt nebeneinander */
    #odj-position-map + div,
    #odj-position-map ~ div:has(input[placeholder*="Stadt"]) {
        flex-wrap: wrap;
    }
}
