/* Integral Check specific styles */
.app-header {
    flex-direction: column;
    align-items: stretch;
    padding: 0;
}

.header-top {
    padding: 1.5rem 3rem;
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.horizontal-menu {
    display: flex;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    border-top: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0 1rem;
    overflow-x: auto;
}

.menu-item {
    background: transparent;
    border: none;
    color: #cbd5e1;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.menu-item:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.menu-item.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.app-view {
    display: none;
    width: 100%;
    animation: fadeIn 0.4s ease-out;
}

.app-view.active-view {
    display: block;
    width: 100%;
}

.integral-app {
    padding: 0 !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
}

.glass-panel.full-width {
    max-width: 100%;
    border-radius: 0;
    border-left: none;
    border-right: none;
    padding: 1.5rem 2rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    text-transform: uppercase;
}

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1rem;
}

.badge {
    background: var(--primary-color);
    color: #fff;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
}

.badge-al {
    background: linear-gradient(135deg, #e55d3c, #c0392b);
}

/* ── Zuschlagsberechnung ── */
.zuschlag-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 2.5rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
}

.zmeta-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.zmeta-label {
    font-size: 0.75rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.zmeta-item strong {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
}

.penalty-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* ── Zuschlag Gender Sections ── */
.zuschlag-gender-sections {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.zuschlag-section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--glass-border);
}

.zuschlag-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.penalty-gender-icon {
    font-size: 1.4rem;
    opacity: 0.85;
}

/* ── Zuschlag Table ── */
.zuschlag-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
}

.zuschlag-table thead th {
    background: rgba(0, 100, 180, 0.7);
    color: #ffffff;
    padding: 0.65rem 1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-align: left;
}

.zt-th-num {
    text-align: right !important;
}

.zuschlag-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.zuschlag-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
}

.zuschlag-table td {
    padding: 0.55rem 1rem;
}

.zt-rang {
    width: 60px;
    color: #94a3b8;
    font-weight: 600;
}

.zt-name {
    color: #e2e8f0;
}

.zt-punkte {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: #e2e8f0;
}

.zt-sel {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: #003988;
}

/* Struck rows */
.z-row-struck .zt-rang,
.z-row-struck .zt-name,
.z-row-struck .zt-punkte {
    color: #22c55e;
}

.z-row-struck .zt-punkte {
    text-decoration: line-through;
}

/* Kept rows */
.z-row-kept .zt-rang,
.z-row-kept .zt-name {
    color: #ffffff;
}

/* Footer rows */
.zt-sep-row td {
    height: 6px;
    background: rgba(0, 0, 0, 0.15);
    border: none;
    padding: 0;
}

.zt-summe-row td,
.zt-calc-row td,
.zt-app-row td {
    padding: 0.45rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.zt-foot-label {
    text-align: right;
    color: #ffffff;
    font-size: 0.88rem;
}

.zt-calc-row .zt-foot-label,
.zt-app-row .zt-foot-label {
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
}

.zt-divisor {
    text-align: right;
    color: #ffffff;
    font-size: 0.88rem;
}

.zt-summe-val {
    text-align: right;
    color: #003988;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.zt-calc-val {
    text-align: right;
    color: #ffffff;
    font-weight: 800;
    font-size: 1.1rem;
    font-variant-numeric: tabular-nums;
}

.zt-app-val {
    text-align: right;
    color: #ab0d0d;
    font-weight: 800;
    font-size: 1.1rem;
    font-variant-numeric: tabular-nums;
}

.z-no-data {
    color: #64748b;
    font-style: italic;
    padding: 1rem 0;
}

.weather-section {

    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.2rem 1.5rem;
    margin-top: 0.5rem;
}

.weather-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 2.5rem;
}


/* File Import Controls */
.import-controls {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    align-items: center;
    flex-wrap: wrap;
}

.file-input {
    display: none;
}

.btn-import,
.btn-primary {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-import {
    background: transparent;
    color: #cbd5e1;
    border: 2px solid var(--glass-border);
}

.btn-import:hover {
    border-color: #cbd5e1;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.btn-primary {
    background: var(--primary-color);
    color: #ffffff;
    border: 2px solid var(--primary-color);
}

.btn-primary:hover:not(:disabled) {
    box-shadow: 0 0 15px rgba(0, 136, 204, 0.5);
    background: var(--hover-color);
}

.btn-primary:disabled {
    background: rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    border-color: rgba(255, 255, 255, 0.2);
    cursor: not-allowed;
}

.btn-clear-cache {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.8rem 1.2rem;
    border-radius: 30px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 2px solid rgba(239, 68, 68, 0.4);
    transition: all 0.25s ease;
    letter-spacing: 0.5px;
}

.btn-clear-cache:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: #ef4444;
    color: #ffffff;
}

.import-status {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 8px;
    display: none;
}

.import-status.success {
    display: block;
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid #22c55e;
    color: #bbf7d0;
}

.import-status.error {
    display: block;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid #ef4444;
    color: #fecaca;
}

.import-status p {
    margin-bottom: 0.5rem;
}

.race-event-title {
    display: block;
    font-size: 1.6rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 1px;
    margin-bottom: 0.25rem;
    text-shadow: 0 0 20px rgba(0, 136, 204, 0.4);
}

.section-subtitle {
    font-size: 1rem;
    font-weight: 600;
    color: #94a3b8;
    margin-top: 0.25rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.race-info-container {
    background: rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    margin-top: 1.5rem;
    text-align: left;
    animation: fadeIn 0.4s ease-out;
}

.info-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-top: 1.5rem;
}

.info-group {
    flex: 1;
    min-width: 280px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.info-group:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 136, 204, 0.4);
}

.group-title {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
}

.info-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.info-label {
    font-size: 0.85rem;
    color: #cbd5e1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    text-align: right;
    max-width: 65%;
    word-break: break-word;
}

.info-value-highlight {
    color: var(--primary-color);
    font-size: 1.1rem;
}

/* Tables */
.table-container {
    width: 100%;
    overflow-x: auto;
    margin-top: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th,
.data-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.data-table th {
    background: rgba(0, 0, 0, 0.3);
    font-weight: 600;
    color: var(--primary-color);
    cursor: pointer;
    user-select: none;
    position: relative;
    white-space: nowrap;
}

.data-table th:hover {
    background: rgba(0, 0, 0, 0.4);
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.data-table tr.highlighted {
    background: rgba(234, 179, 8, 0.18);
}

.data-table tr.highlighted:hover {
    background: rgba(234, 179, 8, 0.30);
}

/* Nr column in categories table */
.cat-nr-col {
    width: 48px;
    min-width: 48px;
    text-align: center;
    cursor: default !important;
    color: #94a3b8 !important;
}

.cat-nr-col:hover {
    background: rgba(0, 0, 0, 0.3) !important;
}

.cat-nr-cell {
    text-align: center;
    color: #94a3b8;
    font-size: 0.85rem;
}

/* Category group header rows */
.data-table tr.kat-group-header {
    background: rgba(0, 136, 204, 0.12);
    border-top: 2px solid rgba(0, 136, 204, 0.4);
    border-bottom: 1px solid rgba(0, 136, 204, 0.2);
}

.data-table tr.kat-group-header:hover {
    background: rgba(0, 136, 204, 0.12);
}

.data-table tr.kat-group-header td {
    padding: 0.6rem 1rem;
    border-bottom: none;
}

.kat-group-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.kat-group-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.kat-group-count {
    font-size: 0.78rem;
    font-weight: 600;
    background: rgba(0, 136, 204, 0.25);
    color: #7dd3fc;
    padding: 0.2rem 0.7rem;
    border-radius: 20px;
    letter-spacing: 0.5px;
}


/* Sorting indicators */
.sort-asc::after {
    content: ' ▲';
    font-size: 0.8em;
}

.sort-desc::after {
    content: ' ▼';
    font-size: 0.8em;
}

@media (max-width: 768px) {
    .header-top {
        padding: 1rem;
    }

    .menu-item {
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
    }

    .import-controls {
        flex-direction: column;
        width: 100%;
    }

    .btn-import,
    .btn-primary {
        width: 100%;
        text-align: center;
    }

    /* Responsive Tables */
    .data-table thead {
        display: none;
    }

    .data-table,
    .data-table tbody,
    .data-table tr,
    .data-table td {
        display: block;
        width: 100%;
    }

    .data-table tr {
        margin-bottom: 1rem;
        background: rgba(0, 0, 0, 0.3);
        border-radius: 8px;
        padding: 0.5rem;
    }

    .data-table td {
        text-align: right;
        padding-left: 50%;
        position: relative;
        border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
    }

    .data-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 1rem;
        width: 45%;
        text-align: left;
        font-weight: 700;
        color: var(--primary-color);
    }

    /* Override responsive rules for category header rows */
    .data-table tr.kat-group-header {
        background: rgba(0, 136, 204, 0.12);
        border-radius: 0;
        padding: 0;
        margin-bottom: 0;
    }

    .data-table tr.kat-group-header td {
        display: table-cell;
        padding: 0.6rem 1rem;
        padding-left: 1rem;
        text-align: left;
    }

    .data-table tr.kat-group-header td::before {
        display: none;
    }
}

/* Zuschlagsberechnung Angewendet Highlight */
.info-value-highlight {
    color: #ab0d0d !important;
    /* Dunkelrot */
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ── Modal Popup ── */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background: rgba(30, 41, 59, 0.95);
    padding: 2.5rem 3rem;
    border-radius: 16px;
    border: 1px solid rgba(239, 68, 68, 0.6);
    max-width: 450px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.7), inset 0 0 0 1px rgba(255,255,255,0.05);
}

.modal-title {
    color: #ef4444;
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.modal-message {
    color: #e2e8f0;
    margin-bottom: 2.5rem;
    font-size: 1.1rem;
    line-height: 1.5;
}

.modal-content .btn-primary {
    background: #ef4444;
    border-color: #ef4444;
    width: 100%;
}

.modal-content .btn-primary:hover {
    background: #dc2626;
    border-color: #dc2626;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.5);
}