/* ===================================================
   BioPayroll — Custom Styles (Tailwind CSS companion)
   =================================================== */

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 transparent;
}

/* ---------- Keyframes ---------- */
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-24px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(.92); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: .55; }
}

@keyframes shimmer {
    0%   { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fingerprintScan {
    0%   { box-shadow: 0 0 0 0 rgba(16, 185, 129, .45); }
    50%  { box-shadow: 0 0 0 18px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes fingerprintLine {
    0%   { top: 0; opacity: 1; }
    50%  { opacity: .6; }
    100% { top: 100%; opacity: 0; }
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(100%); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(100%); }
}

/* ---------- Animation utilities ---------- */
.animate-fade-in     { animation: fadeIn .35s ease-out both; }
.animate-slide-up    { animation: slideUp .4s ease-out both; }
.animate-slide-left  { animation: slideInLeft .4s ease-out both; }
.animate-scale-in    { animation: scaleIn .3s ease-out both; }
.animate-pulse       { animation: pulse 2s cubic-bezier(.4,0,.6,1) infinite; }
.animate-shimmer {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 800px 100%;
    animation: shimmer 1.8s infinite linear;
}

/* ---------- Sidebar ---------- */
.sidebar-link {
    position: relative;
    transition: background .2s, color .2s, padding-left .2s;
}

.sidebar-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #10b981;
    border-radius: 0 4px 4px 0;
    transform: scaleY(0);
    transition: transform .2s ease;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: rgba(16, 185, 129, .08);
    padding-left: 1.25rem;
}

.sidebar-link:hover::before,
.sidebar-link.active::before {
    transform: scaleY(1);
}

/* ---------- Stat cards ---------- */
.stat-card {
    transition: transform .2s ease, box-shadow .2s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, .1),
                0 8px 10px -6px rgba(0, 0, 0, .06);
}

/* ---------- Card hover ---------- */
.card-hover {
    transition: box-shadow .25s ease, transform .25s ease;
}

.card-hover:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
    transform: translateY(-2px);
}

/* ---------- Modal overlay ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-overlay.hidden {
    display: none;
}

.modal-content {
    animation: scaleIn .25s ease-out both;
}

/* ---------- Form inputs ---------- */
.input-focus {
    transition: border-color .2s, box-shadow .2s, ring .2s;
}

.input-focus:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, .2);
}

/* ---------- Badges / Chips ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    font-size: .75rem;
    font-weight: 600;
    line-height: 1.25rem;
    border-radius: 9999px;
    white-space: nowrap;
}

.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-info    { background: #dbeafe; color: #1e40af; }
.badge-neutral { background: #f1f5f9; color: #475569; }

/* ---------- Loading spinner ---------- */
.spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #e2e8f0;
    border-top-color: #10b981;
    border-radius: 50%;
    animation: spin .65s linear infinite;
}

.spinner-lg {
    width: 48px;
    height: 48px;
    border-width: 4px;
}

/* ---------- Fingerprint scan ---------- */
.fingerprint-scan {
    position: relative;
    border-radius: 50%;
    animation: fingerprintScan 2s ease-out infinite;
}

.fingerprint-scan::after {
    content: '';
    position: absolute;
    left: 10%;
    right: 10%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #10b981, transparent);
    border-radius: 2px;
    animation: fingerprintLine 2s ease-in-out infinite;
}

/* ---------- Table rows ---------- */
.table-row-hover tr {
    transition: background .15s ease;
}

.table-row-hover tr:hover {
    background: #f8fafc;
}

/* ---------- Button press ---------- */
.btn-press {
    transition: transform .1s ease, box-shadow .15s ease;
}

.btn-press:active {
    transform: scale(.96);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, .1);
}

/* ---------- Toast notifications ---------- */
.toast {
    animation: toastIn .35s ease-out both;
}

.toast.toast-exit {
    animation: toastOut .3s ease-in both;
}

/* ---------- Line-clamp utilities ---------- */
.line-clamp-1,
.line-clamp-2,
.line-clamp-3 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-1 { -webkit-line-clamp: 1; }
.line-clamp-2 { -webkit-line-clamp: 2; }
.line-clamp-3 { -webkit-line-clamp: 3; }

/* ---------- Responsive helpers ---------- */
@media (max-width: 640px) {
    .stat-card:hover {
        transform: none;
    }

    .modal-content {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
    }
}

/* ---------- Print ---------- */
@media print {
    #sidebar,
    .sidebar,
    header,
    .no-print,
    .toast,
    .modal-overlay,
    button,
    .btn-press {
        display: none !important;
    }

    body {
        background: #fff !important;
        color: #000 !important;
    }

    .stat-card,
    .card-hover {
        box-shadow: none !important;
        transform: none !important;
        break-inside: avoid;
    }

    table {
        border-collapse: collapse;
        width: 100%;
    }

    table th,
    table td {
        border: 1px solid #d1d5db;
        padding: 6px 10px;
    }

    a[href]::after {
        content: none !important;
    }
}
