/* styles.css – Modernisierte Basis-Styles fuer Frontend und Backend */
@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&family=Fraunces:opsz,wght@9..144,600;9..144,700&display=swap");

:root {
    --ui-bg-top: #edf4ff;
    --ui-bg-bottom: #dcecff;
    --ui-surface: rgba(255, 255, 255, 0.88);
    --ui-surface-strong: #ffffff;
    --ui-text: #10213b;
    --ui-text-soft: #5a6f90;
    --ui-border: rgba(34, 69, 128, 0.17);
    --ui-brand: #3b82f6;
    --ui-brand-strong: #1d4ed8;
    --ui-brand-soft: rgba(59, 130, 246, 0.14);
    --ui-accent: #06b6d4;
    --ui-warm: #0ea5e9;
    --ui-alert: #dc2626;
    --ui-radius-lg: 18px;
    --ui-radius-md: 12px;
    --ui-shadow: 0 20px 40px rgba(16, 33, 59, 0.14);
}

* { box-sizing: border-box; }

body {
    font-family: 'Outfit', 'Trebuchet MS', sans-serif;
    margin: 0;
    padding: clamp(0.8rem, 2vw, 1.4rem);
    line-height: 1.5;
    min-width: 320px;
    color: var(--ui-text);
    background:
        radial-gradient(circle at 10% 5%, rgba(255,255,255,0.75) 0%, rgba(255,255,255,0) 38%),
        radial-gradient(circle at 95% 8%, rgba(6,182,212,0.12) 0%, rgba(6,182,212,0) 32%),
        linear-gradient(140deg, var(--ui-bg-top), var(--ui-bg-bottom));
}

.container {
    max-width: 100% !important;
    width: 100%;
    margin: 0 auto;
    padding: 0 15px;
}

h1, h2 {
    text-align: center;
    font-family: 'Fraunces', Georgia, serif;
    color: #244a31;
    letter-spacing: 0.01em;
}

form {
    width: 100%;
    margin: 0 auto;
}

.form-row {
    display: flex;
    align-items: flex-start;
    margin-bottom: 14px;
    gap: 0.7rem;
    flex-wrap: wrap;
}

.form-row.column {
    flex-direction: column;
    align-items: flex-start;
}

.form-input-fixed {
    flex: 0 0 180px;
}

label {
    margin: 0;
    cursor: pointer;
    white-space: nowrap;
    color: #25362d;
}

input[type=text],
input[type=email],
input[type=date],
input[type=password],
textarea,
select,
.form-control {
    width: 100%;
    padding: 9px 11px;
    box-sizing: border-box;
    min-width: 0;
    border-radius: var(--ui-radius-md);
    border: 1px solid var(--ui-border);
    background: var(--ui-surface-strong);
    color: var(--ui-text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

input[type=text]:focus,
input[type=email]:focus,
input[type=date]:focus,
input[type=password]:focus,
textarea:focus,
select:focus,
.form-control:focus {
    outline: none;
    border-color: #397957;
    box-shadow: 0 0 0 0.2rem rgba(57, 121, 87, 0.18);
    transform: translateY(-1px);
}

textarea {
    min-height: 4rem;
    resize: vertical;
}

select.yes-no {
    max-width: 150px;
    text-align-last: center;
}

option { text-align: center; }

input[type=checkbox],
input[type=radio] {
    accent-color: var(--ui-brand);
}

input[type=checkbox] {
    width: 1.1rem;
    height: 1.1rem;
    margin-top: 0.2rem;
    border-radius: 0.35rem;
}

input[type=submit],
button,
.btn {
    margin-top: 0;
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 999px;
    border: 0;
    color: #fff;
    font-weight: 600;
    background: linear-gradient(125deg, var(--ui-brand-strong), var(--ui-brand));
    box-shadow: 0 12px 24px rgba(29, 78, 216, 0.24);
    transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

input[type=submit]:hover,
button:hover,
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 28px rgba(29, 78, 216, 0.28);
    filter: brightness(1.02);
}

.btn-primary {
    background: linear-gradient(125deg, #1d4ed8, #3b82f6) !important;
    border: none !important;
    box-shadow: 0 12px 24px rgba(29, 78, 216, 0.24);
}

.btn-secondary {
    background: linear-gradient(125deg, #475569, #64748b) !important;
    border: none !important;
    box-shadow: 0 12px 24px rgba(30, 41, 59, 0.2);
}

.btn-danger {
    background: linear-gradient(125deg, #b91c1c, #ef4444) !important;
    border: none !important;
    box-shadow: 0 12px 24px rgba(185, 28, 28, 0.24);
}

.btn-success {
    background: linear-gradient(125deg, #047857, #10b981) !important;
    border: none !important;
}

.btn-info {
    background: linear-gradient(125deg, #0369a1, #0ea5e9) !important;
    border: none !important;
}

.btn-outline-danger {
    border-radius: 999px !important;
    border: 1px solid rgba(185, 28, 28, 0.32) !important;
}

.btn-sm {
    padding: 0.46rem 0.74rem;
    min-width: 2.45rem;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
}

.action-btn .icon {
    font-size: 0.98rem;
    line-height: 1;
}

a {
    color: #0e6b67;
    text-underline-offset: 0.14em;
}

a:hover { color: #0a514d; }

input[type=submit]:disabled,
button:disabled,
.btn:disabled {
    background: #b5c0b8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.hint {
    text-align: center;
    color: var(--ui-alert);
    font-weight: bold;
}

.required::after {
    content: ' *';
    color: var(--ui-alert);
}

.nav-tabs {
    display: flex;
    flex-direction: row !important;
    border-bottom: 1px solid var(--ui-border);
    flex-wrap: wrap;
    overflow-x: auto;
    gap: 0.2rem;
}

.nav-tabs .nav-item {
    margin-bottom: -1px;
    flex-shrink: 0;
}

.nav-tabs .nav-link {
    border: 1px solid transparent;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    white-space: nowrap;
    padding: 0.56rem 1rem;
    color: var(--ui-text-soft);
}

.nav-tabs .nav-link:hover,
.nav-tabs .nav-link:focus {
    border-color: rgba(31, 43, 35, 0.15);
    color: var(--ui-text);
}

.nav-tabs .nav-link.active,
.nav-tabs .nav-item.show .nav-link {
    color: var(--ui-text);
    background: var(--ui-surface);
    border-color: var(--ui-border) var(--ui-border) transparent;
}

.search-form {
    margin-bottom: 20px;
    padding: 15px;
    background: var(--ui-surface);
    border-radius: var(--ui-radius-lg);
    border: 1px solid rgba(255,255,255,0.92);
    box-shadow: var(--ui-shadow);
    backdrop-filter: blur(8px);
}

.card,
.modal-content,
.alert {
    border-radius: var(--ui-radius-lg);
}

.search-form .form-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.search-form .form-control {
    flex: 1 1 auto;
    min-width: 140px;
    max-width: 240px;
}

.search-form label {
    margin-right: 5px;
    font-weight: 500;
}

.search-form .btn { flex-shrink: 0; }

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overflow-y: auto !important;
    max-height: 70vh !important;
    scrollbar-width: thin;
    scrollbar-color: #7b8b80 #ebefec;
    padding: 2px;
    border: 1px solid var(--ui-border);
    border-radius: 10px;
    display: block;
    position: relative;
    background: linear-gradient(180deg, rgba(255,255,255,0.8), rgba(255,255,255,0.7));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}

.table {
    min-width: 600px;
    margin-bottom: 0;
}

.table th,
.table td {
    white-space: nowrap;
    vertical-align: middle;
}

.table thead th,
.thead-light th,
.thead-dark th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: linear-gradient(140deg, #dbeafe, #e0f2fe) !important;
    color: #12345f;
    border-bottom: 1px solid rgba(34, 69, 128, 0.24);
}

.card,
.modal-content {
    border: 1px solid rgba(34, 69, 128, 0.16);
    background: linear-gradient(160deg, rgba(255,255,255,0.95), rgba(255,255,255,0.9));
    box-shadow: var(--ui-shadow);
}

.modal-header,
.modal-footer {
    border-color: rgba(34, 69, 128, 0.14);
}

.table-responsive::-webkit-scrollbar { height: 10px; width: 10px; }
.table-responsive::-webkit-scrollbar-track { background: #e8eeea; border-radius: 6px; }
.table-responsive::-webkit-scrollbar-thumb { background: #7d8d82; border-radius: 6px; }
.table-responsive::-webkit-scrollbar-thumb:hover { background: #5c6b61; }

#anmeldungen .table-responsive {
    overflow-y: auto !important;
    max-height: 70vh !important;
    display: block;
    position: relative;
    border: 1px solid var(--ui-border);
    border-radius: 10px;
    padding: 2px;
}

#anmeldungen .table-scroll-wrapper { width: 100%; position: relative; }

#anmeldungen .table-scrollbar-top {
    overflow-x: auto;
    overflow-y: hidden;
    height: 8px;
    margin: 0 0 6px 0;
    background: rgba(255,255,255,0.55);
    border-radius: 999px;
}

#anmeldungen .table-scrollbar-top-inner { height: 1px; }
#anmeldungen .table-scrollbar-top::-webkit-scrollbar { height: 8px; }
#anmeldungen .table-scrollbar-top::-webkit-scrollbar-track { background: #e8eeea; border-radius: 8px; }
#anmeldungen .table-scrollbar-top::-webkit-scrollbar-thumb { background: #7d8d82; border-radius: 8px; }
#anmeldungen .table-scrollbar-top::-webkit-scrollbar-thumb:hover { background: #5c6b61; }

@media (max-width: 768px) {
    body { padding: 10px; }
    .container { padding: 0 10px; }
    .form-row { flex-direction: column; align-items: stretch; gap: 10px; }
    .form-input-fixed { flex: none; width: 100%; }
    .form-row > input,
    .form-row > select,
    .form-row > textarea { width: 100%; }
    select.yes-no { max-width: none; width: 100%; }

    .nav-tabs { flex-direction: column !important; border-bottom: none; }
    .nav-tabs .nav-item { margin-bottom: 0; border-bottom: 1px solid var(--ui-border); }
    .nav-tabs .nav-link { border-radius: 0; border-left: none; border-right: none; border-top: none; }

    .search-form .form-inline { flex-direction: column; align-items: stretch; }
    .search-form .form-control { max-width: none; width: 100%; }
    .search-form label { margin-bottom: 5px; margin-right: 0; }

    .table { min-width: 100%; font-size: 14px; }
    .table th, .table td { padding: 8px 4px; }
}

@media (max-width: 480px) {
    body { padding: 6px; }
    .container { padding: 0 6px; }
    h1 { font-size: 1.45rem; }
    h2 { font-size: 1.25rem; }
    .table { font-size: 12px; }
    .table th, .table td { padding: 4px 2px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media print {
    body { margin: 0; padding: 0; background: #fff; }
    .nav-tabs,
    .search-form,
    .btn { display: none !important; }
    .table { min-width: auto; }
}
