/* ============================================================
   AquaCRM — Custom CSS
   Supplements Tailwind CSS with animations, scrollbar styles,
   sidebar transitions, and print utilities.
   ============================================================ */

/* ── Custom scrollbar ── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

/* ── Sidebar transition ── */
aside {
    will-change: transform;
}

/* Sidebar nav link active indicator */
.sidebar-nav a[class*="bg-primary"] {
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.35);
}

/* ── Fade-in animation for page content ── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

main > * {
    animation: fadeInUp 0.25s ease-out both;
}

/* ── Skeleton loader pulse ── */
@keyframes skeleton-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}
.skeleton {
    background-color: #e2e8f0;
    border-radius: 0.375rem;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

/* ── Card hover lift ── */
.card-hover {
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.card-hover:hover {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 4px 10px -5px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

/* ── Button ripple effect ── */
.btn-ripple {
    position: relative;
    overflow: hidden;
}
.btn-ripple::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.15);
    opacity: 0;
    transition: opacity 0.2s;
}
.btn-ripple:active::after {
    opacity: 1;
}

/* ── Alpine.js x-cloak ── */
[x-cloak] { display: none !important; }

/* ── Toast notifications ── */
#toast-container {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 22rem;
    width: calc(100% - 2.5rem);
}
.toast {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.12), 0 4px 10px -5px rgba(0,0,0,0.08);
    border-left: 4px solid transparent;
    animation: fadeInUp 0.25s ease-out both;
}
.toast.success { border-color: #10b981; }
.toast.error   { border-color: #ef4444; }
.toast.warning { border-color: #f59e0b; }
.toast.info    { border-color: #0ea5e9; }

/* ── Table responsive wrapper ── */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.table-responsive table {
    min-width: 600px;
}

/* ── Form focus ring consistency ── */
input:focus,
select:focus,
textarea:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

/* ── Glassmorphism utility (used on auth page) ── */
.glass {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* ── Status badge ── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.5;
}
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-info    { background: #e0f2fe; color: #0c4a6e; }
.badge-gray    { background: #f1f5f9; color: #475569; }

/* ── Print styles ── */
@media print {
    aside,
    header,
    footer,
    #toast-container,
    .no-print {
        display: none !important;
    }

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

    main {
        padding: 0 !important;
    }

    .bg-white {
        box-shadow: none !important;
        border: 1px solid #e2e8f0 !important;
    }

    a {
        text-decoration: none;
        color: inherit;
    }

    @page {
        margin: 1.5cm;
    }
}
