/* ================================================================
   app-custom.css
   AutomatedAmazon — Custom styles (Tailwind extension)
   ALL units in rem — ZERO px values
   ================================================================ */

/* ───────────────────────── Toast Notifications ─────────────────────── */

.toast {
    animation: toastSlideIn 0.3s ease-out forwards;
    border-radius: 0.5rem;
    min-width: 18rem;
    max-width: 24rem;
}

.toast-exit {
    animation: toastSlideOut 0.3s ease-in forwards;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(2rem);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(2rem);
    }
}

/* ──────────────────────────── Modal ────────────────────────────────── */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(0.25rem);
    padding: 1rem;
}

.modal-overlay.hidden {
    display: none;
}

.modal-content {
    width: 100%;
    max-width: 32rem;
    max-height: 85vh;
    overflow-y: auto;
    border-radius: 0.75rem;
    padding: 1.5rem;
    animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ──────────────────────── Status Badges ────────────────────────────── */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.625rem;
    border-radius: 9999rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.25rem;
    text-transform: capitalize;
}

.badge-green {
    background-color: rgba(16, 185, 129, 0.15);
    color: #059669;
}

.dark .badge-green {
    background-color: rgba(16, 185, 129, 0.25);
    color: #6ee7b7;
}

.badge-yellow {
    background-color: rgba(245, 158, 11, 0.15);
    color: #d97706;
}

.dark .badge-yellow {
    background-color: rgba(245, 158, 11, 0.25);
    color: #fbbf24;
}

.badge-red {
    background-color: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}

.dark .badge-red {
    background-color: rgba(239, 68, 68, 0.25);
    color: #fca5a5;
}

.badge-blue {
    background-color: rgba(59, 130, 246, 0.15);
    color: #2563eb;
}

.dark .badge-blue {
    background-color: rgba(59, 130, 246, 0.25);
    color: #93c5fd;
}

.badge-orange {
    background-color: rgba(249, 115, 22, 0.15);
    color: #ea580c;
}

.dark .badge-orange {
    background-color: rgba(249, 115, 22, 0.25);
    color: #fdba74;
}

.badge-gray {
    background-color: rgba(107, 114, 128, 0.15);
    color: #4b5563;
}

.dark .badge-gray {
    background-color: rgba(107, 114, 128, 0.25);
    color: #d1d5db;
}

.badge-indigo {
    background-color: rgba(99, 102, 241, 0.15);
    color: #4f46e5;
}

.dark .badge-indigo {
    background-color: rgba(99, 102, 241, 0.25);
    color: #a5b4fc;
}

/* ──────────────────────── KPI Cards ───────────────────────────────── */

.kpi-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi-card:hover {
    transform: translateY(-0.25rem);
    box-shadow: 0 0.625rem 1.25rem rgba(0, 0, 0, 0.1);
}

.dark .kpi-card:hover {
    box-shadow: 0 0.625rem 1.25rem rgba(0, 0, 0, 0.35);
}

/* ─────────────────── Smooth Transitions ───────────────────────────── */

.transition-smooth {
    transition: all 0.2s ease;
}

/* ─────────────────── Table Styles ─────────────────────────────────── */

.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 0.5rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-weight: 600;
    white-space: nowrap;
}

.data-table td {
    padding: 0.75rem 1rem;
}

.data-table tbody tr {
    transition: background-color 0.15s ease;
}

/* ──────────────────── Touch Target ─────────────────────────────────── */

.touch-target {
    min-height: 2.75rem;
    min-width: 2.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ──────────────────── Form Inputs ──────────────────────────────────── */

.form-input {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    min-height: 2.75rem;
}

.form-input:focus {
    outline: none;
    box-shadow: 0 0 0 0.1875rem rgba(99, 102, 241, 0.3);
}

.form-label {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
}

/* ──────────────────── Sidebar / Nav ────────────────────────────────── */

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background-color 0.15s ease, color 0.15s ease;
    min-height: 2.75rem;
}

/* ──────────────────── Card Base ────────────────────────────────────── */

.card {
    border-radius: 0.75rem;
    padding: 1.5rem;
    transition: box-shadow 0.2s ease;
}

/* ──────────────────── Divider ──────────────────────────────────────── */

.divider-text {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
    color: inherit;
}

.divider-text::before,
.divider-text::after {
    content: '';
    flex: 1;
    height: 0.0625rem;
    background-color: currentColor;
    opacity: 0.25;
}

/* ──────────────────── Scrollbar (dark) ─────────────────────────────── */

.dark ::-webkit-scrollbar {
    width: 0.5rem;
}

.dark ::-webkit-scrollbar-track {
    background: #1f2937;
}

.dark ::-webkit-scrollbar-thumb {
    background: #4b5563;
    border-radius: 0.25rem;
}

/* ──────────────────── Priority Dot ─────────────────────────────────── */

.priority-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    display: inline-block;
}

.priority-critical { background-color: #dc2626; }
.priority-high     { background-color: #ea580c; }
.priority-medium   { background-color: #d97706; }
.priority-low      { background-color: #2563eb; }
