/**
 * TOF Rapor Print CSS (v5.0) — Lightbox Modal + Print Popup
 *
 * Ekran: Lightbox modal stilleri (.tof-modal-*)
 * Yazdır: Popup penceresi için .tof-rpw-* rapor stilleri
 */

/* ====================================================
   LIGHTBOX MODAL — OVERLAY
   ==================================================== */
.tof-modal-overlay {
    display: none; /* JS ile flex yapılır */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.88);
    z-index: 999999;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    padding: 20px;
    box-sizing: border-box;
}

/* ---- Modal Sarmalayıcı (Ortalanmış kart) ---- */
.tof-modal-wrapper {
    width: 100%;
    max-width: 840px;
    margin: 0 auto;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.9);
    flex-shrink: 0;
}

/* ---- Üst Araç Çubuğu ---- */
.tof-modal-toolbar {
    background: #2c3e50;
    color: #fff;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.tof-modal-title {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
    opacity: 0.95;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tof-modal-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.tof-modal-print-btn {
    background: #27ae60;
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    transition: background 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tof-modal-print-btn:hover {
    background: #1e8449;
    transform: translateY(-1px);
}

.tof-modal-close-btn {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.35);
    padding: 7px 13px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.2s;
    line-height: 1;
}

.tof-modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.7);
}

/* ---- Kaydırılabilir Alan (Kağıt Arka Planı) ---- */
.tof-modal-scroll {
    background: #404244;
    padding: 30px;
    min-height: 200px;
}

/* ---- A4 Kağıt Önizlemesi ---- */
.tof-modal-a4 {
    background: #ffffff;
    width: 100%;
    max-width: 794px;
    margin: 0 auto;
    padding: 1.5cm 2cm;
    box-sizing: border-box;
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.6);
    font-family: Arial, 'Helvetica Neue', sans-serif;
    font-size: 10pt;
    color: #000;
    min-height: 200px; /* İçerik yoksa da görünür */
}

/* ====================================================
   RAPOR İÇERİĞİ STİLLERİ (Modal + Popup Pencere)
   .tof-rpw-* → "Rapor Print Window" prefix
   ==================================================== */

/* ---- Üst Bilgi (Logolar) ---- */
.tof-rpw-header {
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #2c3e50;
}

.tof-rpw-logos {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.tof-rpw-logo-left,
.tof-rpw-logo-right {
    flex: 0 0 auto;
}

.tof-rpw-logo-left img,
.tof-rpw-logo-right img {
    display: block;
    height: 55px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
}

.tof-rpw-logo-center {
    flex: 1;
}

.tof-rpw-header-line {
    display: none; /* border-bottom ile çizgi var, bu gizli */
}

/* ---- Sporcu Fotoğrafı (Ortalı, İsmin Üstünde) ---- */
.tof-rpw-photo-wrap {
    text-align: center;
    margin: 12px 0 6px 0;
}

.tof-rpw-photo {
    display: inline-block;
    width: 100px;
    height: 120px;
    object-fit: cover;
    border: 1px solid #bbb;
    vertical-align: middle;
}

/* ---- Sporcu Adı (Ortalı) ---- */
.tof-rpw-athlete-title {
    text-align: center;
    margin: 0 0 14px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #ccc;
}

.tof-rpw-athlete-title h1 {
    font-size: 18pt;
    font-weight: bold;
    margin: 0 0 3px 0;
    color: #000;
    line-height: 1.2;
}

.tof-rpw-athlete-title p {
    font-size: 8.5pt;
    color: #666;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ---- Künye (Sol) + İstatistikler (Sağ) ---- */
.tof-rpw-info-row {
    display: flex;
    flex-direction: row;
    gap: 20px;
    margin-bottom: 18px;
    align-items: flex-start;
}

.tof-rpw-meta-col {
    flex: 1;
}

.tof-rpw-meta-col p,
.tof-rpw-stats-col p {
    margin: 0 0 4px 0;
    font-size: 9.5pt;
    line-height: 1.5;
    color: #000;
}

.tof-rpw-stats-col {
    flex: 1.2;
    border-left: 3px solid #2c3e50;
    padding-left: 14px;
}

.tof-rpw-stats-col p strong {
    color: #2c3e50;
    font-weight: bold;
    display: inline-block;
    min-width: 150px;
}

/* ---- Bölüm Blokları ---- */
.tof-rpw-section {
    margin-top: 16px;
}

.tof-rpw-section-title {
    font-size: 9pt;
    font-weight: bold;
    color: #fff;
    background: #2c3e50;
    padding: 4px 8px;
    margin: 0 0 1px 0;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* ---- Tablolar ---- */
.tof-rpw-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 7.5pt;
    margin: 0;
}

.tof-rpw-table thead th {
    background: #ecf0f1;
    color: #000;
    border: 1px solid #aaa;
    padding: 4px 5px;
    font-weight: bold;
    text-align: left;
    white-space: nowrap;
}

.tof-rpw-table tbody td {
    border: 1px solid #ccc;
    padding: 3px 5px;
    vertical-align: middle;
    color: #000;
}

.tof-rpw-table tbody tr:nth-child(even) td {
    background: #f7f7f7;
}

.tof-rpw-wrap {
    white-space: normal;
    word-break: break-word;
    max-width: 170px;
}

/* ---- Alt Bilgi ---- */
.tof-rpw-footer {
    margin-top: 20px;
    padding-top: 8px;
    border-top: 1px solid #bbb;
}

.tof-rpw-footer-sponsors {
    text-align: center;
    margin-bottom: 5px;
}

.tof-rpw-footer-sponsors img {
    display: block;
    width: 100%;
    max-height: 45px;
    object-fit: contain;
    margin: 0 auto;
}

.tof-rpw-footer-text {
    text-align: center;
}

.tof-rpw-footer-text p {
    font-size: 7.5pt;
    color: #666;
    margin: 0 0 2px 0;
}

.tof-rpw-timestamp {
    display: block;
    font-size: 7pt;
    color: #999;
}

/* FA ikonları rapor içinde gizli */
.tof-modal-a4 .fa,
.tof-modal-a4 .fas,
.tof-modal-a4 .far {
    display: none;
}

/* ====================================================
   POPUP PENCERE — Print Window Body
   (tofPrintFromModal() tarafından oluşturulan pencere)
   ==================================================== */
body.tof-print-popup {
    font-family: Arial, 'Helvetica Neue', sans-serif;
    font-size: 10pt;
    color: #000;
    background: #fff;
    margin: 0;
    padding: 30px;
    box-sizing: border-box;
}

body.tof-print-popup .fa,
body.tof-print-popup .fas,
body.tof-print-popup .far {
    display: none !important;
}

/* ====================================================
   @PAGE — Yazdırma Sayfa Yapısı
   ==================================================== */
@media print {
    @page {
        size: A4 portrait;
        margin: 1.5cm;
    }

    body.tof-print-popup {
        margin: 0 !important;
        padding: 0 !important;
    }

    .tof-rpw-section-title {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .tof-rpw-table thead th {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .tof-rpw-table tbody tr:nth-child(even) td {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .tof-rpw-table tbody tr {
        page-break-inside: avoid;
    }
}
