/**
 * TOF Rapor Print CSS (v6.2.6) — 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 !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100vh !important;
    height: 100dvh !important;
    background: rgba(0, 0, 0, 0.92) !important;
    z-index: 2147483600 !important;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    padding: 24px;
    box-sizing: border-box;
}

.tof-modal-shell {
    display: none;
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100vh !important;
    height: 100dvh !important;
    background: rgba(0, 0, 0, 0.92) !important;
    z-index: 2147483600 !important;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    padding: 24px;
    box-sizing: border-box;
}

.tof-modal-shell.is-open {
    display: flex !important;
}

.tof-modal-shell-open,
.tof-modal-shell-open body {
    overflow: hidden !important;
}

.tof-modal-dialog {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 48px);
    max-height: calc(100dvh - 48px);
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.9);
    flex-shrink: 0;
}

/* ---- Modal Sarmalayıcı (Ortalanmış kart) ---- */
.tof-modal-wrapper {
    width: 100%;
    max-width: 840px;
    margin: 0 auto;
}

/* ---- Ü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;
}

/* OKUNAKLI BUTONLAR (v5.1 Fix) */
.tof-btn-print {
    background: #27ae60 !important;
    color: #ffffff !important;
    border: none !important;
    padding: 8px 18px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    transition: background 0.2s !important;
}

.tof-btn-print:hover {
    background: #1e8449 !important;
}

.tof-modal-close {
    background: #e74c3c !important;
    color: #ffffff !important;
    border: none !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    font-size: 20px !important;
    line-height: 32px !important;
    text-align: center !important;
    padding: 0 !important;
    transition: background 0.2s !important;
}

.tof-modal-close:hover {
    background: #c0392b !important;
}

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

/* ---- Rapor İframe Konteyner ---- */
.tof-modal-content {
    min-height: 0;
    flex: 1 1 auto;
    overflow-y: auto;
    background: #404244;
}

/* ---- A4 Kağıt Önizlemesi (Geriye Dönük Uyumluluk için duruyor) ---- */
.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;
}

/**
 * Print Utility Sınıfları
 */
.tof-print-only-text {
    display: none !important; /* Ekranda her zaman gizli */
}

.tof-ui-only {
    display: inline-block !important; /* Ekranda her zaman görünür */
}

/* Rapor Modalı Önizleme (Lightbox-Iframe): İkonları gizle, Baskı metinlerini göster */
/* Not: Iframe sistemi kullanıldığı için bunlar aslında 'tof-report-engine.css' içinden yönetilir. */
/* Ancak ana sayfadaki kaynak konteyner için burada durmaları güvenlidir. */

#tof-report-modal .tof-ui-only,
#tof-report-modal .medal-gold,
#tof-report-modal .medal-silver,
#tof-report-modal .medal-bronze {
    display: none !important;
}

#tof-report-modal .tof-print-only-text {
    display: inline !important;
}

/* ====================================================
   RAPOR İÇERİĞİ STİLLERİ (Kaynak Konteyner için)
   ==================================================== */
.tof-rpw-header { margin-bottom: 12px; padding-bottom: 8px; border-bottom: 2px solid #2c3e50; }
.tof-rpw-logos { display: flex; justify-content: space-between; align-items: center; }
.tof-rpw-logo-left img, .tof-rpw-logo-right img { height: 55px; width: auto; object-fit: contain; }
.tof-rpw-photo-wrap { display: flex; justify-content: center; margin: 15px 0; }
.tof-rpw-photo { width: 120px; height: 150px; object-fit: cover; }
.tof-rpw-athlete-title { text-align: center; margin-bottom: 14px; }
.tof-rpw-athlete-title h1 { font-size: 18pt; font-weight: bold; }
.tof-rpw-info-row { display: flex; margin-bottom: 25px; }
.tof-rpw-meta-col, .tof-rpw-stats-col { flex: 0 0 50%; padding: 0 15px; }
.tof-rpw-section-title { font-size: 9pt; font-weight: bold; color: #fff; background: #2c3e50; padding: 4px 8px; display: block; }
.tof-rpw-table { width: 100%; border-collapse: collapse; font-size: 7.5pt; }
.tof-rpw-table th { background: #ecf0f1; padding: 6px; font-weight: bold; text-align: left; }
.tof-rpw-table td { border-bottom: 1px solid #eee; padding: 5px; }
.tof-rpw-footer { margin-top: 20px; padding-top: 8px; border-top: 1px solid #bbb; text-align: center; }
