/* rg-table-subprint.css */

/* Print Modal Styles */
#printSubModal.rg-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    display: none;
    overflow-x: hidden;
    overflow-y: auto;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

#printSubModal.rg-modal.show {
    display: flex !important;
    align-items: center;
    justify-content: center;
    /* ลบ animation ออก */
}

#printSubModal .rg-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
}

#printSubModal .rg-modal-content {
    position: relative;
    width: 400px;
    max-width: calc(100vw - 32px);
    margin: 16px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1;
}

#printSubModal .rg-modal-header {
    position: sticky;
    top: 0;
    padding: 16px 20px;
    background: white;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 2;
}

#printSubModal .rg-modal-header h3 {
    font-size: 18px;
    margin: 0;
    color: #2c3e50;
    font-weight: 600;
}

#printSubModal .rg-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

#printSubModal .rg-modal-close:hover {
    background-color: #f8f9fa;
    color: #343a40;
}

#printSubModal .rg-modal-body {
    padding: 20px;
    max-height: calc(100vh - 180px);
    overflow-y: auto;
}

#printSubModal .rg-modal-footer {
    position: sticky;
    bottom: 0;
    padding: 16px 20px;
    background: white;
    border-top: 1px solid #e9ecef;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    z-index: 2;
}

/* Print Preview Styles */
#printSubArea.print-preview {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 20px;
}

/* Slip Content Styles */
.slip-header {
    text-align: center;
    margin-bottom: 15px;
}

.slip-header h2 {
    font-size: 20px;
    margin: 0 0 5px 0;
    font-weight: 600;
    color: #2c3e50;
}

.slip-header p {
    margin: 0;
    color: #6c757d;
}

.slip-section {
    margin-bottom: 20px;
}

.slip-section h3 {
    font-size: 16px;
    color: #2c3e50;
    margin: 0 0 10px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
}

.slip-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    line-height: 1.5;
}

.slip-label {
    color: #6c757d;
    flex: 1;
}

.slip-value {
    color: #2c3e50;
    flex: 1;
    text-align: right;
    font-weight: 500;
}

.slip-divider {
    height: 1px;
    background: #e9ecef;
    margin: 15px 0;
}

.slip-qrcode {
    text-align: center;
    margin: 20px 0;
}

.slip-qrcode img {
    max-width: 100%;
    height: auto;
}

.slip-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
    color: #6c757d;
}

.slip-footer p {
    margin: 5px 0;
}

/* Button Styles */
.rg-btn {
    padding: 8px 16px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.rg-btn-primary {
    background: #0d6efd;
    color: white;
}

.rg-btn-primary:hover {
    background: #0b5ed7;
}

.rg-btn-secondary {
    background: #e9ecef;
    color: #495057;
}

.rg-btn-secondary:hover {
    background: #dde1e5;
}

.rg-btn i {
    font-size: 14px;
}

.rg-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* Print Button in Table */
.k-print-btn {
    padding: 6px 12px;
    border-radius: 4px;
    border: none;
    background: #0d6efd;
    color: white;
    cursor: pointer;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.k-print-btn:hover {
    background: #0b5ed7;
}

.k-print-btn i {
    font-size: 12px;
}

.k-print-btn:disabled {
    background: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
}

/* Loading Spinner */
.k-print-btn .fa-spinner {
    animation: spin 1s linear infinite;
}

/* Scrollbar Styling */
#printSubModal .rg-modal-body::-webkit-scrollbar {
    width: 6px;
}

#printSubModal .rg-modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

#printSubModal .rg-modal-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

#printSubModal .rg-modal-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Animations */
@keyframes fadeInPrint {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    #printSubModal .rg-modal-content {
        width: 100% !important;
        margin: 0;
        min-height: 100vh;
        border-radius: 0;
        display: flex;
        flex-direction: column;
    }

    #printSubModal .rg-modal-header {
        border-radius: 0;
    }

    #printSubModal .rg-modal-body {
        flex: 1;
        padding: 16px;
    }

    #printSubModal .rg-modal-footer {
        border-radius: 0;
        padding: 16px;
    }

    #printSubModal .rg-btn {
        flex: 1;
    }

    .slip-row {
        flex-direction: column;
        gap: 4px;
    }

    .slip-value {
        text-align: left;
    }
	
	.slip-doc-type {
    margin-bottom: 20px;
}

.slip-doc-type .document-number {
    background-color: #f8f9fa;
}

.slip-doc-type .slip-value {
    color: #0d6efd;
    font-family: monospace;
    letter-spacing: 1px;

}

/* Print Media Query */
@media print {
    @page {
        size: 80mm auto;
        margin: 0;
    }

    body {
        width: 72mm;
        margin: 0 4mm;
    }

    #printSubArea {
        padding: 0 !important;
        border: none !important;
    }

    .slip-divider {
        border-top: 1px dashed #000 !important;
    }

    .slip-header, .slip-footer {
        border-color: #000 !important;
    }

    .slip-qrcode img {
        width: 40mm !important;
        height: 40mm !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}