﻿/* Proforma Preview Modal CSS */

/* Modal Genel Ayarları */
#proformaPreviewModal .modal-dialog {
    max-width: 95vw;
    width: 95vw;
    margin: 1rem auto;
}

#proformaPreviewModal .modal-content {
    height: 95vh;
}

#proformaPreviewModal .modal-body {
    overflow-y: auto;
    max-height: calc(95vh - 120px);
    padding: 20px;
    background: #f8f9fa;
}

/* Modal Header Butonları */
.modal-header .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 38px;
}

/* Proforma Sayfa Tasarımı */
.proforma-page {
    width: 100%;
    max-width: 1200px;
    min-height: auto;
    background: white;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    padding: 40px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    color: #333;
    margin: 0 auto;
}

/* Şirket Header */
.company-header {
    border-bottom: 3px solid #007bff;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.company-brand .company-name {
    font-size: 32px;
    font-weight: bold;
    color: #007bff;
    margin: 0;
    letter-spacing: -1px;
}

.company-brand .company-slogan {
    font-size: 14px;
    color: #666;
    font-style: italic;
    margin-top: 5px;
}

.company-contact {
    text-align: right;
}

.contact-item {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 8px;
    font-size: 13px;
    color: #555;
}

    .contact-item span {
        margin-left: 8px;
    }

/* Proforma Başlık Bölümü */
.proforma-title-section {
    margin: 30px 0;
}

.document-title {
    font-size: 28px;
    font-weight: bold;
    color: #333;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.document-subtitle {
    font-size: 14px;
    color: #666;
    margin-top: 5px;
}

.document-info {
    text-align: right;
}

/* Bilgi Tabloları */
.info-table {
    width: 100%;
    margin-bottom: 20px;
}

    .info-table td {
        padding: 8px 12px;
        border: 1px solid #ddd;
        font-size: 13px;
    }

        .info-table td:first-child {
            background-color: #f8f9fa;
            font-weight: 600;
            width: 40%;
        }

/* Müşteri Bölümü */
.customer-section {
    margin: 25px 0;
}

    .customer-section h4 {
        font-size: 16px;
        font-weight: bold;
        color: #333;
        margin: 0 0 15px 0;
        text-transform: uppercase;
    }

.billing-table {
    width: 100%;
    border-collapse: collapse;
}

    .billing-table td {
        padding: 8px 12px;
        border: 1px solid #ddd;
        font-size: 13px;
        vertical-align: top;
    }

        .billing-table td:first-child {
            background-color: #f8f9fa;
            font-weight: 600;
            width: 30%;
        }

/* Ürün/Hizmet Tablosu */
.items-section {
    margin: 30px 0;
}

.items-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

    .items-table th {
        background-color: #f8f9fa;
        color: #333;
        font-weight: bold;
        padding: 12px 8px;
        border: 1px solid #333;
        text-align: center;
        font-size: 12px;
    }

    .items-table td {
        padding: 10px 8px;
        border: 1px solid #333;
        font-size: 12px;
        text-align: center;
    }

        .items-table td:nth-child(2) {
            text-align: left;
            padding-left: 12px;
        }

    .items-table .amount {
        text-align: right;
        padding-right: 12px;
        font-weight: 600;
    }

/* Hesaplama Tablosu */
.calculation-section {
    margin: 30px 0;
    display: flex;
    justify-content: flex-end;
}

.calculation-table {
    width: 400px;
    border-collapse: collapse;
}

    .calculation-table td {
        padding: 12px 15px;
        border: 1px solid #333;
        font-size: 14px;
    }

        .calculation-table td:first-child {
            width: 60%;
            background-color: #f8f9fa;
            font-weight: 600;
        }

    .calculation-table .amount {
        text-align: right;
        font-weight: 600;
    }

.total-row {
    background: #f8f9fa;
    border-top: 2px solid #333;
}

.grand-total {
    font-size: 18px;
    color: #007bff;
    font-weight: bold;
}

/* Notlar Bölümü */
.notes-section {
    margin: 30px 0;
    border-top: 1px solid #ddd;
    padding-top: 20px;
}

    .notes-section h5 {
        font-size: 16px;
        font-weight: bold;
        margin-bottom: 15px;
        color: #333;
    }

    .notes-section ul {
        margin: 0;
        padding-left: 20px;
        list-style-type: disc;
    }

    .notes-section li {
        margin-bottom: 8px;
        font-size: 12px;
        line-height: 1.5;
    }

/* İmza Bölümü */
.document-footer {
    margin-top: 50px;
    page-break-inside: avoid;
}

.signature-box {
    text-align: center;
    margin-top: 40px;
}

.signature-title {
    font-weight: bold;
    color: #333;
    margin-bottom: 40px;
    font-size: 14px;
}

.signature-line {
    border-bottom: 2px solid #333;
    width: 200px;
    margin: 0 auto 15px auto;
}

.signature-name {
    font-weight: bold;
    color: #007bff;
    font-size: 14px;
}

.signature-date {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

/* Responsive */
@media (max-width: 1200px) {
    .proforma-page {
        width: 100%;
        padding: 20px;
    }
}

/* Print Stilleri */
@media print {
    /* Modal ve gereksiz elemanları gizle */
    .modal-header,
    .modal-footer,
    .btn,
    .no-print {
        display: none !important;
    }

    /* Body ayarları */
    body {
        background: white !important;
        margin: 0 !important;
        padding: 0 !important;
        font-family: Arial, sans-serif !important;
        font-size: 12px !important;
        line-height: 1.4 !important;
        color: #000 !important;
    }

    /* Modal body */
    .modal-body {
        overflow: visible !important;
        max-height: none !important;
        padding: 0 !important;
        background: white !important;
        margin: 0 !important;
    }

    /* Proforma sayfası */
    .proforma-page {
        box-shadow: none !important;
        padding: 15mm !important;
        width: 100% !important;
        min-height: auto !important;
        margin: 0 !important;
        background: white !important;
    }

    /* Şirket başlığı */
    .company-header {
        border-bottom: 2px solid #000 !important;
        padding-bottom: 10px !important;
        margin-bottom: 20px !important;
    }

    .company-name {
        font-size: 24px !important;
        font-weight: bold !important;
        color: #000 !important;
        margin: 0 !important;
    }

    /* Proforma başlığı */
    .document-title {
        font-size: 20px !important;
        font-weight: bold !important;
        color: #000 !important;
        margin: 15px 0 !important;
    }

    /* Tablolar */
    .info-table,
    .billing-table,
    .items-table,
    .calculation-table {
        width: 100% !important;
        border-collapse: collapse !important;
        margin-bottom: 15px !important;
        border: 1px solid #000 !important;
    }

        .info-table td,
        .billing-table td,
        .items-table td,
        .items-table th,
        .calculation-table td {
            border: 1px solid #000 !important;
            padding: 6px 4px !important;
            font-size: 10px !important;
            text-align: left !important;
            vertical-align: top !important;
        }

        .items-table th {
            background-color: #f5f5f5 !important;
            font-weight: bold !important;
            text-align: center !important;
        }

    /* Sağa hizalama */
    .text-end,
    .amount {
        text-align: right !important;
    }

    /* Toplam satırları */
    .total-row,
    .grand-total {
        font-weight: bold !important;
        background-color: #f0f0f0 !important;
    }

    /* Notlar */
    .notes-section {
        margin-top: 20px !important;
        font-size: 9px !important;
        page-break-inside: avoid !important;
    }

    /* İmza bölümü */
    .document-footer {
        margin-top: 30px !important;
        page-break-inside: avoid !important;
    }

    .signature-box {
        text-align: center !important;
        margin-top: 40px !important;
    }

    .signature-line {
        border-bottom: 1px solid #000 !important;
        width: 200px !important;
        margin: 30px auto 10px auto !important;
    }

    /* Bootstrap grid */
    .row {
        margin: 0 !important;
    }

    .col-md-6,
    .col-md-4,
    .col-md-8 {
        padding: 0 5px !important;
    }
}

@page {
    size: A4;
    margin: 15mm;
}
