/* ==========================================================================
   Optik Form Sihirbazı - Modüler Sayfa Stilleri (TERFIUI v5)
   ========================================================================== */

/* Kompakt Optik Form Hero Kartı (Kompakt İnce Görünüm) */
.gd-optik-hero-compact {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    padding: 14px 18px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 0 !important;
}

.gd-optik-hero-compact .gd-page-header-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #eff6ff;
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.gd-optik-hero-compact .gd-page-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    line-height: 1.3;
}

.gd-optik-hero-compact .gd-page-subtitle {
    font-size: 12.5px;
    color: #64748b;
    margin: 0;
    line-height: 1.4;
}

/* Sayfa Body Kapsayıcısı — site.css .gd-page-body ana omurgasına bağlı */

/* İki Sütunlu Düzen */
.gd-optik-split {
    display: flex;
    gap: 12px;
    align-items: stretch;
    width: 100%;
}

/* Sol Sütun — Yapılandırma Paneli */
.gd-optik-config-card {
    flex: 3;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.01), 0 4px 12px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
    height: fit-content;
}

.gd-optik-config-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 14px;
}

.gd-optik-config-group {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f1f5f9;
}

.gd-optik-config-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 800;
    color: #64748b;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gd-optik-btn-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(55px, 1fr));
    gap: 8px;
}

.btn-toggle {
    padding: 10px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-toggle:hover {
    border-color: #2563eb;
    color: #2563eb;
    background: #eff6ff;
}

.btn-toggle.active {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
}

.gd-optik-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.gd-optik-checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 700;
    color: #334155;
}

.gd-optik-checkbox-item input {
    width: 18px;
    height: 18px;
    accent-color: #2563eb;
    border-radius: 4px;
    cursor: pointer;
}

.gd-optik-print-btn {
    width: 100%;
    justify-content: center;
    padding: 14px 20px;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
}

.gd-optik-print-note {
    margin-top: 16px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 13px;
    color: #166534;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    line-height: 1.5;
}

.gd-optik-print-note-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #16a34a;
    flex-shrink: 0;
    margin-top: 1px;
}

.gd-optik-print-note-text strong {
    color: #15803d;
}

/* Sağ Sütun — Önizleme Kartı */
.gd-optik-preview-card {
    flex: 7;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    overflow-x: auto;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.01), 0 4px 12px rgba(0, 0, 0, 0.02);
}

:root {
    --a4-width: 210mm;
    --a4-height: 297mm;
}

.preview-canvas-bg {
    background: #cbd5e1;
    padding: 24px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    overflow-x: auto;
    width: 100%;
}

/* OPTIK FORM DESIGN (A4 SHEET) */
.optik-form-page {
    width: var(--a4-width);
    height: var(--a4-height);
    background: #ffffff;
    padding: 6mm 6mm;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    font-family: 'Inter', sans-serif;
    box-sizing: border-box;
    overflow: hidden;
    flex-shrink: 0;
}

.optik-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 4mm;
    padding-bottom: 2mm;
    border-bottom: 1.5px solid #000;
}

.optik-logo-area {
    display: flex;
    align-items: center;
    gap: 8px;
}

.optik-logo-area img {
    height: 32px;
}

.optik-title-area {
    text-align: right;
}

.optik-main-title {
    font-size: 14pt;
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 3px;
    color: #000;
}

.optik-sub-title {
    font-size: 9pt;
    font-weight: 600;
    color: #475569;
}

.optik-body {
    display: flex;
    gap: 3mm;
    flex: 1;
    overflow: hidden;
}

/* CANDIDATE SECTION */
.optik-candidate-section {
    width: 30%;
    min-width: 55mm;
    display: flex;
    flex-direction: column;
    gap: 5mm;
}

.info-box {
    border: 1.5px solid #000;
    padding: 2.5mm;
}

.info-label {
    font-size: 7.5pt;
    font-weight: 800;
    margin-bottom: 1.5mm;
    text-transform: uppercase;
    color: #000;
}

/* T.C. NO BOX GRID */
.tc-box-grid {
    display: grid;
    grid-template-columns: repeat(11, 1fr);
    border-top: 1px solid #000;
    border-left: 1px solid #000;
}

.tc-cell {
    height: 46mm;
    border-right: 1px solid #000;
    border-bottom: 1px solid #000;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 1mm;
    gap: 0.6mm;
}

.tc-bubble {
    width: 3.6mm;
    height: 3.6mm;
    border: 1px solid #000;
    border-radius: 50%;
    font-size: 6pt;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #000;
}

/* ANSWERS SECTION */
.optik-answers-section {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 2mm;
    align-content: flex-start;
}

.answer-column {
    display: flex;
    flex-direction: column;
    gap: 1.2mm;
}

.answer-row {
    display: flex;
    align-items: center;
    gap: 1.5mm;
    flex-wrap: nowrap !important;
}

.q-num {
    width: 5mm;
    font-size: 7.5pt;
    font-weight: 800;
    text-align: right;
    color: #000;
}

.bubble-row {
    display: flex;
    gap: 1.2mm;
    flex-wrap: nowrap !important;
}

.bubble {
    width: 4.8mm;
    height: 4.8mm;
    border: 1.1px solid #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 7pt;
    font-weight: 900;
    background: #f8fafc;
    color: #000;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1200px) {
    .gd-optik-split {
        flex-direction: column;
    }
    .gd-optik-config-card,
    .gd-optik-preview-card {
        flex: none !important;
    }
}

@media screen and (min-width: 769px) {
    .gd-optik-preview-card,
    .preview-canvas-bg {
        overflow-x: hidden !important;
    }
}

@media screen and (max-width: 768px) {
    .gd-optik-config-card,
    .gd-optik-preview-card {
        padding: 20px 16px !important;
    }

    .optik-form-page {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: auto !important;
        padding: 15px 10px !important;
    }

    .optik-body {
        flex-direction: column !important;
        gap: 15px !important;
    }

    .optik-candidate-section {
        width: 100% !important;
    }

    .optik-answers-section {
        width: 100% !important;
        gap: 15px !important;
        justify-content: space-between !important;
    }

    .answer-column {
        flex: 1 !important;
        min-width: 120px !important;
    }

    .tc-cell {
        height: auto !important;
        padding-bottom: 5px !important;
    }

    .tc-bubble {
        width: 18px !important;
        height: 18px !important;
        font-size: 8px !important;
    }

    .bubble {
        width: 22px !important;
        height: 22px !important;
        font-size: 9px !important;
    }

    .preview-canvas-bg {
        padding: 10px !important;
    }
}

/* ==========================================================================
   YAZDIRMA STİLLERİ (PRINT MEDIA OVERRIDES)
   ========================================================================== */
@media print {
    @page {
        size: A4;
        margin: 0;
    }
    
    html, body {
        height: 297mm;
        overflow: hidden;
    }
    body {
        visibility: hidden;
        background: white !important;
        margin: 0 !important;
        padding: 0 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    header, footer, .gd-optik-config-card, .gd-breadcrumb-bar, .btn-print, .gd-page-header {
        display: none !important;
    }

    .preview-canvas-bg {
        padding: 0 !important;
        margin: 0 !important;
        background: white !important;
        border: none !important;
        overflow: hidden !important;
    }

    #optikForm {
        visibility: visible;
        position: absolute;
        left: 0;
        top: 0;
        width: 210mm !important;
        height: 297mm !important;
        margin: 0 !important;
        padding: 10mm 12mm !important;
        box-shadow: none !important;
        border: none !important;
        transform: none !important;
        display: flex !important;
        flex-direction: column !important;
        background: white !important;
    }

    #optikForm * {
        visibility: visible;
    }

    .optik-body {
        display: flex !important;
        flex-direction: row !important;
        gap: 3mm !important;
    }

    .optik-candidate-section {
        width: 66mm !important;
    }

    .optik-answers-section {
        flex: 1 !important;
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 2mm !important;
    }
}
