/* ==========================================================
   UPDATE DATABASE MODAL STYLES (Light & Dark Theme Support)
   Separated from Blade views as per user guidelines
   ========================================================== */

.update-db-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 1;
    visibility: visible;
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.25s ease;
}

.update-db-modal-backdrop.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.update-db-modal-dialog {
    position: relative;
    width: 100%;
    max-width: 440px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.35), 0 10px 15px -3px rgba(15, 23, 42, 0.15);
    overflow: hidden;
    transform: translateY(0) scale(1);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
}

.update-db-modal-backdrop.hidden .update-db-modal-dialog {
    transform: translateY(12px) scale(0.96);
    opacity: 0;
}

html.dark .update-db-modal-dialog {
    background: #1a3243;
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.65), 0 10px 20px -5px rgba(0, 0, 0, 0.45);
}

/* Modal Header */
.update-db-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.15rem 1.35rem 0.9rem;
    border-bottom: 1px solid #f1f5f9;
}

html.dark .update-db-modal-header {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.update-db-modal-title {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.015em;
}

html.dark .update-db-modal-title {
    color: #f8fafc;
}

.update-db-modal-close {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    color: #94a3b8;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
}

.update-db-modal-close:hover {
    color: #0f172a;
    background: #f1f5f9;
}

html.dark .update-db-modal-close:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

/* Modal Body */
.update-db-modal-body {
    padding: 1.25rem 1.35rem;
}

/* Dropzone Area */
.update-db-dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: 0.85rem;
    padding: 1.5rem 1rem;
    text-align: center;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.update-db-dropzone:hover,
.update-db-dropzone.dragover {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.04);
}

html.dark .update-db-dropzone {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(18, 34, 46, 0.6);
}

html.dark .update-db-dropzone:hover,
html.dark .update-db-dropzone.dragover {
    border-color: #34d399;
    background: rgba(16, 185, 129, 0.1);
}

.update-db-dropzone-icon {
    width: 3rem;
    height: 3rem;
    margin: 0 auto 0.75rem;
    border-radius: 9999px;
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    transition: transform 0.2s ease;
}

.update-db-dropzone:hover .update-db-dropzone-icon {
    transform: translateY(-2px);
}

html.dark .update-db-dropzone-icon {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.update-db-dropzone-text {
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.25rem;
}

html.dark .update-db-dropzone-text {
    color: #e2e8f0;
}

.update-db-dropzone-sub {
    font-size: 0.75rem;
    color: #64748b;
}

html.dark .update-db-dropzone-sub {
    color: #94a3b8;
}

/* File Preview Box */
.update-db-file-preview {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    margin-top: 0.75rem;
}

html.dark .update-db-file-preview {
    background: rgba(18, 34, 46, 0.8);
    border-color: rgba(255, 255, 255, 0.12);
}

.update-db-file-icon {
    font-size: 1.5rem;
    color: #10b981;
    flex-shrink: 0;
}

.update-db-file-details {
    flex: 1;
    min-width: 0;
}

.update-db-file-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

html.dark .update-db-file-name {
    color: #f1f5f9;
}

.update-db-file-size {
    font-size: 0.7rem;
    color: #64748b;
    margin-top: 0.1rem;
}

html.dark .update-db-file-size {
    color: #94a3b8;
}

.update-db-remove-file {
    color: #94a3b8;
    background: transparent;
    border: none;
    padding: 0.3rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.update-db-remove-file:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* Validation Alert */
.update-db-alert {
    margin-top: 0.75rem;
    padding: 0.6rem 0.85rem;
    border-radius: 0.6rem;
    font-size: 0.75rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

html.dark .update-db-alert {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(248, 113, 113, 0.35);
    color: #fca5a5;
}

/* Success Alert Card */
.update-db-success {
    margin-top: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: 0.75rem;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
}

html.dark .update-db-success {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(52, 211, 153, 0.3);
}

.update-db-sheet-breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.update-db-sheet-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.55rem;
    border-radius: 0.375rem;
    font-size: 0.7rem;
    font-weight: 600;
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

html.dark .update-db-sheet-badge {
    background: rgba(16, 185, 129, 0.2);
    color: #a7f3d0;
    border-color: rgba(52, 211, 153, 0.3);
}

/* Explicit hidden utility within modal */
.update-db-modal-backdrop .hidden,
.update-db-alert.hidden,
.update-db-success.hidden,
.update-db-file-preview.hidden,
.update-db-dropzone.hidden,
#updateDbFileInput.hidden {
    display: none !important;
}

/* Modal Footer */
.update-db-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.65rem;
    padding: 0.9rem 1.35rem 1.15rem;
    border-top: 1px solid #f1f5f9;
    background: #fafafa;
}

html.dark .update-db-modal-footer {
    border-top-color: rgba(255, 255, 255, 0.08);
    background: rgba(18, 34, 46, 0.5);
}

.update-db-btn-cancel {
    padding: 0.55rem 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: 0.6rem;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s ease;
}

.update-db-btn-cancel:hover {
    background: #f8fafc;
    color: #0f172a;
}

html.dark .update-db-btn-cancel {
    background: #1a3243;
    border-color: rgba(255, 255, 255, 0.15);
    color: #cbd5e1;
}

html.dark .update-db-btn-cancel:hover {
    background: #233e52;
    color: #ffffff;
}

.update-db-btn-upload {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 1.15rem;
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: 0.6rem;
    border: 1px solid transparent;
    background: #059669;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.update-db-btn-upload:hover:not(:disabled) {
    background: #047857;
    box-shadow: 0 4px 10px rgba(5, 150, 105, 0.3);
}

.update-db-btn-upload:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #94a3b8;
}

/* ==========================================================
   FLOATING TOAST NOTIFICATION STYLES
   ========================================================== */
.update-db-toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
    max-width: 24rem;
    width: calc(100% - 3rem);
}

.update-db-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: 0.75rem;
    background: #ffffff;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    transform: translateY(-20px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.update-db-toast.show {
    transform: translateY(0);
    opacity: 1;
}

html.dark .update-db-toast {
    background: #1a3243;
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.35);
}

/* Toast Variants */
.update-db-toast.toast-success {
    border-left: 4px solid #10b981;
}

.update-db-toast.toast-error {
    border-left: 4px solid #ef4444;
}

.update-db-toast-icon {
    font-size: 1.15rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.update-db-toast.toast-success .update-db-toast-icon {
    color: #10b981;
}

.update-db-toast.toast-error .update-db-toast-icon {
    color: #ef4444;
}

.update-db-toast-content {
    flex: 1;
    min-width: 0;
}

.update-db-toast-title {
    font-size: 0.8125rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
}

html.dark .update-db-toast-title {
    color: #f8fafc;
}

.update-db-toast-message {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.2rem;
    line-height: 1.4;
}

html.dark .update-db-toast-message {
    color: #94a3b8;
}

.update-db-toast-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 0.25rem;
    cursor: pointer;
    border-radius: 0.25rem;
    transition: color 0.15s ease;
    flex-shrink: 0;
    margin-top: -0.15rem;
}

.update-db-toast-close:hover {
    color: #0f172a;
}

html.dark .update-db-toast-close:hover {
    color: #ffffff;
}

/* Real-time Dashboard Card Value Update Highlight Effect */
@keyframes statCardHighlightPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.75);
        transform: scale(1);
    }
    40% {
        box-shadow: 0 0 0 8px rgba(255, 255, 255, 0);
        transform: scale(1.025);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
        transform: scale(1);
    }
}

.stat-card.stat-card-pulse {
    animation: statCardHighlightPulse 0.9s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

