/* =====================================================
   MITGLIEDER-DATENBLATT PRINT STYLES
   Farbig, modern und übersichtlich
   ===================================================== */

/* Seiten-Layout */
.print-member-sheet {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 9pt;
    color: #333;
}

.print-page {
    position: relative;
    /* ENTFERNT: min-height: 100%; */
    /* ENTFERNT: padding-bottom: 40px; */
}

.page-break-before {
    page-break-before: always;
}

/* ===== HEADER ===== */
.print-member-header {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    margin-bottom: 15px;
    border-radius: 10px;
    color: #fff;
}

.print-member-header.status-active { background: linear-gradient(135deg, #e74c3c, #c0392b); }
.print-member-header.status-youth { background: linear-gradient(135deg, #f39c12, #d68910); }
.print-member-header.status-child { background: linear-gradient(135deg, #3498db, #2980b9); }
.print-member-header.status-passive { background: linear-gradient(135deg, #95a5a6, #7f8c8d); }
.print-member-header.status-supporting { background: linear-gradient(135deg, #27ae60, #229954); }
.print-member-header.status-former { background: linear-gradient(135deg, #8e44ad, #7d3c98); }

.print-member-header-left { flex: 0 0 80px; }
.print-member-header-center { flex: 1; text-align: center; }
.print-member-header-right { flex: 0 0 120px; text-align: right; }

.print-member-title {
    font-size: 10pt;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.9;
}

.print-member-name {
    font-size: 22pt;
    font-weight: bold;
    margin: 5px 0;
}

.print-member-number {
    font-size: 11pt;
    opacity: 0.9;
}

.print-status-badge {
    display: inline-block;
    padding: 6px 12px;
    background: rgba(255,255,255,0.2);
    border-radius: 20px;
    font-weight: bold;
}

.print-status-icon { font-size: 14pt; margin-right: 5px; }

.print-honorary-badge {
    margin-top: 8px;
    padding: 4px 10px;
    background: #f1c40f;
    color: #333;
    border-radius: 15px;
    font-size: 9pt;
    font-weight: bold;
}

/* Mini-Header für Folgeseiten */
.print-mini-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 15px;
    margin-bottom: 15px;
    border-radius: 6px;
    color: #fff;
    font-size: 10pt;
}

.print-mini-name { font-weight: bold; }
.print-mini-number { opacity: 0.9; }

/* ===== SEKTIONEN ===== */
.print-section {
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
    page-break-inside: avoid;
}

.print-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 15px;
    color: #333 !important; /* Schwarze Schrift */
    font-weight: bold;
    background: #f5f5f5; /* Heller Hintergrund */
    border-bottom: 2px solid #e0e0e0;
}

.print-section-icon {
    font-size: 16pt;
    color: #333;
}

.print-section-title {
    font-size: 11pt;
    color: #333;
}

/* Farben für Sektions-Header - nur linker Rand farbig */
.bg-primary-print {
    background: #f5f5f5;
    border-left: 4px solid #3498db;
}

.bg-info-print {
    background: #f5f5f5;
    border-left: 4px solid #17a2b8;
}

.bg-success-print {
    background: #f5f5f5;
    border-left: 4px solid #27ae60;
}

.bg-warning-print {
    background: #f5f5f5;
    border-left: 4px solid #f39c12;
}

.bg-danger-print {
    background: #f5f5f5;
    border-left: 4px solid #e74c3c;
}

.bg-purple-print {
    background: #f5f5f5;
    border-left: 4px solid #9b59b6;
}

.bg-teal-print {
    background: #f5f5f5;
    border-left: 4px solid #20c997;
}

.bg-gold-print {
    background: #f5f5f5;
    border-left: 4px solid #f1c40f;
}

.bg-orange-print {
    background: #f5f5f5;
    border-left: 4px solid #e67e22;
}

.bg-cyan-print {
    background: #f5f5f5;
    border-left: 4px solid #00bcd4;
}

.print-section-body {
    padding: 12px 15px;
    background: #fff;
}

/* ===== DATEN-GRID ===== */
.print-data-grid {
    display: grid;
    gap: 6px;
}

.print-data-row {
    display: flex;
    padding: 4px 0;
    border-bottom: 1px dotted #e0e0e0;
}

.print-data-label {
    flex: 0 0 140px;
    color: #666;
    font-weight: 500;
}

.print-data-value {
    flex: 1;
    font-weight: 600;
}

.print-data-note {
    color: #888;
    font-weight: normal;
    font-size: 8pt;
}

.print-data-deceased {
    background: #fce4ec;
    padding: 6px 10px;
    border-radius: 4px;
    margin: 5px 0;
}

/* ===== SPALTEN-LAYOUTS ===== */
.print-two-col { display: flex; gap: 20px; }
.print-three-col { display: flex; gap: 15px; }
.print-col { flex: 1; }

/* ===== ADRESS-KARTE ===== */
.print-address-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.print-address-icon { font-size: 24pt; }
.print-address-content { font-size: 10pt; line-height: 1.5; }

/* ===== PRÄFERENZEN ===== */
.print-preferences {
    display: flex;
    gap: 20px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e0e0e0;
}

.print-pref-item {
    padding: 4px 12px;
    background: #f5f5f5;
    border-radius: 15px;
    font-size: 8pt;
}

.print-pref-item.active {
    background: #d4edda;
    color: #155724;
}

/* ===== TABELLEN ===== */
.print-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 9pt;
}

.print-table th,
.print-table td {
    padding: 8px 10px;
    border: 1px solid #e0e0e0;
    text-align: left;
}

.print-table thead {
    background: #f8f9fa;
}

.print-table th {
    font-weight: 600;
    color: #555;
}

.print-table-sm th,
.print-table-sm td {
    padding: 5px 8px;
    font-size: 8pt;
}

.print-table tr.row-active {
    background: #e8f5e9;
}

.print-table tr.row-expired {
    background: #ffebee;
}

/* ===== BADGES ===== */
.print-badge-active {
    display: inline-block;
    padding: 2px 8px;
    background: #27ae60;
    color: #fff;
    border-radius: 10px;
    font-size: 8pt;
    font-weight: bold;
}

.print-badge-ended {
    display: inline-block;
    padding: 2px 8px;
    background: #95a5a6;
    color: #fff;
    border-radius: 10px;
    font-size: 8pt;
}

.print-badge-valid {
    color: #27ae60;
    font-weight: bold;
}

.print-badge-expired {
    display: inline-block;
    padding: 2px 8px;
    background: #e74c3c;
    color: #fff;
    border-radius: 10px;
    font-size: 8pt;
}

/* ===== INFO-KARTEN (Dienstgrad, Gruppe, etc.) ===== */
.print-info-card {
    text-align: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.print-info-icon { font-size: 24pt; margin-bottom: 5px; }
.print-info-label { font-size: 8pt; color: #666; text-transform: uppercase; }
.print-info-value { font-size: 12pt; font-weight: bold; color: #333; }

/* ===== FUNKTIONEN-GRID ===== */
.print-functions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.print-function-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    border-left: 4px solid #95a5a6;
}

.print-function-card.active {
    border-left-color: #27ae60;
    background: #e8f5e9;
}

.print-function-icon { font-size: 16pt; }
.print-function-title { font-weight: 600; font-size: 9pt; }
.print-function-period { font-size: 8pt; color: #666; }

/* ===== QUALIFIKATIONEN-GRID ===== */
.print-qualifications-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.print-qual-card {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #27ae60;
}

.print-qual-card.expired {
    border-left-color: #e74c3c;
    background: #ffebee;
}

.print-qual-icon { font-size: 14pt; }
.print-qual-name { font-weight: 600; font-size: 9pt; }
.print-qual-dates { font-size: 7pt; color: #666; }
.print-qual-dates .expired { color: #e74c3c; font-weight: bold; }

/* ===== ACHIEVEMENTS-GRID ===== */
.print-achievements-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.print-achievement-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: linear-gradient(135deg, #fff9e6, #fff3cd);
    border-radius: 8px;
    border: 1px solid #f1c40f;
}

.print-achievement-card.youth {
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
    border-color: #e67e22;
}

.print-achievement-medal { font-size: 20pt; }
.print-achievement-name { font-weight: 600; font-size: 8pt; }
.print-achievement-date { font-size: 7pt; color: #666; }

/* ===== AWARDS-GRID ===== */
.print-awards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.print-award-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    background: linear-gradient(135deg, #fef9e7, #fcf3cf);
    border-radius: 8px;
    border: 1px solid #f1c40f;
}

.print-award-icon { font-size: 24pt; }
.print-award-name { font-weight: bold; font-size: 10pt; }
.print-award-date { font-size: 8pt; color: #666; }
.print-award-note { font-size: 8pt; color: #888; font-style: italic; margin-top: 3px; }

/* ===== SONSTIGE ===== */
.print-subsection-title {
    font-size: 10pt;
    font-weight: 600;
    color: #555;
    margin: 12px 0 8px 0;
    padding-bottom: 4px;
    border-bottom: 2px solid #e0e0e0;
}

.print-summary-box {
    margin-top: 10px;
    padding: 10px 15px;
    background: #e8f5e9;
    border-radius: 6px;
    border-left: 4px solid #27ae60;
    font-size: 10pt;
}

.print-no-data {
    padding: 15px;
    text-align: center;
    color: #999;
    font-style: italic;
}

.print-djf-badge {
    display: inline-block;
    padding: 6px 15px;
    background: #e67e22;
    color: #fff;
    border-radius: 20px;
    margin-bottom: 10px;
}

.print-djf-label { font-size: 8pt; opacity: 0.9; }
.print-djf-value { font-weight: bold; margin-left: 5px; }

/* ===== FOOTER ===== */
.print-page-footer {
    /* ENTFERNT: position: absolute; bottom: 0; left: 0; right: 0; */
    display: flex;
    justify-content: space-between;
    padding: 8px 15px;
    margin-top: 15px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    font-size: 8pt;
    color: #666;
}

/* ===== PRINT MEDIA ===== */
@media print {
    .print-member-sheet {
        margin: 0;
        padding: 0;
    }

    .print-page {
        page-break-inside: auto;
    }

    .print-section {
        page-break-inside: avoid;
        break-inside: avoid;
    }

        /* Verhindert große Leerräume vor Seitenumbrüchen */
        .print-section:last-child {
            margin-bottom: 0;
        }

    .page-break-before {
        page-break-before: always;
        break-before: page;
        margin-top: 0;
    }

    .print-member-header,
    .print-mini-header,
    .print-section-header,
    .print-info-card,
    .print-function-card.active,
    .print-qual-card,
    .print-achievement-card,
    .print-award-card,
    .print-summary-box,
    .print-address-card,
    .print-djf-badge,
    .print-badge-active,
    .print-badge-expired,
    .print-honorary-badge,
    .print-status-badge,
    .print-table tr.row-active,
    .print-table tr.row-expired,
    .print-pref-item.active {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}
