/**
 * Beautiful Order Receipt - Main Styles
 */

/* Reset & Base */
.bor-receipt-wrapper {
    font-family: 'Vazirmatn', Tahoma, Arial, sans-serif;
    direction: rtl;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.bor-receipt-wrapper * {
    box-sizing: border-box;
}

/* Success Animation */
.bor-success-animation {
    text-align: center;
    padding: 40px 20px;
    margin-bottom: 30px;
}

.bor-checkmark {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
}

.bor-checkmark-svg {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: block;
    stroke-width: 2;
    stroke: #10b981;
    stroke-miterlimit: 10;
    animation: bor-fill 0.4s ease-in-out 0.4s forwards, bor-scale 0.3s ease-in-out 0.9s both;
}

.bor-checkmark-circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 2;
    stroke-miterlimit: 10;
    stroke: #10b981;
    fill: none;
    animation: bor-stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.bor-checkmark-check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    stroke: #10b981;
    animation: bor-stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes bor-stroke {
    100% { stroke-dashoffset: 0; }
}

@keyframes bor-scale {
    0%, 100% { transform: none; }
    50% { transform: scale3d(1.1, 1.1, 1); }
}

@keyframes bor-fill {
    100% { box-shadow: inset 0 0 0 60px rgba(16, 185, 129, 0.1); }
}

.bor-success-title {
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 10px;
    animation: bor-fadeInUp 0.6s ease-out 0.5s both;
}

.bor-success-subtitle {
    font-size: 16px;
    color: #6b7280;
    margin: 0;
    animation: bor-fadeInUp 0.6s ease-out 0.7s both;
}

.bor-success-subtitle strong {
    color: var(--bor-primary, #667eea);
}

@keyframes bor-fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Status Badge */
.bor-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 50px;
    background: var(--status-color, #10b981);
    color: white;
    font-size: 14px;
    font-weight: 600;
    margin: 0 auto 30px;
    display: flex;
    justify-content: center;
    width: fit-content;
    animation: bor-fadeInUp 0.6s ease-out 0.9s both;
}

.bor-status-badge i {
    font-size: 16px;
}

/* Main Receipt Card */
.bor-receipt-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    animation: bor-fadeInUp 0.6s ease-out 1s both;
}

/* Header */
.bor-receipt-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 30px;
    background: linear-gradient(135deg, var(--bor-primary, #667eea) 0%, var(--bor-secondary, #764ba2) 100%);
    color: white;
    flex-wrap: wrap;
    gap: 20px;
}

.bor-shop-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.bor-shop-logo {
    max-height: 60px;
    max-width: 120px;
    border-radius: 10px;
}

.bor-shop-logo-placeholder {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.bor-shop-details h3 {
    margin: 0 0 5px;
    font-size: 20px;
    font-weight: 700;
}

.bor-shop-details p {
    margin: 0;
    font-size: 13px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 5px;
}

.bor-invoice-info {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.bor-invoice-number,
.bor-invoice-date,
.bor-invoice-time {
    background: rgba(255, 255, 255, 0.15);
    padding: 12px 18px;
    border-radius: 10px;
    text-align: center;
    backdrop-filter: blur(10px);
}

.bor-invoice-number .bor-label,
.bor-invoice-date .bor-label,
.bor-invoice-time .bor-label {
    display: block;
    font-size: 11px;
    opacity: 0.8;
    margin-bottom: 5px;
}

.bor-invoice-number .bor-value {
    font-size: 22px;
    font-weight: 700;
}

.bor-invoice-date .bor-value,
.bor-invoice-time .bor-value {
    font-size: 16px;
    font-weight: 600;
}

/* Info Grid */
.bor-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 30px;
    background: #f9fafb;
}

.bor-info-box {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.bor-info-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f3f4f6;
}

.bor-info-header i {
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, var(--bor-primary, #667eea) 0%, var(--bor-secondary, #764ba2) 100%);
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.bor-info-header h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #374151;
}

.bor-info-content {
    color: #4b5563;
    font-size: 14px;
    line-height: 1.8;
}

.bor-info-row {
    display: flex;
    gap: 10px;
    margin-bottom: 5px;
}

.bor-info-label {
    color: #9ca3af;
    min-width: 50px;
}

.bor-info-value a {
    color: var(--bor-primary, #667eea);
    text-decoration: none;
}

.bor-info-value a:hover {
    text-decoration: underline;
}

.bor-payment-method {
    font-weight: 600;
    color: var(--bor-primary, #667eea);
    margin: 0;
}

/* Items Section */
.bor-items-section {
    padding: 30px;
}

.bor-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.bor-section-header i {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--bor-primary, #667eea) 0%, var(--bor-secondary, #764ba2) 100%);
    color: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.bor-section-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

/* Items Table */
.bor-items-table-wrapper {
    overflow-x: auto;
}

.bor-items-table {
    width: 100%;
    border-collapse: collapse;
}

.bor-items-table th {
    background: #f9fafb;
    padding: 15px;
    text-align: right;
    font-weight: 600;
    color: #6b7280;
    font-size: 13px;
    border-bottom: 2px solid #e5e7eb;
}

.bor-items-table th.bor-col-num {
    width: 50px;
    text-align: center;
}

.bor-items-table th.bor-col-qty {
    width: 80px;
    text-align: center;
}

.bor-items-table th.bor-col-price {
    width: 120px;
    text-align: left;
}

.bor-item-row {
    animation: bor-fadeInUp 0.5s ease-out both;
}

.bor-items-table td {
    padding: 15px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.bor-items-table tr:last-child td {
    border-bottom: none;
}

.bor-col-num {
    text-align: center;
    color: #9ca3af;
    font-size: 14px;
}

.bor-product-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bor-product-thumb {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    object-fit: cover;
}

.bor-product-thumb-placeholder {
    width: 50px;
    height: 50px;
    background: #f3f4f6;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
}

.bor-product-name {
    font-weight: 600;
    color: #1f2937;
    display: block;
}

.bor-product-meta {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 3px;
}

.bor-product-meta span {
    display: inline-block;
    margin-left: 10px;
}

.bor-col-qty {
    text-align: center;
}

.bor-qty-badge {
    display: inline-block;
    background: #f3f4f6;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: 600;
    color: #374151;
}

.bor-col-price {
    text-align: left;
    font-weight: 600;
    color: #1f2937;
}

/* Summary Section */
.bor-summary-section {
    padding: 0 30px 30px;
    display: flex;
    justify-content: flex-start;
}

.bor-summary-card {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border-radius: 15px;
    padding: 20px;
    min-width: 300px;
}

.bor-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px dashed #e5e7eb;
}

.bor-summary-row:last-child {
    border-bottom: none;
}

.bor-summary-label {
    color: #6b7280;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bor-summary-label i {
    font-size: 12px;
}

.bor-summary-value {
    font-weight: 600;
    color: #374151;
}

.bor-summary-row.bor-discount .bor-summary-value {
    color: #10b981;
}

.bor-summary-row.bor-total {
    border-top: 2px solid var(--bor-primary, #667eea);
    margin-top: 10px;
    padding-top: 15px;
}

.bor-summary-row.bor-total .bor-summary-label {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.bor-summary-row.bor-total .bor-summary-value {
    font-size: 20px;
    color: var(--bor-primary, #667eea);
}

/* Action Buttons */
.bor-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin: 30px 0;
    animation: bor-fadeInUp 0.6s ease-out 1.2s both;
}

.bor-action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.bor-btn-pdf {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.bor-btn-pdf:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(239, 68, 68, 0.4);
}

.bor-btn-excel {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.bor-btn-excel:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(16, 185, 129, 0.4);
}

.bor-btn-print {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.bor-btn-print:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(59, 130, 246, 0.4);
}

.bor-btn-share {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
}

.bor-btn-share:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(139, 92, 246, 0.4);
}

/* Modal */
.bor-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
}

.bor-modal.active {
    display: flex;
}

.bor-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.bor-modal-content {
    position: relative;
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 450px;
    width: 90%;
    animation: bor-modalIn 0.3s ease-out;
}

@keyframes bor-modalIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.bor-modal-close {
    position: absolute;
    top: 15px;
    left: 15px;
    width: 35px;
    height: 35px;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.bor-modal-close:hover {
    background: #e5e7eb;
}

.bor-modal-content h3 {
    margin: 0 0 25px;
    font-size: 20px;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 10px;
}

.bor-modal-content h3 i {
    color: var(--bor-primary, #667eea);
}

/* Share Options */
.bor-share-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.bor-share-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px 10px;
    border: none;
    border-radius: 12px;
    background: #f9fafb;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    font-family: inherit;
}

.bor-share-btn:hover {
    transform: translateY(-3px);
}

.bor-share-btn i {
    font-size: 24px;
}

.bor-share-btn span {
    font-size: 12px;
    color: #6b7280;
}

.bor-share-whatsapp { color: #25d366; }
.bor-share-whatsapp:hover { background: rgba(37, 211, 102, 0.1); }

.bor-share-telegram { color: #0088cc; }
.bor-share-telegram:hover { background: rgba(0, 136, 204, 0.1); }

.bor-share-email { color: #ea4335; }
.bor-share-email:hover { background: rgba(234, 67, 53, 0.1); }

.bor-share-copy { color: #6b7280; }
.bor-share-copy:hover { background: #e5e7eb; }

.bor-share-link-box {
    display: flex;
    gap: 10px;
}

.bor-share-link-box input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 13px;
    direction: ltr;
    text-align: left;
}

.bor-copy-btn {
    padding: 12px 20px;
    background: var(--bor-primary, #667eea);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.bor-copy-btn:hover {
    background: var(--bor-secondary, #764ba2);
}

/* Continue Shopping */
.bor-continue-shopping {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
    animation: bor-fadeInUp 0.6s ease-out 1.4s both;
}

.bor-continue-btn,
.bor-orders-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.bor-continue-btn {
    background: linear-gradient(135deg, var(--bor-primary, #667eea) 0%, var(--bor-secondary, #764ba2) 100%);
    color: white;
}

.bor-continue-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    color: white;
}

.bor-orders-btn {
    background: white;
    color: #374151;
    border: 2px solid #e5e7eb;
}

.bor-orders-btn:hover {
    border-color: var(--bor-primary, #667eea);
    color: var(--bor-primary, #667eea);
}

/* Error State */
.bor-error {
    text-align: center;
    padding: 60px 20px;
    background: #fef2f2;
    border-radius: 20px;
    border: 2px solid #fecaca;
}

.bor-error-icon {
    font-size: 50px;
    color: #ef4444;
    margin-bottom: 20px;
}

.bor-error p {
    color: #991b1b;
    font-size: 16px;
    margin: 0;
}

/* Loading State */
.bor-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.bor-loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: bor-spin 0.8s linear infinite;
}

@keyframes bor-spin {
    to { transform: rotate(360deg); }
}

/* Print Styles */
@media print {
    body * {
        visibility: hidden;
    }
    
    .bor-receipt-wrapper,
    .bor-receipt-wrapper * {
        visibility: visible;
    }
    
    .bor-receipt-wrapper {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        max-width: none;
    }
    
    .bor-success-animation,
    .bor-actions,
    .bor-continue-shopping,
    .bor-modal {
        display: none !important;
    }
    
    .bor-receipt-card {
        box-shadow: none;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .bor-receipt-header {
        flex-direction: column;
        text-align: center;
    }
    
    .bor-shop-info {
        flex-direction: column;
    }
    
    .bor-invoice-info {
        justify-content: center;
    }
    
    .bor-info-grid {
        grid-template-columns: 1fr;
    }
    
    .bor-summary-section {
        justify-content: stretch;
    }
    
    .bor-summary-card {
        width: 100%;
    }
    
    .bor-actions {
        flex-direction: column;
    }
    
    .bor-action-btn {
        width: 100%;
        justify-content: center;
    }
    
    .bor-share-options {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .bor-continue-shopping {
        flex-direction: column;
    }
    
    .bor-continue-btn,
    .bor-orders-btn {
        width: 100%;
        justify-content: center;
    }
}
