/**
 * Quotations Management Styles
 * Styles for the quotations management modal and quotation details modal
 */

/* Ensure modal z-index is above backdrop when shown */
#quotationsManagementModal.show {
    z-index: 1045 !important;
}

/* Ensure quotation text modal z-index is above backdrop when shown */
#manageQuotationTextModal.show {
    z-index: 1045 !important;
    display: block !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
}

#manageQuotationTextModal.show .modal-dialog {
    z-index: 1046 !important;
    position: relative !important;
    margin: 1.75rem auto !important;
}

#manageQuotationTextModal.show .modal-content {
    z-index: 1047 !important;
    position: relative !important;
}

/* Smooth fade animations for success/error messages */
.quotation-text-success-message {
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.quotation-text-success-message.show {
    opacity: 1;
    transform: translateY(0);
}

.quotation-text-success-message.fade-out {
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

#quotationTextFeedback .alert {
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

/* Loading overlay for quotation text modal */
#manageQuotationTextModal .modal-body {
    position: relative;
}

.quotation-text-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 0 0 1rem 1rem;
}

#quotationTextTabContent {
    transition: opacity 0.3s ease-in-out;
    opacity: 1;
}

/* Ensure backdrop z-index is below modal - applied via JavaScript, but CSS as fallback */
.modal-backdrop {
    z-index: 1040 !important;
}

/* Quotations Modal Styles - Matching App Theme */
.quotations-modal {
    border-radius: 1rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08), 0 1.5px 6px rgba(0,0,0,0.04);
}

.quotations-header {
    background: linear-gradient(135deg, #1197d0 0%, #0e7bb8 100%);
    color: white;
    border-radius: 1rem 1rem 0 0;
    border-bottom: none;
    padding: 1.5rem 2rem;
}

.quotations-title {
    font-weight: 600;
    font-size: 1.25rem;
    margin: 0;
}

.quotations-title i {
    margin-right: 0.5rem;
}

.quotations-body {
    padding: 2rem;
    background: #f8fbff;
}

.quotations-footer {
    background: #f8fbff;
    border-top: 1px solid #e9ecef;
    padding: 1rem 2rem;
    border-radius: 0 0 1rem 1rem;
}

/* Enhanced table styling - Compact version */
#quotations-table {
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    font-size: 0.875rem;
}

#quotations-table thead th {
    background: linear-gradient(135deg, #1197d0 0%, #0e7bb8 100%);
    color: white;
    font-weight: 600;
    border: none;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    line-height: 1.2;
}

#quotations-table tbody tr {
    transition: background-color 0.2s ease;
}

#quotations-table tbody tr:hover {
    background-color: #f8fbff;
}

#quotations-table tbody td {
    padding: 0.4rem 0.75rem;
    vertical-align: middle;
    font-size: 0.8rem;
    line-height: 1.2;
}

/* Status badges - Compact version */
.badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    line-height: 1;
}

/* Pagination styling - Compact version */
.pagination {
    margin-bottom: 0;
}

.pagination .page-link {
    color: #1197d0;
    border-color: #e9ecef;
    padding: 0.375rem 0.5rem;
    font-size: 0.8rem;
}

.pagination .page-link:hover {
    color: #0e7bb8;
    background-color: #f8fbff;
    border-color: #1197d0;
}

.pagination .page-item.active .page-link {
    background-color: #1197d0;
    border-color: #1197d0;
}

/* Quotation Detail Modal - Clean Card-Based Layout */

/* Header Card */
.quotation-header-card {
    background: linear-gradient(135deg, #1197d0 0%, #0e7bb8 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 4px 12px rgba(17, 151, 208, 0.2);
}

.quotation-number-large {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: 0.5px;
}

.quotation-customer-name {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
    opacity: 0.95;
}

.quotation-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
    opacity: 0.9;
}

.quotation-date {
    display: inline-flex;
    align-items: center;
}

.quotation-total-amount {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.quotation-total-label {
    font-size: 0.85rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Detail Cards */
.quotation-detail-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s ease;
}

.quotation-detail-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.quotation-detail-card-header {
    background: #f8f9fa;
    padding: 0.5rem 0.75rem;
    font-weight: 600;
    color: #1197d0;
    font-size: 0.85rem;
    border-bottom: 1px solid #e9ecef;
}

.quotation-detail-card-body {
    padding: 0.75rem;
}

.quotation-detail-item {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
    border-bottom: 1px solid #f1f3f5;
}

.quotation-detail-item:last-child {
    border-bottom: none;
}

.quotation-detail-label {
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: 500;
}

.quotation-detail-value {
    color: #212529;
    font-size: 0.95rem;
    font-weight: 500;
    text-align: right;
}

.quotation-pump-total {
    color: #1197d0;
    font-weight: 600;
    font-size: 1rem;
}

/* Section Cards */
.quotation-section-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.quotation-section-card-header {
    background: #f8f9fa;
    padding: 0.5rem 0.75rem;
    font-weight: 600;
    color: #212529;
    font-size: 0.9rem;
    border-bottom: 2px solid #e9ecef;
    display: flex;
    align-items: center;
}

.quotation-section-card-body {
    padding: 0;
}

/* Items Table */
.quotation-items-table {
    margin: 0;
    border: none;
}

.quotation-items-table thead {
    background: #f8f9fa;
}

.quotation-items-table thead th {
    color: #495057;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.375rem 0.5rem;
    border-bottom: 2px solid #dee2e6;
    border-top: none;
}

.quotation-items-table tbody tr {
    border-bottom: 1px solid #f1f3f5;
    transition: background-color 0.15s ease;
}

.quotation-items-table tbody tr:hover {
    background-color: #f8fbff;
}

.quotation-items-table tbody tr:last-child {
    border-bottom: none;
}

.quotation-items-table tbody td {
    padding: 0.375rem 0.5rem;
    vertical-align: middle;
    color: #495057;
    font-size: 0.85rem;
    line-height: 1.3;
}

.part-number-badge {
    background-color: #1197d0;
    color: white;
    padding: 0.2rem 0.4rem;
    border-radius: 0.2rem;
    font-size: 0.7rem;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    display: inline-block;
    line-height: 1.1;
}

.item-total {
    color: #1197d0;
    font-weight: 600;
    font-size: 0.95rem;
}

/* Form select styling */
.quotation-filter-select {
    width: auto;
    min-width: 150px;
}

.quotation-page-size-select {
    width: auto;
}

/* Parent modal disabled state */
.quotation-parent-disabled {
    pointer-events: none;
}

/* Clickable quotation rows */
.quotation-row-clickable {
    cursor: pointer;
}

/* Alert positioning */
.quotation-alert-positioned {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

/* Alert styling consistency */
.alert-info {
    background-color: #f8fbff;
    border-color: #1197d0;
    color: #0e7bb8;
}

/* Form controls styling */
.form-select-sm {
    border-radius: 0.375rem;
    border-color: #ced4da;
}

.form-select-sm:focus {
    border-color: #1197d0;
    box-shadow: 0 0 0 0.2rem rgba(17, 151, 208, 0.25);
}

/* Loading spinner color */
.spinner-border.text-primary {
    color: #1197d0 !important;
}

/* Status button disabled state */
.btn-group .btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-group .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Header filter styling */
.quotations-header .form-label {
    color: white !important;
    font-size: 0.875rem;
    margin-bottom: 0;
}

.quotations-header .form-select {
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #333;
}

.quotations-header .form-select:focus {
    background-color: white;
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25);
}

/* Status Filter Badge Buttons */
#status-filter-group {
    display: flex;
    gap: 0.35rem;
    flex-wrap: nowrap;
    align-items: center;
}

#status-filter-group .btn-check {
    position: absolute;
    clip: rect(0, 0, 0, 0);
    pointer-events: none;
}

.status-filter-badge {
    margin: 0;
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 0.375rem;
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    transition: all 0.2s ease;
    cursor: pointer;
    white-space: nowrap;
    background-color: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(4px);
    color: rgba(255, 255, 255, 0.9);
    display: inline-block;
    user-select: none;
    line-height: 1.2;
}

.status-filter-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    background-color: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.6);
}

.status-filter-badge.status-pending {
    border-color: rgba(255, 193, 7, 0.6);
    color: rgba(255, 255, 255, 0.95);
}

.status-filter-badge.status-won {
    border-color: rgba(25, 135, 84, 0.6);
    color: rgba(255, 255, 255, 0.95);
}

.status-filter-badge.status-lost {
    border-color: rgba(220, 53, 69, 0.6);
    color: rgba(255, 255, 255, 0.95);
}

#status-filter-group #status-all:checked + .status-filter-badge {
    background-color: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.9);
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

#status-filter-group #status-pending:checked + .status-filter-badge {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #000;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.4);
}

#status-filter-group #status-won:checked + .status-filter-badge {
    background-color: #198754;
    border-color: #198754;
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(25, 135, 84, 0.4);
}

#status-filter-group #status-lost:checked + .status-filter-badge {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.4);
}

/* Age Filter Radio Buttons */
#age-filter-group {
    display: flex;
    gap: 0.35rem;
    flex-wrap: nowrap;
    align-items: center;
}

#age-filter-group .btn-check {
    position: absolute;
    clip: rect(0, 0, 0, 0);
    pointer-events: none;
}

.age-filter-badge {
    margin: 0;
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 0.375rem;
    border: 1.5px solid rgba(255, 255, 255, 0.5);
    transition: all 0.2s ease;
    cursor: pointer;
    white-space: nowrap;
    background-color: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(4px);
    color: rgba(255, 255, 255, 0.95);
    display: inline-block;
    user-select: none;
    line-height: 1.2;
}

.age-filter-badge:hover {
    background-color: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.7);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

#age-filter-group .btn-check:checked + .age-filter-badge {
    background-color: rgba(255, 255, 255, 0.95);
    border-color: white;
    color: #1197d0;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Status button colors - Override global button styles */
#status-buttons .btn-warning {
    background-color: #ffc107 !important;
    border-color: #ffc107 !important;
    color: #000 !important;
}

#status-buttons .btn-warning:hover {
    background-color: #ffca2c !important;
    border-color: #ffca2c !important;
    color: #000 !important;
}

#status-buttons .btn-success {
    background-color: #198754 !important;
    border-color: #198754 !important;
    color: #fff !important;
}

#status-buttons .btn-success:hover {
    background-color: #157347 !important;
    border-color: #157347 !important;
    color: #fff !important;
}

#status-buttons .btn-danger {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    color: #fff !important;
}

#status-buttons .btn-danger:hover {
    background-color: #bb2d3b !important;
    border-color: #bb2d3b !important;
    color: #fff !important;
}

