/* ==========================================================================
   Dropzone Upload — Enhanced styling for file upload areas
   Applied to #my-dropzone on all import pages
   ========================================================================== */

/* Base container */
#my-dropzone,
#my-dropzone-one-expense,
#my-dropzone-one-item {
    border: 2px dashed #b8c2cc;
    border-radius: 12px;
    background: linear-gradient(135deg, #f8f9fc 0%, #eef1f6 100%);
    min-height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

/* Hover state */
#my-dropzone:hover,
#my-dropzone-one-expense:hover,
#my-dropzone-one-item:hover {
    border-color: #5d78ff;
    background: linear-gradient(135deg, #f0f3ff 0%, #e8ecff 100%);
    box-shadow: 0 4px 15px rgba(93, 120, 255, 0.15);
    transform: translateY(-1px);
}

/* Drag-hover state (file dragged over) */
#my-dropzone.dz-drag-hover,
#my-dropzone-one-expense.dz-drag-hover,
#my-dropzone-one-item.dz-drag-hover {
    border-color: #0abb87;
    background: linear-gradient(135deg, #f0fff8 0%, #e8fff3 100%);
}

/* Message container */
#my-dropzone .dz-message,
#my-dropzone-one-expense .dz-message,
#my-dropzone-one-item .dz-message {
    text-align: center;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

/* Upload icon circle */
#my-dropzone .upload-icon,
#my-dropzone-one-expense .upload-icon,
#my-dropzone-one-item .upload-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #5d78ff 0%, #3758f9 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 22px;
    margin-bottom: 4px;
    box-shadow: 0 4px 15px rgba(93, 120, 255, 0.3);
    transition: transform 0.3s ease;
}

#my-dropzone:hover .upload-icon,
#my-dropzone-one-expense:hover .upload-icon,
#my-dropzone-one-item:hover .upload-icon {
    transform: scale(1.1);
}

/* Upload text */
#my-dropzone .upload-text,
#my-dropzone-one-expense .upload-text,
#my-dropzone-one-item .upload-text {
    font-size: 15px;
    color: #595d6e;
    font-weight: 500;
}

/* Upload hint (optional subtitle) */
#my-dropzone .upload-hint,
#my-dropzone-one-expense .upload-hint,
#my-dropzone-one-item .upload-hint {
    font-size: 12px;
    color: #a2a5b9;
}

/* Floating save bar — used on pages with inline editing (taxFieldsData, annualReport, etc.) */
.save-area {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border: 1px solid #ebedf2;
    border-radius: 8px;
    padding: 12px 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    z-index: 10;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
.save-area .hint {
    color: #74788d;
    font-size: 0.85rem;
}
.save-area .hint i {
    color: #1dc9b7;
    margin-left: 8px;
}
@media (max-width: 768px) {
    .save-area {
        padding: 10px 20px;
        bottom: 15px;
    }
    .save-area .hint {
        display: none;
    }
}
.kt-portlet__body:has(.save-area) {
    padding-bottom: 80px !important;
}
.select-forced-disabled {
    pointer-events: none;
    opacity: 0.65;
    background-color: #e9ecef !important;
}
/* Document-type colored field rows. Used on documentNumbering, documentDefaultBank,
   and documentBottomTitle settings pages. Each row carries inline CSS variables
   --dt-color / --dt-tint / --dt-border populated from DocumentsAction's color helpers,
   so the visual matches the colored document-type pills in the documents list. */
.doc-type-row {
    --dt-color: #5867dd;
    --dt-tint: #5867dd1a;
    --dt-border: #5867dd33;
    background: var(--dt-tint);
    border: 1px solid var(--dt-border);
    border-radius: 8px;
    padding: 12px 16px 4px;
    margin-bottom: 12px;
    transition: filter .15s, box-shadow .15s;
}
[dir="rtl"] .doc-type-row { border-right: 4px solid var(--dt-color); }
[dir="ltr"] .doc-type-row { border-left: 4px solid var(--dt-color); }
.doc-type-row:hover {
    filter: brightness(0.99);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.doc-type-row .form-group {
    margin-bottom: 8px;
    align-items: center;
}
.doc-type-row label,
.doc-type-row .col-form-label {
    color: var(--dt-color) !important;
    font-weight: 600;
}
.doc-type-row .col-form-label::before {
    content: "\f15c";
    font-family: "Font Awesome 5 Free", "FontAwesome";
    font-weight: 900;
    opacity: 0.7;
    font-size: 12px;
}
[dir="rtl"] .doc-type-row .col-form-label::before { margin-left: 8px; }
[dir="ltr"] .doc-type-row .col-form-label::before { margin-right: 8px; }
.doc-type-row.doc-type-row-disabled {
    opacity: 0.65;
    filter: grayscale(0.2);
}
.doc-type-row.doc-type-row-disabled .col-form-label::before { content: "\f023"; }
/* Intro alert variant — uses the same --dt-color but as a thicker leading bar. */
.doc-type-intro {
    --dt-color: #5867dd;
    border-radius: 6px;
}
[dir="rtl"] .doc-type-intro { border-right: 4px solid var(--dt-color) !important; }
[dir="ltr"] .doc-type-intro { border-left: 4px solid var(--dt-color) !important; }

/* Prominent friendly field-error alert (b:fieldErrorAlert) — replaces the tiny
   invalid-feedback text for errors like "add at least one payment" on
   documentDetails / expensePaymentDetails. Soft danger look + gentle entrance. */
.field-error-alert {
    margin: 16px 0 4px;
    padding: 14px 18px;
    border-radius: 10px;
    align-items: center;
    animation: fieldErrorAlertIn .35s ease-out;
}
/* leading accent bar — logical property follows the computed direction (no dir attr
   on html/body); .alert.x specificity needed to beat .alert.alert-solid-danger's
   transparent border-color from the Metronic bundle */
.alert.field-error-alert { border-inline-start: 4px solid #fd397a; }
.field-error-alert .alert-icon i {
    font-size: 2.2rem;
    animation: fieldErrorAlertPulse 1.8s ease-in-out infinite;
}
.field-error-alert .field-error-alert-title {
    display: block;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
}
.field-error-alert .field-error-alert-hint {
    margin-top: 2px;
    font-size: 13px;
    opacity: 0.85;
}
@keyframes fieldErrorAlertIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fieldErrorAlertPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.12); }
}

/* ===== Israel-invoices allocation tooltips =====
   HTML is built in DocumentsAction.java (buildNoAllocationTooltip / buildSelfInvoiceTooltip /
   buildAllocationRequiredTooltip). Bootstrap 4.3's tooltip sanitizer strips inline style
   attributes (class/dir survive), so ALL styling must live here.
   :has() widens the host tooltip bubble; browsers without :has() fall back to the
   200px bubble but keep RTL right-alignment from the inner classes. */
.tooltip-inner:has(.ils-alloc-tooltip) {
    max-width: 340px;
    text-align: right;
}
.ils-alloc-tooltip {
    direction: rtl;
    text-align: right;
    font-size: 13px;
}
.ils-alloc-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}
.ils-alloc-title {
    flex: 1;
    font-weight: 600;
    font-size: 14px;
    color: #48465b;
}
.ils-alloc-check {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #1dc9b7;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-inline-start: 8px;
    color: #fff;
    font-size: 15px;
    font-weight: bold;
}
.ils-alloc-check-required { background: #fd397a; }
.ils-alloc-card {
    background: #f7f8fa;
    border-radius: 6px;
    padding: 8px 10px;
    margin-bottom: 6px;
    line-height: 1.7;
    color: #48465b;
}
.ils-alloc-row { margin-bottom: 4px; }
.ils-alloc-row:last-child { margin-bottom: 0; }
.ils-alloc-note {
    font-size: 12px;
    color: #74788d;
    line-height: 1.7;
}
.ils-nowrap { white-space: nowrap; }
