:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --bg-light: #f9fafb;
    --text-dark: #1f2937;
}

body {
    font-family: 'Inter', sans-serif;
    background: radial-gradient(circle at top,#eef2ff 0%,#f9fafb 50%);
    color:#111827;
}

/* Custom styles for the receipt to ensure clean printing */
@media print {
    body * {
        visibility: hidden;
    }
    #receipt-output, #receipt-output * {
        visibility: visible;
    }
    #receipt-output {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        margin: 0;
        padding: 0;
    }

    /* Ensure each receipt page fits on A4 */
    .receipt-page {
        page-break-after: always;
        page-break-inside: avoid;
        max-height: 270mm !important;
        margin: 10mm !important;
        padding: 10mm !important;
        border: 1px solid #ccc !important;
        box-shadow: none !important;
        background-color: white !important;
    }

    .receipt-page:last-child {
        page-break-after: auto;
    }

    /* Hide print button on the print preview */
    #print-button, #download-pdf-button, #share-button { 
        display: none !important; 
    }

    .no-print {
        display: none !important;
    }
}

/* Currency input styling */
.currency-input {
    position: relative;
}

.currency-symbol {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 500;
    color: #6b7280;
}

.currency-input input {
    padding-left: 30px;
}

/* Share Modal Styles */
.share-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.share-modal.active {
    display: flex;
}

.share-modal-content {
    background-color: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.share-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 20px;
}

.share-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    border-radius: 8px;
    background-color: #f8fafc;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #e2e8f0;
}

.share-option:hover {
    background-color: #e2e8f0;
    transform: translateY(-2px);
}

.share-option-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    font-size: 18px;
}

.share-option.x {
    background-color: #f8fafc;
}

.share-option.x .share-option-icon {
    background-color: #000;
    color: white;
}

.share-option.facebook {
    background-color: #f8fafc;
}

.share-option.facebook .share-option-icon {
    background-color: #1877f2;
    color: white;
}

.share-option.whatsapp {
    background-color: #f8fafc;
}

.share-option.whatsapp .share-option-icon {
    background-color: #25d366;
    color: white;
}

.share-option.email {
    background-color: #f8fafc;
}

.share-option.email .share-option-icon {
    background-color: #ea4335;
    color: white;
}

.share-option-text {
    font-size: 14px;
    font-weight: 500;
    color: #334155;
}

.share-header {
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.share-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}

.close-share-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #64748b;
}

.share-footer {
    padding: 16px 20px;
    border-top: 1px solid #e2e8f0;
    background-color: #f8fafc;
    text-align: center;
    font-size: 14px;
    color: #64748b;
}

/* Digital Signature Styles */
.signature-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.signature-modal.active {
    display: flex;
}

.signature-modal-content {
    background-color: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.signature-header {
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.signature-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}

.close-signature-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #64748b;
}

.signature-body {
    padding: 20px;
}

.signature-canvas-container {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 16px;
    overflow: hidden;
}

.signature-canvas {
    width: 100%;
    height: 200px;
    background-color: white;
    cursor: crosshair;
}

.signature-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.signature-color-options {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.signature-color {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
}

.signature-color.active {
    border-color: #4f46e5;
}

.signature-preview {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    gap: 20px;
}

.signature-preview-item {
    text-align: center;
    flex: 1;
}

.signature-preview-item img {
    max-width: 100%;
    max-height: 80px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    margin-bottom: 8px;
}

.signature-preview-item p {
    font-size: 14px;
    color: #64748b;
    margin: 0;
}

.signature-footer {
    padding: 16px 20px;
    border-top: 1px solid #e2e8f0;
    background-color: #f8fafc;
    text-align: center;
    font-size: 14px;
    color: #64748b;
}

.signature-section {
    border-top: 1px solid #e2e8f0;
    padding-top: 16px;
    margin-top: 16px;
}

.signature-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.signature-preview-container {
    display: flex;
    gap: 20px;
    margin-top: 16px;
}

.signature-preview-box {
    flex: 1;
    text-align: center;
    border: 1px dashed #e2e8f0;
    border-radius: 8px;
    padding: 10px;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.signature-preview-box img {
    max-width: 100%;
    max-height: 60px;
}

.signature-placeholder {
    color: #94a3b8;
    font-size: 14px;
}

/* Enhanced button styles */
.preview-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-primary {
    background: linear-gradient(135deg,#6366f1,#4f46e5);
    color: white;
    padding: 14px 24px;
    border-radius: 12px;
    font-weight: 600;
    box-shadow: 0 8px 20px rgba(79,70,229,.25);
    transition: all .25s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(79,70,229,.35);
}

.btn-secondary {
    background-color: #f1f5f9;
    color: #334155;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    border: 1px solid #cbd5e1;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-secondary:hover {
    background-color: #e2e8f0;
}

/* Bill calculation section */
.calculation-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e5e7eb;
}

.calculation-label {
    font-weight: 500;
    color: #4b5563;
}

.calculation-value {
    font-weight: 600;
    color: #111827;
}

.total-row {
    font-weight: bold;
    font-size: 1.1em;
    background-color: #f3f4f6;
    padding: 12px;
    border-radius: 6px;
    margin-top: 8px;
    border: 2px solid #d1d5db;
}

/* Country flag styling */
.country-flag {
    width: 20px;
    height: 15px;
    display: inline-block;
    margin-right: 8px;
    vertical-align: middle;
    background-size: cover;
    background-position: center;
    border-radius: 2px;
}

/* Receipt page styling */
.receipt-page {
    background: white;
    border-radius: 12px;
    box-shadow: 0 6px 15px rgba(0,0,0,0.05);
    font-size: 12px;
    line-height: 1.25;
    margin-bottom: 10px;
    padding: 14px;
    page-break-after: always;
}

.receipt-page h1,
.receipt-page h2,
.receipt-page h3 {
    font-size: 14px;
    margin-bottom: 6px;
}

.receipt-page p {
    margin: 2px 0;
}

.receipt-content {
    font-size: 14px;
    line-height: 1.4;
}

.receipt-content * {
    box-sizing: border-box;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Compact styling for PDF */
.compact-receipt {
    font-size: 12px !important;
    line-height: 1.3 !important;
}

.compact-receipt h1,
.compact-receipt h2,
.compact-receipt h3 {
    font-size: 16px !important;
    margin-bottom: 8px !important;
}

.compact-receipt p {
    margin: 4px 0 !important;
}

.compact-receipt .text-lg {
    font-size: 14px !important;
}

.compact-receipt .text-xl {
    font-size: 16px !important;
}

.compact-receipt .text-sm {
    font-size: 11px !important;
}

.compact-receipt .text-xs {
    font-size: 10px !important;
}

.compact-receipt .p-6,
.compact-receipt .p-4,
.compact-receipt .p-3 {
    padding: 8px !important;
}

.compact-receipt .mb-6,
.compact-receipt .mb-4,
.compact-receipt .mb-3 {
    margin-bottom: 6px !important;
}

.compact-receipt img {
    max-height: 60px !important;
}

.compact-receipt .signature img {
    max-height: 40px !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .lg\:grid-cols-2 {
        grid-template-columns: 1fr;
    }

    .preview-buttons {
        flex-direction: column;
    }

    .signature-preview-container {
        flex-direction: column;
    }

    .receipt-page {
        padding: 15px;
        margin: 10px;
    }
}

/* Logo styling */
.receipt-logo {
    height: 60px;
    width: auto;
    max-width: 200px;
}