/* Kuru Temizleme Yazıcı Fiş Kağıdı ve Etiket Sistemi */

/* ===== GENEL YAZDIR STILLERĪ ===== */
@media print {

    /* Sayfa ayarları - 80mm thermal printer için optimize */
    @page {
        margin: 0;
        size: 80mm auto;
        padding: 0;
    }

    /* Print sırasında gizlenecek elementler */
    .no-print,
    .action-btn,
    .excel-action-btn,
    .top-actions,
    .search-section,
    .tab-header,
    .excel-summary-footer,
    nav,
    .navbar,
    .sidebar,
    .modal-overlay,
    .dropdown-menu {
        display: none !important;
    }

    /* Print alanı optimize edilmesi */
    body {
        background: white !important;
        color: black !important;
        font-family: 'Courier New', monospace !important;
        font-size: 10px !important;
        line-height: 1.2 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Print container */
    .print-container {
        width: 76mm !important;
        max-width: 76mm !important;
        margin: 0 auto !important;
        padding: 2mm !important;
        background: white !important;
        page-break-inside: avoid !important;
    }
}

/* ===== 80MM FİŞ KAĞIDI TEMPLATE ===== */
.receipt-template {
    width: 76mm;
    max-width: 76mm;
    margin: 0 auto;
    padding: 5mm;
    background: white;
    font-family: 'Courier New', monospace;
    font-size: 10px;
    line-height: 1.3;
    color: black;
    border: 1px solid #ddd;
    display: none;
    /* Sadece print sırasında gösterilir */
}

.receipt-header {
    text-align: center;
    border-bottom: 1px dashed #333;
    padding-bottom: 3mm;
    margin-bottom: 3mm;
}

.receipt-header .company-name {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 2px;
}

.receipt-header .company-info {
    font-size: 8px;
    line-height: 1.2;
    margin-bottom: 1mm;
}

.receipt-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3mm;
    border-bottom: 1px dashed #333;
    padding-bottom: 2mm;
}

.receipt-number {
    font-weight: bold;
    font-size: 11px;
}

.receipt-date {
    font-size: 9px;
}

.customer-section {
    margin-bottom: 3mm;
    border-bottom: 1px dashed #333;
    padding-bottom: 2mm;
}

.customer-section .section-title {
    font-weight: bold;
    font-size: 10px;
    margin-bottom: 1mm;
    text-transform: uppercase;
}

.customer-name {
    font-size: 11px;
    font-weight: bold;
    margin-bottom: 1mm;
}

.customer-contact {
    font-size: 8px;
    line-height: 1.2;
}

.items-section {
    margin-bottom: 3mm;
}

.items-section .section-title {
    font-weight: bold;
    font-size: 10px;
    margin-bottom: 2mm;
    text-transform: uppercase;
    border-bottom: 1px solid #333;
    padding-bottom: 1mm;
}

.item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1mm;
    font-size: 9px;
}

.item-description {
    flex: 1;
    margin-right: 2mm;
}

.item-price {
    font-weight: bold;
    white-space: nowrap;
}

.receipt-total {
    border-top: 2px solid #333;
    padding-top: 2mm;
    margin-top: 3mm;
    text-align: right;
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1mm;
}

.total-row.grand-total {
    font-size: 12px;
    font-weight: bold;
    border-top: 1px solid #333;
    padding-top: 1mm;
    margin-top: 2mm;
}

.receipt-footer {
    text-align: center;
    margin-top: 3mm;
    padding-top: 2mm;
    border-top: 1px dashed #333;
    font-size: 8px;
    line-height: 1.3;
}

.thank-you {
    font-weight: bold;
    margin-bottom: 1mm;
}

/* ===== TURUNCU ETİKET TEMPLATE ===== */
.label-template {
    width: 60mm;
    height: 30mm;
    margin: 0 auto;
    padding: 2mm;
    background: #ff9800;
    /* Turuncu background */
    color: white;
    font-family: 'Arial', sans-serif;
    font-weight: bold;
    display: none;
    /* Sadece print sırasında gösterilir */
    border-radius: 3mm;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.label-header {
    text-align: center;
    font-size: 8px;
    margin-bottom: 1mm;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.label-customer {
    text-align: center;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 1mm;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.label-code {
    text-align: center;
    font-size: 10px;
    font-weight: bold;
    background: rgba(255, 255, 255, 0.2);
    padding: 1mm;
    border-radius: 2mm;
    margin-bottom: 1mm;
}

.label-order {
    text-align: center;
    font-size: 9px;
    font-weight: normal;
}

.label-background-pattern {
    position: absolute;
    top: 0;
    right: 0;
    width: 15mm;
    height: 15mm;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(50%, -50%);
}

/* ===== PRINT BUTONLARI ===== */
.print-buttons {
    display: flex;
    gap: 10px;
    margin: 10px 0;
    flex-wrap: wrap;
}

.print-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.print-btn:hover {
    background: #1976D2;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.print-btn:active {
    transform: translateY(0);
}

.print-btn.receipt {
    background: #4CAF50;
}

.print-btn.receipt:hover {
    background: #45a049;
}

.print-btn.label {
    background: #FF9800;
}

.print-btn.label:hover {
    background: #F57C00;
}

.print-btn.preview {
    background: #607D8B;
}

.print-btn.preview:hover {
    background: #546E7A;
}

/* ===== PRINT PREVIEW MODAL ===== */
.print-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.print-preview-content {
    background: white;
    border-radius: 12px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: slideInUp 0.3s ease;
    display: flex;
    flex-direction: column;
}

.print-preview-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

.print-preview-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.print-preview-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.print-preview-close:hover {
    background: #e0e0e0;
    color: #333;
}

.print-preview-body {
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #f0f2f5;
    flex: 1;
}

.preview-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.print-preview-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* ===== RESPONSIVE PRINT CONTROLS ===== */
@media (max-width: 768px) {
    .print-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .print-btn {
        justify-content: center;
        margin-bottom: 10px;
    }

    .print-preview-content {
        margin: 10px;
        max-width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
    }

    .print-preview-body {
        padding: 15px;
    }
}

/* ===== PRINT MEDIA QUERIES - 80MM THERMAL PRINTER OPTIMIZATION ===== */
@media print and (width: 80mm) {

    .receipt-template,
    .label-template {
        display: block !important;
    }

    .receipt-template {
        width: 76mm !important;
        padding: 2mm !important;
        font-size: 9px !important;
    }

    .label-template {
        width: 76mm !important;
        height: 25mm !important;
        padding: 1.5mm !important;
    }

    .label-customer {
        font-size: 11px !important;
    }

    .label-code {
        font-size: 9px !important;
    }
}

/* ===== THERMAL PRINTER SPECIFIC STYLES ===== */
@media print and (monochrome) {
    .label-template {
        background: black !important;
        color: white !important;
    }

    .label-background-pattern {
        background: rgba(255, 255, 255, 0.2) !important;
    }

    .label-code {
        background: rgba(255, 255, 255, 0.3) !important;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== PRINT QUALITY OPTIMIZATION ===== */
@media print {
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .receipt-template,
    .label-template {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    /* Ensure proper font rendering for thermal printers */
    body,
    .receipt-template,
    .label-template {
        -webkit-font-smoothing: antialiased !important;
        -moz-osx-font-smoothing: grayscale !important;
    }
}

/* ===== PRINT SECTION INDICATORS ===== */
.print-section {
    position: relative;
    margin: 10px 0;
    padding: 15px;
    border: 2px dashed #2196F3;
    border-radius: 8px;
    background: #f8f9ff;
}

.print-section::before {
    content: "📄 Yazdırılabilir Bölge";
    position: absolute;
    top: -10px;
    left: 15px;
    background: white;
    padding: 0 10px;
    color: #2196F3;
    font-size: 12px;
    font-weight: bold;
}

.print-section.label::before {
    content: "🏷️ Etiket Bölgesi";
    color: #FF9800;
}

.print-section.receipt::before {
    content: "🧾 Fiş Bölgesi";
    color: #4CAF50;
}

/* Print section sadece screen'de görünür */
@media print {
    .print-section {
        border: none !important;
        background: transparent !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .print-section::before {
        display: none !important;
    }
}