/* ============================================
   Turngemeinde Reservation Bundle
   Haupt-Stylesheet für Event-Liste, Event-Detail und Formulare
   ============================================ */

/* ============================================
   EVENT LIST — Grid-Darstellung
   ============================================ */
.tgl-res-grid-container,
.mod_eventlist.tgl-res-grid-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    align-items: stretch;
    width: 100%;
}

@media (max-width: 700px) {
    .tgl-res-grid-container,
    .mod_eventlist.tgl-res-grid-container {
        grid-template-columns: 1fr;
    }
}

.tgl-res-grid-container > .header,
.tgl-res-grid-container > header,
.tgl-res-grid-container > h2,
.tgl-res-grid-container > h3 {
    grid-column: 1 / -1;
}

.tgl-res-grid-container > * {
    min-width: 0;
    float: none;
    width: auto;
    clear: none;
}

.tgl-res-grid-container .has-reservation {
    margin: 0;
    display: flex;
    flex-direction: column;
}

/* ============================================
   EVENT CARD — Einzelne Event-Kachel
   ============================================ */
.event.has-reservation {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    padding: 0;
    transition: box-shadow 0.25s, transform 0.25s;
    position: relative;
}

.event.has-reservation:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.14);
    transform: translateY(-3px);
}

.event.has-reservation .image_container,
.event.has-reservation figure {
    margin: 0;
    order: -1;
}

.event.has-reservation .image_container img,
.event.has-reservation figure img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.event.has-reservation:hover .image_container img,
.event.has-reservation:hover figure img {
    transform: scale(1.04);
}

.event.has-reservation h1,
.event.has-reservation h2,
.event.has-reservation h3 {
    padding: 12px 16px 4px 80px; /* Platz links für Datum-Badge */
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    min-height: 70px;
    display: flex;
    align-items: center;
}

.event.has-reservation h1 a,
.event.has-reservation h2 a,
.event.has-reservation h3 a {
    color: #3b3c42;
    text-decoration: none;
}

.event.has-reservation h1 a:hover,
.event.has-reservation h2 a:hover,
.event.has-reservation h3 a:hover {
    color: #e32125;
}

.event.has-reservation p,
.event.has-reservation .teaser,
.event.has-reservation .location {
    padding: 0 16px 8px;
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: #7f7f7f;
}

.event.has-reservation .more,
.event.has-reservation .read-more {
    padding: 0 16px 12px;
}

.event.has-reservation .more a,
.event.has-reservation .read-more a {
    color: #e32125;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
}

/* ============================================
   DATUM-BADGE (oben links auf Event-Karte)
   ============================================ */
.tgl-res-date-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 3;
    background: #e32125;
    color: #fff;
    border-radius: 4px;
    padding: 6px 8px;
    text-align: center;
    font-family: asap, sans-serif;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    min-width: 42px;
}

.tgl-res-date-badge__day {
    display: block;
    font-size: 18px;
    font-weight: 800;
    line-height: 1;
}

.tgl-res-date-badge__month {
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.tgl-res-date-badge__year {
    display: block;
    font-size: 9px;
    font-weight: 500;
    opacity: 0.9;
    margin-top: 1px;
}

/* ============================================
   TEASER-BLOCK (Status + Preis + Button)
   ============================================ */
.tgl-res-teaser {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 12px;
    padding: 12px 16px;
    border-top: 1px solid #e5e5e5;
    font-family: asap, sans-serif;
}

.tgl-res-teaser__status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #555;
}

.tgl-res-dot {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
}

.tgl-res-dot--available {
    background: #f59e0b;
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.2);
}

.tgl-res-dot--few-left {
    background: #f59e0b;
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.2);
    animation: tgl-res-pulse 2s infinite;
}

.tgl-res-dot--sold-out {
    background: #dc2626;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.2);
}

@keyframes tgl-res-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.tgl-res-status-label {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 12px;
}

.tgl-res-teaser__price {
    font-size: 18px;
    font-weight: 700;
    color: #3b3c42;
    margin-left: auto;
}

/* ============================================
   BUTTONS
   ============================================ */
.tgl-res-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: asap, sans-serif;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none !important;
    border-radius: 4px;
    padding: 10px 22px;
    cursor: pointer;
    transition: 0.2s;
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    line-height: 1.2;
}

.tgl-res-btn--outline {
    background: #fff;
    color: #3b3c42;
    border: 2px solid #3b3c42;
}

.tgl-res-btn--outline:hover {
    background: #e32125;
    color: #fff !important;
    border-color: #e32125;
}

.tgl-res-btn--primary {
    background: #e32125;
    color: #fff !important;
}

.tgl-res-btn--primary:hover {
    background: #990003;
}

.tgl-res-btn--disabled {
    background: #e5e5e5 !important;
    color: #999 !important;
    cursor: not-allowed;
    pointer-events: none;
    border-color: #e5e5e5 !important;
}

.tgl-res-btn--large {
    font-size: 16px;
    padding: 14px 36px;
}

/* ============================================
   EVENT DETAIL — Buchungsbereich
   ============================================ */
.tgl-res-detail {
    margin-top: 32px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: 2px solid #e32125;
    font-family: asap, sans-serif;
    background: #fff;
}

.tgl-res-detail__header {
    background: #e32125;
    color: #fff;
    padding: 16px 24px;
}

.tgl-res-detail__header h3 {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    color: #fff;
}

.tgl-res-detail__body {
    padding: 24px;
}

.tgl-res-detail__info {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e5e5;
}

.tgl-res-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 15px;
}

.tgl-res-label {
    color: #7f7f7f;
}

.tgl-res-value {
    font-weight: 700;
    color: #3b3c42;
}

.tgl-res-price {
    font-size: 22px;
    color: #e32125;
}

.tgl-res-chip {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
}

.tgl-res-chip--ok {
    background: #dcfce7;
    color: #166534;
}

.tgl-res-chip--low {
    background: #fef3c7;
    color: #92400e;
}

.tgl-res-chip--none {
    background: #fecaca;
    color: #991b1b;
}

.tgl-res-progress-wrap {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.tgl-res-progress {
    flex: 1;
    height: 8px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
}

.tgl-res-progress__bar {
    height: 100%;
    transition: width 0.6s;
}

.tgl-res-progress__bar--ok { background: #819452; }
.tgl-res-progress__bar--warning { background: #f59e0b; }
.tgl-res-progress__bar--critical { background: #e32125; }

.tgl-res-progress__text {
    font-size: 12px;
    color: #7f7f7f;
    font-weight: 600;
}

/* ============================================
   FORMULAR
   ============================================ */
.tgl-res-form {
    margin-top: 8px;
}

.tgl-res-section {
    margin: 0 0 20px;
    padding: 0 0 16px;
    border-bottom: 1px solid #e5e5e5;
}

.tgl-res-section__title {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 12px;
    color: #3b3c42;
    padding: 0;
    text-align: left;
}

.tgl-res-object-list,
.tgl-res-options-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.tgl-res-object-item,
.tgl-res-option-item {
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: 12px;
    align-items: start;
    padding: 12px 14px;
    margin: 0;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.15s;
    font-size: 14px;
    background: #fff;
    line-height: 1.4;
    text-align: left;
    box-sizing: border-box;
}

.tgl-res-object-item:hover,
.tgl-res-option-item:hover {
    border-color: #e32125;
    background: #fff5f5;
}

.tgl-res-object-item input,
.tgl-res-option-item input {
    margin: 3px 0 0;
    accent-color: #e32125;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    align-self: start;
    padding: 0;
}

.tgl-res-object-name,
.tgl-res-option-item > span {
    display: block;
    color: #3b3c42;
    font-weight: 400;
    text-align: left;
    padding: 0;
    margin: 0;
}

.tgl-res-option-item small {
    display: block;
    color: #7f7f7f;
    font-size: 12px;
    margin-top: 4px;
    font-weight: 400;
}

.tgl-res-object-item small {
    display: block;
    color: #7f7f7f;
    font-size: 12px;
    margin-top: 4px;
    grid-column: 2;
}

.tgl-res-inclusive {
    color: #819452;
    font-size: 12px;
    font-weight: 600;
    margin-left: 4px;
}

.tgl-res-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.tgl-res-field--full {
    grid-column: 1 / -1;
}

.tgl-res-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #3b3c42;
    margin-bottom: 4px;
}

.tgl-res-req {
    color: #e32125;
}

.tgl-res-field input[type="text"],
.tgl-res-field input[type="email"],
.tgl-res-field input[type="tel"],
.tgl-res-field input[type="number"],
.tgl-res-field input[type="date"],
.tgl-res-field select,
.tgl-res-field textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 15px;
    font-family: inherit;
    color: #3b3c42;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.tgl-res-field input:focus,
.tgl-res-field select:focus,
.tgl-res-field textarea:focus {
    border-color: #e32125;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(227, 33, 37, 0.12);
}

.tgl-res-check {
    display: flex !important;
    align-items: flex-start;
    gap: 10px;
    font-weight: 400 !important;
    font-size: 14px !important;
    cursor: pointer;
}

.tgl-res-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #e32125;
    flex-shrink: 0;
    margin-top: 2px;
}

.tgl-res-check a {
    color: #e32125;
    text-decoration: underline;
}

.tgl-res-check a:hover {
    color: #990003;
}

.tgl-res-submit {
    text-align: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e5e5e5;
}

.tgl-res-submit-status {
    margin-top: 12px;
    font-size: 14px;
    font-weight: 600;
}

.tgl-res-submit-status.error { color: #e32125; }
.tgl-res-submit-status.loading { color: #7f7f7f; }

/* ============================================
   ERFOLG / FEHLER / FLASH
   ============================================ */
.tgl-res-success {
    background: #f0fdf4;
    border: 2px solid #819452;
    border-radius: 8px;
    padding: 28px;
    text-align: center;
    margin-top: 16px;
}

.tgl-res-success h4 {
    color: #166534;
    margin: 0 0 12px;
    font-size: 20px;
}

.tgl-res-success p {
    margin: 8px 0;
    color: #3b3c42;
}

.tgl-res-token-display {
    font-family: monospace;
    font-size: 18px;
    background: #fff;
    padding: 10px 20px;
    border: 2px dashed #819452;
    display: inline-block;
    border-radius: 4px;
    letter-spacing: 1px;
}

.tgl-res-errors {
    background: #fff5f5;
    border: 1px solid #fecaca;
    border-left: 4px solid #e32125;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 20px;
}

.tgl-res-errors ul {
    margin: 0;
    padding: 0 0 0 20px;
    color: #991b1b;
    font-size: 14px;
}

.tgl-res-flash-success {
    background: #dcfce7;
    border-left: 4px solid #166534;
    padding: 16px;
    border-radius: 4px;
    margin-bottom: 20px;
    color: #166534;
    font-family: asap, sans-serif;
}

.tgl-res-flash-error {
    background: #fecaca;
    border-left: 4px solid #991b1b;
    padding: 16px;
    border-radius: 4px;
    margin-bottom: 20px;
    color: #991b1b;
    font-family: asap, sans-serif;
}

.tgl-res-soldout {
    text-align: center;
    padding: 20px;
}

.tgl-res-hint {
    font-size: 13px;
    color: #7f7f7f;
    margin-top: 10px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 600px) {
    .tgl-res-grid {
        grid-template-columns: 1fr;
    }

    .tgl-res-teaser {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .tgl-res-teaser__price {
        margin: 0;
    }
}
