/* Dommusik Reisen – Custom Styles (Design angelehnt an den Terminplaner) */

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.form-check-input:disabled + .form-check-label {
    opacity: 1;
}

/* Navbar */
.navbar-brand img {
    max-height: 50px;
}

.navbar .nav-link {
    color: #333 !important;
    font-weight: 500;
    padding: 0.5rem 0.75rem !important;
    border-radius: 0.25rem;
    transition: background-color 0.15s, color 0.15s;
}

.navbar .nav-link:hover {
    color: var(--bs-primary) !important;
    background-color: rgba(0,0,0,0.05);
}

.navbar .nav-link.active {
    color: var(--bs-primary) !important;
    background-color: rgba(var(--bs-primary-rgb), 0.1);
}

/* Sortierbare Tabellenspalten */
th.sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

th.sortable:hover {
    background-color: rgba(0,0,0,0.05);
}

.copy-link-btn.copied {
    color: #198754 !important;
    border-color: #198754 !important;
}

.alert {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.card {
    border-color: rgba(0,0,0,0.08);
}

.card-header h5 {
    font-size: 1.05rem;
}

/* Detail-Listen (Definitionen) */
.detail-list {
    display: grid;
    grid-template-columns: minmax(140px, max-content) 1fr;
    gap: 0.35rem 1rem;
    margin: 0;
}

.detail-list dt {
    font-weight: 500;
    color: #6c757d;
}

.detail-list dd {
    margin: 0;
    word-break: break-word;
}

@media (max-width: 576px) {
    .detail-list {
        grid-template-columns: 1fr;
        gap: 0.1rem;
    }
    .detail-list dd {
        margin-bottom: 0.5rem;
    }
}

.text-pre-line {
    white-space: pre-line;
}

/* Tabellen */
.table-anmeldungen td, .table-anmeldungen th {
    vertical-align: middle;
}

.table-anmeldungen .text-nowrap .btn + .btn {
    margin-left: 2px;
}

.status-dot {
    display: inline-block;
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
    margin-right: 0.3rem;
}

.money {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Kennzahlen-Kacheln */
.stat-tile {
    background: #fff;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    height: 100%;
}

.stat-tile .stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.2;
}

.stat-tile .stat-label {
    font-size: 0.8rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ============================
   Schritt-Leiste (Anmeldeformular)
   ============================ */
.stepper {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem;
    counter-reset: step;
}

.stepper li {
    flex: 1;
    position: relative;
    text-align: center;
    font-size: 0.8rem;
    color: #6c757d;
}

.stepper li::before {
    content: attr(data-step);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    margin: 0 auto 0.35rem;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #ced4da;
    font-weight: 600;
    color: #6c757d;
    position: relative;
    z-index: 1;
    transition: all 0.2s;
}

.stepper li::after {
    content: '';
    position: absolute;
    top: 1.05rem;
    left: calc(-50% + 1.05rem);
    right: calc(50% + 1.05rem);
    height: 2px;
    background: #ced4da;
}

.stepper li:first-child::after {
    display: none;
}

.stepper li.active {
    color: var(--bs-primary);
    font-weight: 600;
}

.stepper li.active::before {
    border-color: var(--bs-primary);
    color: var(--bs-primary);
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.15);
}

.stepper li.done::before {
    content: '\2713';
    background: var(--bs-primary);
    border-color: var(--bs-primary);
    color: #fff;
}

.stepper li.done::after,
.stepper li.active::after {
    background: var(--bs-primary);
}

.stepper li.done {
    cursor: pointer;
}

.stepper li.d-none + li::after {
    left: calc(-50% + 1.05rem);
}

@media (max-width: 576px) {
    .stepper li .step-label {
        display: none;
    }
    .stepper li.active .step-label {
        display: block;
        font-size: 0.7rem;
    }
}

.form-step {
    animation: fadeIn 0.25s ease-in;
}

.medikament-item {
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    background: #fafafa;
    position: relative;
}

.medikament-nummer {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    background: var(--bs-primary);
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    margin-right: 0.5rem;
}

.summary-section h6 {
    color: var(--bs-primary);
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 0.3rem;
    margin-top: 1rem;
}

.dm-hp-field {
    position: absolute !important;
    left: -10000px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Tom Select an Bootstrap angleichen */
.ts-wrapper.is-invalid .ts-control {
    border-color: #dc3545;
}

.ts-wrapper.focus .ts-control {
    border-color: var(--bs-primary) !important;
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25) !important;
}

.ts-wrapper.multi .ts-control > div.item {
    background: rgba(var(--bs-primary-rgb), 0.1);
    border-radius: 0.25rem;
}

.vorwahl-select {
    max-width: 6.5rem;
    flex: 0 0 auto !important;
}

/* Datenschutzerklärung */
.privacy-content h1, .privacy-content h2, .privacy-content h3 {
    font-size: 1.15rem;
    margin-top: 1rem;
}

/* Quill */
.ql-container {
    font-size: 1rem;
    background: #fff;
}

/* ============================
   PWA Bottom Navigation
   ============================ */
.pwa-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #dee2e6;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 6px 0;
    padding-bottom: calc(6px + env(safe-area-inset-bottom) / 2);
    z-index: 1050;
}

.pwa-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #6c757d;
    font-size: 0.7rem;
    padding: 4px 12px;
    border: none;
    background: none;
    cursor: pointer;
    position: relative;
}

.pwa-nav-item i {
    font-size: 1.3rem;
    margin-bottom: 2px;
}

.pwa-nav-item.active,
.pwa-nav-item:hover {
    color: var(--bs-primary);
    text-decoration: none;
}

.pwa-dropup {
    display: none;
    position: absolute;
    bottom: 100%;
    right: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    min-width: 220px;
    padding: 8px 0;
    margin-bottom: 10px;
}

.pwa-dropup.show {
    display: block;
}

.pwa-dropup-item {
    display: block;
    width: 100%;
    padding: 10px 20px;
    font-size: 0.95rem;
    color: #333;
    text-decoration: none;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
}

.pwa-dropup-item:hover {
    background-color: #f8f9fa;
}

.pwa-dropup-divider {
    height: 1px;
    background: #dee2e6;
    margin: 4px 0;
}

@media (display-mode: standalone) {
    .navbar .navbar-toggler,
    .navbar .navbar-collapse {
        display: none !important;
    }

    footer {
        display: none !important;
    }

    html, body {
        height: 100vh;
        height: 100dvh;
        overflow: hidden;
    }

    body {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    body > main {
        position: fixed;
        top: 80px;
        left: 0;
        right: 0;
        bottom: var(--pwa-nav-height, 0px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        flex: none !important;
    }
}

/* Suchfeld mit Lösch-Button */
.search-clear-wrapper {
    position: relative;
}

.search-clear-wrapper > .form-control {
    padding-right: 2.25rem;
}

.search-clear-btn {
    position: absolute;
    top: 50%;
    right: 0.6rem;
    transform: translateY(-50%);
    background: transparent;
    border: 0;
    padding: 0;
    line-height: 1;
    color: #6c757d;
    cursor: pointer;
    font-size: 1.1rem;
}

.search-clear-btn:hover {
    color: #212529;
}

@media (max-width: 768px) {
    h2 {
        font-size: 1.4rem;
    }
    .btn-group-sm .btn {
        padding: 0.2rem 0.4rem;
    }
}

@media print {
    body {
        padding-top: 0 !important;
        background: #fff !important;
    }
    .navbar, footer, .no-print, .pwa-bottom-nav {
        display: none !important;
    }
    .card, .shadow-lg, .shadow-sm {
        box-shadow: none !important;
    }
}
