/* style.css */

/* Base styles for body and font */
body {
    font-family: 'Inter', sans-serif;
    background-color: #f3f4f6; /* Light gray background */
    margin: 0;
    padding: 0;
    line-height: 1.5;
    color: #374151; /* Default text color */
}

/* Card component styling */
.card {
    background-color: #ffffff;
    border-radius: 0.75rem; /* Rounded corners for the card itself */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    margin-bottom: 1.5rem; /* Space between cards */
}

.card-header {
    background-color: #0067b8; /* Deed UI Admin Theme blue */
    color: #ffffff;
    padding: 1rem 1.25rem; /* Slightly reduced padding */
    border-top-left-radius: 0.125rem; /* Squared top corners */
    border-top-right-radius: 0.125rem; /* Squared top corners */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3, .card-header h2 {
    font-size: 1.125rem; /* Reduced heading font size */
    font-weight: 600;
    margin: 0;
}

.card-body {
    padding: 1rem 1.25rem; /* Slightly reduced padding */
}

.card-footer {
    padding: 1rem 1.25rem; /* Slightly reduced padding */
    border-top: 1px solid #e5e7eb; /* Light gray border */
    background-color: #f9fafb; /* Very light gray for footer background */
    border-bottom-left-radius: 0.75rem;
    border-bottom-right-radius: 0.75rem;
}

/* Form group and label styling */
.form-group-row {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem; /* Standard margin for form rows */
}

.control-label {
    flex: 0 0 33.333333%; /* Equivalent to col-sm-4 */
    max-width: 33.333333%;
    padding-right: 0.5rem;
    text-align: right;
    font-weight: 500;
    color: #4b5563; /* Gray-700 */
    font-size: 0.875rem; /* Reduced font size */
}

.form-control-wrapper {
    flex: 1;
    padding-left: 0.5rem;
}

/* Form control (input, select, textarea) styling */
.form-control {
    display: block;
    width: 100%;
    padding: 0.4rem 0.6rem; /* Reduced padding */
    font-size: 0.875rem; /* Reduced font size */
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #d1d5db; /* Gray-300 */
    border-radius: 0.125rem; /* Squared look - rounded-sm */
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    border-color: #0067b8; /* Updated focus color */
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 103, 184, 0.25); /* Updated focus shadow */
}

/* Button styling */
.btn {
    padding: 0.5rem 1rem; /* Reduced padding */
    border-radius: 0.125rem; /* Squared look - rounded-sm */
    font-weight: 600;
    cursor: pointer;
    font-size: 0.875rem; /* Reduced font size */
    transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out, border-color 0.15s ease-in-out;
    display: inline-flex; /* For icon alignment */
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background-color: #0067b8; /* Deed UI Admin Theme blue */
    color: #ffffff;
    border: 1px solid #0067b8;
}
.btn-primary:hover {
    background-color: #005090; /* Darker shade for hover */
}

.btn-secondary {
    background-color: #6b7280; /* Gray-500 */
    color: #ffffff;
    border: 1px solid #6b7280;
}
.btn-secondary:hover {
    background-color: #4b5563; /* Gray-600 */
}

.btn-success {
    background-color: #10b981; /* Emerald-500 */
    color: #ffffff;
    border: 1px solid #10b981;
}
.btn-success:hover {
    background-color: #059669; /* Emerald-600 */
}

.btn-warning {
    background-color: #f59e0b; /* Amber-500 */
    color: #ffffff;
    border: 1px solid #f59e0b;
}
.btn-warning:hover {
    background-color: #d97706; /* Amber-600 */
}

.btn-danger {
    background-color: #ef4444; /* Red-500 */
    color: #ffffff;
    border: 1px solid #ef4444;
}
.btn-danger:hover {
    background-color: #dc2626; /* Red-600 */
}

/* Table styling */
.table-bordered {
    width: 100%;
    border-collapse: collapse;
}

.table-bordered th, .table-bordered td {
    border: 1px solid #e5e7eb; /* Gray-200 */
    padding: 0.6rem; /* Reduced padding */
    font-size: 0.85rem; /* Reduced font size */
    text-align: left;
    vertical-align: top;
}

.table-bordered thead th {
    background-color: #0067b8; /* Deed UI Admin Theme blue */
    color: #ffffff;
    font-weight: 600;
}

/* Checkbox styling */
.checkbox-info input[type="checkbox"] {
    border-radius: 0.125rem; /* Square checkboxes */
    height: 1rem;
    width: 1rem;
    accent-color: #0067b8; /* Blue accent color for checked state */
}
.checkbox-info label {
    font-size: 0.875rem; /* Match other labels */
    margin-left: 0.25rem;
    color: #4b5563;
}

/* Message box (for alerts) */
.message-box {
    position: fixed;
    top: 0.75rem;
    right: 0.75rem;
    background-color: #0067b8; /* Default info color */
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    display: none; /* Hidden by default */
    font-size: 0.875rem;
}

/* Loading indicator */
.loading-indicator {
    display: none;
    margin-left: 0.75rem;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0067b8;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Modal styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.modal-content {
    background-color: #ffffff;
    border-radius: 0.75rem;
    padding: 1rem;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 0.75rem;
}
.modal-title {
    font-size: 1.1rem;
    font-weight: 600;
}
.close-button {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: #6b7280;
}

/* Additional utility classes for layout/spacing */
.mx-auto { margin-left: auto; margin-right: auto; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.flex { display: flex; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.items-center { align-items: center; }
.space-x-1 > *:not(:first-child) { margin-left: 0.25rem; }
.space-x-2 > *:not(:first-child) { margin-left: 0.5rem; }
.space-y-2 > *:not(:first-child) { margin-top: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.pt-3 { padding-top: 0.75rem; }
.p-4 { padding: 1rem; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.font-semibold { font-weight: 600; }
.text-lg { font-size: 1.125rem; }
.text-base { font-size: 1rem; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.whitespace-nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.block { display: block !important; }
.inline-block { display: inline-block !important; }
.relative { position: relative; }
.z-10 { z-index: 10; }
.border-t { border-top-width: 1px; }
.border-gray-200 { border-color: #e5e7eb; }
.border-gray-300 { border-color: #d1d5db; }
.border-gray-400 { border-color: #9ca3af; }
.border-gray-500 { border-color: #6b7280; }
.rounded { border-radius: 0.25rem; }
.rounded-sm { border-radius: 0.125rem; }
.rounded-md { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-full { border-radius: 9999px; }
.bg-primary { background-color: #0067b8; }
.text-white { color: #ffffff; }
.text-gray-600 { color: #4b5563; }
.text-gray-700 { color: #374151; }
.cursor-pointer { cursor: pointer; }
.w-1\/2 { width: 50%; }
.w-auto { width: auto; }
.ml-1 { margin-left: 0.25rem; }
.ml-2 { margin-left: 0.5rem; }
.ml-3 { margin-left: 0.75rem; }
.ml-4 { margin-left: 1rem; }
.ml-5 { margin-left: 1.25rem; }
.mr-2 { margin-right: 0.5rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.md\:p-6 { padding: 1.5rem; } /* For medium screens and up */
.lg\:p-8 { padding: 2rem; } /* For large screens and up */
.max-w-4xl { max-width: 56rem; /* 896px */ }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Responsive grid for columns */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.gap-3 { gap: 0.75rem; }

@media (min-width: 768px) { /* md breakpoint */
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .md\:flex-row { flex-direction: row; }
    .md\:space-y-0 > *:not(:first-child) { margin-top: 0; }
    .md\:space-x-2 > *:not(:first-child) { margin-left: 0.5rem; }
}

@media (min-width: 1024px) { /* lg breakpoint */
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Print specific styles */
@media print {
    body {
        margin: 0;
        padding: 0;
        font-size: 9pt; /* Adjust base font size for print */
        color: black;
        -webkit-print-color-adjust: exact; /* Ensure background colors are printed */
        print-color-adjust: exact;
    }
    .no-print {
        display: none !important;
    }

    /* General print styles for tables and details */
    .print-table {
        width: 100%;
        border-collapse: collapse;
        margin-bottom: 0.5rem; /* Reduced margin */
    }
    .print-table th, .print-table td {
        border: 1px solid black;
        padding: 0.2rem 0.4rem; /* Smaller padding for print */
        font-size: 0.7rem; /* Smaller font size for print */
        vertical-align: top;
    }
    .print-table h1 {
        font-size: 1rem; /* Smaller logo text */
        margin: 0;
    }
    .print-table b {
        font-weight: bold;
    }
    .print-table img {
        height: 30px; /* Adjust logo size for print */
        width: 30px;
        vertical-align: middle;
        margin-right: 0.1rem;
    }
    .print-barcode-container {
        text-align: center;
        margin-top: 0.2rem;
    }
    .print-barcode-img {
        max-width: 100px; /* Adjust as needed */
        height: auto;
    }
    .print-awb-number {
        font-weight: bold;
        font-size: 0.8rem;
        margin-top: 0.1rem;
    }
    .print-footer-text {
        font-size: 0.65rem;
        text-align: center;
        margin-top: 0.2rem;
    }
    .print-copy-label {
        font-size: 0.8rem;
        font-weight: bold;
        text-align: right;
        margin-top: 0.2rem;
    }
    .print-detail-label {
        font-weight: bold;
        margin-right: 0.1rem;
    }
    .print-detail-value {
        font-size: 0.7rem;
    }
    .print-section-title {
        font-size: 0.8rem;
        font-weight: bold;
        margin-bottom: 0.1rem;
    }
    .horizontal-dotted-line {
        border-top: 1px dotted #9ca3af;
        margin: 0.5rem 0;
    }
    .vertical-line {
        border-left: 1px solid #000;
        height: auto;
        margin: 0 0.5rem;
    }
    .print-main-table .form-control {
        border: none;
        padding: 0;
        font-size: 0.7rem;
        height: auto;
        background-color: transparent;
    }
    .print-main-table .control-label {
        text-align: left;
        padding-right: 0;
        font-size: 0.7rem;
        flex: none;
        max-width: none;
    }

    /* Page-specific print rules */

    /* 4x6 inch label printer */
    @page {
        size: 4in 6in; /* Width x Height */
        margin: 0.1in; /* Minimal margin for label printers */
    }
    body.print-label-page {
        width: 4in;
        height: 6in;
        margin: 0;
        padding: 0;
        overflow: hidden; /* Prevent scrollbars */
    }
    .label-container {
        width: 100%;
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        padding: 0.1in; /* Internal padding */
        box-sizing: border-box;
    }
    .label-header, .label-body, .label-footer {
        width: 100%;
    }
    .label-header h1 {
        font-size: 0.9rem;
    }
    .label-header img {
        height: 25px;
        width: 25px;
    }
    .label-barcode-img {
        max-width: 100%;
        height: auto;
    }
    .label-awb-number {
        font-size: 0.8rem;
    }
    .label-detail-text {
        font-size: 0.7rem;
        line-height: 1.2;
    }

    /* A4 page with three copies */
    @page A4-3-copies {
        size: A4;
        margin: 0.5in; /* Standard A4 margins */
    }
    body.print-a4-multi-page {
        width: A4;
        height: A4;
        margin: 0;
        padding: 0;
    }
    .a4-copy-wrapper {
        width: 4in; /* Approx 3.2in + some padding/margin */
        height: 3.2in;
        border: 1px solid #ccc; /* Visual separation on A4 */
        margin: 0.2in auto; /* Center copies vertically with some space */
        padding: 0.1in;
        box-sizing: border-box;
        page-break-inside: avoid; /* Keep copy together */
    }
    .a4-copy-wrapper:not(:last-child) {
        margin-bottom: 0.5in; /* Space between copies on A4 */
    }

    /* Hide screen-only elements during print */
    .no-print-element {
        display: none !important;
    }
}
