/* ============================================================
   FHV Veranstaltungstool – Base Stylesheet
   Design reference: kinderuni.fhv.at
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
    /* Basis-Farben */
    --fhv-red:        #be0000;
    --fhv-red-dark:   #960000;
    --fhv-red-light:  #f8e5e5;
    --fhv-grey:       #555555;
    --fhv-grey-light: #f5f5f5;
    --fhv-border:     #dddddd;
    --fhv-text:       #333333;
    --fhv-muted:      #777777;
    --fhv-white:      #ffffff;

    /* Aufgedröselte Farbvariablen - werden dynamisch überschrieben */
    --fhv-link-color:       var(--fhv-red);
    --fhv-link-hover:       var(--fhv-red-dark);
    
    --fhv-btn-bg:           var(--fhv-red);
    --fhv-btn-text:         var(--fhv-white);
    --fhv-btn-hover-bg:     var(--fhv-red-dark);
    
    --fhv-primary:          var(--fhv-red);
    --fhv-primary-dark:     var(--fhv-red-dark);
    --fhv-primary-light:    var(--fhv-red-light);
    
    --fhv-focus-ring:       rgba(190,0,0,.12);
    --fhv-checkbox-bg:      var(--fhv-primary);
    --fhv-checkbox-border:  var(--fhv-primary);
    --fhv-checkbox-focus:   rgba(190,0,0,.15);
    
    --fhv-capacity-bar:     var(--fhv-primary);

    /* Layout-Variablen */
    --fhv-sidebar:          #003063;
    --fhv-logo:             #be0000;
    --fhv-header-bg:        #ffffff;
    --fhv-header-text:      #003063;
    --fhv-header-border:    #dddddd;
    --fhv-content-bg:       #f8f8f8;
    --fhv-footer-bg:        #003063;
    --fhv-footer-text:      #ffffff;

    --font-base:      Arial, Helvetica, sans-serif;
    --font-size-base: 1rem;
    --line-height:    1.6;

    --radius:         3px;
    --shadow-card:    0 1px 3px rgba(0,0,0,.08);
    --transition:     0.15s ease;
}

/* ── Reset / Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { font-size: 16px; }

body {
    font-family: var(--font-base) !important;
    font-size:   var(--font-size-base);
    line-height: var(--line-height);
    color:       var(--fhv-text);
    background:  var(--fhv-grey-light);
    margin: 0;
    padding: 0;
}

a { color: var(--fhv-link-color); }
a:hover { color: var(--fhv-link-hover); }

h1, h2, h3, h4, h5 {
    font-family: var(--font-base);
    font-weight: 700;
    color: var(--fhv-text);
    margin-top: 0;
}
h1 { font-size: 2rem;   line-height: 1.2; }
h2 { font-size: 1.5rem; line-height: 1.25; }
h3 { font-size: 1.15rem; }

/* ── Header ─────────────────────────────────────────────────── */
.site-header {
    background:    var(--fhv-white);
    border-bottom: 3px solid var(--fhv-primary);
    box-shadow:    0 1px 4px rgba(0,0,0,.06);
    padding:       0.7rem 0;
}

.site-header__inner {
    display:     flex;
    align-items: center;
    gap:         1rem;
}

.site-header__logo {
    display:        flex;
    align-items:    center;
    gap:            0.6rem;
    text-decoration: none;
}

.site-header__logo-mark {
    width:  38px;
    height: 38px;
    background:    var(--fhv-primary);
    border-radius: 2px;
    display:       flex;
    align-items:   center;
    justify-content: center;
    color:         var(--fhv-white);
    font-weight:   700;
    font-size:     0.85rem;
    letter-spacing: 0.03em;
    flex-shrink:   0;
}

.site-header__name {
    display:     flex;
    flex-direction: column;
    line-height: 1.2;
}

.site-header__name-main {
    font-size:   0.95rem;
    font-weight: 700;
    color:       var(--fhv-text);
    letter-spacing: 0.01em;
}

.site-header__name-sub {
    font-size:  0.78rem;
    color:      var(--fhv-muted);
    font-weight: 400;
}

/* ── Page layout ────────────────────────────────────────────── */
.site-main {
    padding: 2rem 0 3.5rem;
    min-height: calc(100vh - 120px);
}

/* ── Page card ──────────────────────────────────────────────── */
.fhv-card {
    background:    var(--fhv-white);
    border:        1px solid var(--fhv-border);
    border-radius: var(--radius);
    box-shadow:    var(--shadow-card);
    margin-bottom: 1.5rem;
}

.fhv-card__header {
    background:    var(--fhv-primary);
    color:         var(--fhv-white);
    padding:       0.8rem 1.25rem;
    border-radius: var(--radius) var(--radius) 0 0;
    font-size:     1.1rem;
    font-weight:   700;
    letter-spacing: 0.01em;
}

.fhv-card__body {
    padding: 1.5rem 1.25rem;
}

/* ── Section dividers within form ───────────────────────────── */
.form-section {
    font-size:      0.8rem;
    font-weight:    700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color:          var(--fhv-grey);
    border-bottom:  2px solid var(--fhv-border);
    padding-bottom: 0.35rem;
    margin:         1.75rem 0 1rem;
}

.form-section:first-child { margin-top: 0.25rem; }

/* ── Form controls (override Bootstrap) ─────────────────────── */
.form-label {
    font-weight: 600;
    font-size:   0.9rem;
    color:       var(--fhv-text);
    margin-bottom: 0.3rem;
}

.required {
    color:       var(--fhv-primary);
    margin-left: 2px;
}

.form-control,
.form-select {
    font-family:   var(--font-base);
    font-size:     0.95rem;
    border:        1px solid var(--fhv-border);
    border-radius: var(--radius);
    color:         var(--fhv-text);
    padding:       0.45rem 0.75rem;
    background:    var(--fhv-white);
    transition:    border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--fhv-primary);
    box-shadow:   0 0 0 0.2rem var(--fhv-focus-ring);
    outline:      none;
}

.form-control.is-invalid,
.form-select.is-invalid {
    border-color: #dc3545;
}

.form-control:disabled,
.form-select:disabled {
    background: #f0f0f0;
    color:      var(--fhv-muted);
}

textarea.form-control {
    resize:     vertical;
    min-height: 100px;
}

.form-control::placeholder,
.form-select::placeholder,
textarea.form-control::placeholder {
    color:   var(--fhv-placeholder);
    opacity: 1;
}

.form-text {
    font-size: 0.82rem;
    color:     var(--fhv-muted);
    margin-top: 0.2rem;
}

.invalid-feedback { font-size: 0.82rem; }

/* ── Checkboxes & Radios ─────────────────────────────────────── */
.form-check { margin-bottom: 0.45rem; }

.form-check-input {
    border-color:  var(--fhv-border);
    margin-top:    0.2em;
    cursor:        pointer;
}

.form-check-input:checked {
    background-color: var(--fhv-checkbox-bg);
    border-color:     var(--fhv-checkbox-border);
}

.form-check-input:focus {
    box-shadow: 0 0 0 0.2rem var(--fhv-checkbox-focus);
    border-color: var(--fhv-primary);
}

.form-check-label {
    font-size:  0.95rem;
    color:      var(--fhv-text);
    cursor:     pointer;
    font-weight: 400;
}

/* Full workshops stay readable while their radio inputs remain disabled. */
.workshop-choice .form-check-input:disabled ~ .form-check-label {
    opacity: 1;
    cursor: default;
}

.workshop-status { margin-left: 6px; }
.workshop-status--full {
    color: #be0000;
    font-weight: 600;
}
.workshop-status--available {
    color: #666;
    font-size: 90%;
}
.workshop-status--chosen { color: #666; font-size: 90%; }
.workshop-group-error { color: #be0000; font-size: 0.85rem; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn-fhv {
    font-family:    var(--font-base);
    font-size:      0.95rem;
    font-weight:    700;
    letter-spacing: 0.02em;
    background:     var(--fhv-btn-bg);
    color:          var(--fhv-btn-text);
    border:         none;
    border-radius:  var(--radius);
    padding:        0.55rem 2rem;
    cursor:         pointer;
    transition:     background var(--transition);
    display:        inline-block;
    text-decoration: none;
}

.btn-fhv:hover:not(:disabled) {
    background: var(--fhv-btn-hover-bg);
    color:      var(--fhv-btn-text);
}

.btn-fhv:disabled {
    opacity: 0.45;
    cursor:  not-allowed;
}

.btn-fhv-outline {
    background:  transparent;
    color:       var(--fhv-primary);
    border:      1.5px solid var(--fhv-primary);
    font-family: var(--font-base);
    font-size:   0.9rem;
    font-weight: 600;
    border-radius: var(--radius);
    padding:     0.45rem 1.25rem;
    cursor:      pointer;
    transition:  all var(--transition);
    text-decoration: none;
}

.btn-fhv-outline:hover {
    background: var(--fhv-primary-light);
    color:      var(--fhv-primary-dark);
}

/* ── Event meta line ─────────────────────────────────────────── */
.event-meta {
    font-size: 0.88rem;
    color:     var(--fhv-muted);
}

.event-meta .sep::before {
    content: " · ";
    color:   var(--fhv-border);
}

/* ── Badge / status ──────────────────────────────────────────── */
.fhv-badge {
    display:        inline-block;
    font-size:      0.72rem;
    font-weight:    700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding:        2px 8px;
    border-radius:  2px;
    vertical-align: middle;
}

.fhv-badge--inactive {
    background: #dc3545;
    color:      #fff;
}

.fhv-badge--waiting {
    background: #f0ad4e;
    color:      #5a3e00;
}

.fhv-badge--full {
    background: var(--fhv-grey);
    color:      #fff;
}

/* ── PDF list ────────────────────────────────────────────────── */
.fhv-pdf-list {
    list-style: none;
    padding:    0;
    margin:     0;
}

.fhv-pdf-list li {
    padding:       0.35rem 0;
    border-bottom: 1px solid var(--fhv-border);
    font-size:     0.92rem;
}

.fhv-pdf-list li:last-child { border-bottom: none; }

.fhv-pdf-list a {
    color:           var(--fhv-link-color);
    text-decoration: none;
    font-weight:     600;
}

.fhv-pdf-list a::before {
    content: "↓ ";
    font-size: 0.85em;
}

.fhv-pdf-list a:hover { text-decoration: underline; }

/* ── Preview bar ─────────────────────────────────────────────── */
.preview-bar {
    background:    #fff8e1;
    border:        1px solid #ffe082;
    border-left:   4px solid #ffc107;
    border-radius: var(--radius);
    padding:       0.65rem 1rem;
    font-size:     0.88rem;
    font-weight:   600;
    color:         #664d03;
    display:       flex;
    align-items:   center;
    gap:           0.75rem;
    flex-wrap:     wrap;
    margin-bottom: 1.25rem;
}

.preview-bar a {
    margin-left:  auto;
    color:        #664d03;
    font-weight:  600;
    font-size:    0.85rem;
}

.form-overlay {
    pointer-events: none;
    opacity:        0.55;
}

/* ── Alerts ──────────────────────────────────────────────────── */
.alert {
    font-size:     0.92rem;
    border-radius: var(--radius);
    border-left:   4px solid transparent;
}

.alert-danger  { border-left-color: #dc3545; }
.alert-success { border-left-color: #198754; }
.alert-info    { border-left-color: #0dcaf0; }
.alert-warning { border-left-color: #ffc107; }

/* ── Capacity bar ────────────────────────────────────────────── */
.capacity-bar {
    height:        6px;
    background:    var(--fhv-border);
    border-radius: 3px;
    overflow:      hidden;
    margin:        0.35rem 0 0.5rem;
}

.capacity-bar__fill {
    height:     100%;
    background: var(--fhv-capacity-bar);
    transition: width 0.3s ease;
    border-radius: 3px;
}

.capacity-bar__fill--full    { background: #dc3545; }
.capacity-bar__fill--warning { background: #f0ad4e; }

/* ── Event list card ─────────────────────────────────────────── */
.event-list-item {
    transition: box-shadow var(--transition);
}

.event-list-item:hover {
    box-shadow: 0 3px 10px rgba(0,0,0,.12);
}

/* ── Tag pills (event meta) ─────────────────────────────────── */
.fhv-tag {
    display:         inline-block;
    padding:         0.15rem 0.7rem;
    font-size:       0.78rem;
    font-weight:     600;
    line-height:     1.4;
    color:           var(--fhv-primary);
    background:      var(--fhv-primary-light);
    border:          1px solid var(--fhv-primary);
    border-radius:   999px;
    text-decoration: none;
    transition:      background var(--transition), color var(--transition);
}

.fhv-tag:hover {
    background: var(--fhv-primary);
    color:      var(--fhv-white);
}

/* ── Tag filter pills (above event list) ────────────────────── */
.fhv-tag-filter {
    display:         inline-block;
    padding:         0.3rem 0.95rem;
    font-size:       0.85rem;
    font-weight:     600;
    line-height:     1.4;
    color:           var(--fhv-primary);
    background:      transparent;
    border:          1.5px solid var(--fhv-primary);
    border-radius:   999px;
    text-decoration: none;
    transition:      background var(--transition), color var(--transition);
}

.fhv-tag-filter:hover {
    background: var(--fhv-primary-light);
    color:      var(--fhv-primary-dark);
}

.fhv-tag-filter--active {
    background: var(--fhv-primary);
    color:      var(--fhv-white);
}

.fhv-tag-filter--active:hover {
    background: var(--fhv-primary-dark);
    color:      var(--fhv-white);
}

/* ── Footer ──────────────────────────────────────────────────── */
.site-footer {
    background:    var(--fhv-white);
    border-top:    1px solid var(--fhv-border);
    padding:       1.25rem 0;
    margin-top:    auto;
    font-size:     0.82rem;
    color:         var(--fhv-muted);
}

.site-footer a {
    color:           var(--fhv-muted);
    text-decoration: none;
}

.site-footer a:hover {
    color:           var(--fhv-link-color);
    text-decoration: underline;
}

.site-footer__links {
    display:   flex;
    gap:       1.25rem;
    flex-wrap: wrap;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 576px) {
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.2rem; }

    .fhv-card__body { padding: 1rem; }

    .btn-fhv { width: 100%; text-align: center; }

    .site-header__name-main { font-size: 0.85rem; }
}

/* Presentation-only variants for per-person registration blocks. */
.person-block { min-width:0; border:0; padding:0; box-shadow:none; }
.person-block--line { border-top:1px solid var(--bs-border-color, #ccc); padding-top:1rem; }
.person-block--card { border:1px solid var(--bs-border-color, #ccc); border-radius:.5rem; padding:1.25rem; }
.person-block--card > legend { float:none; width:auto; padding:0 .25rem; }
