/* ============================================
   LinkVault - Custom Styles
   ============================================ */

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-out;
}

.animate-fade-in-up {
    animation: fadeInUp 0.4s ease-out;
}

/* Modal overlay */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.2s ease-out;
}

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

.modal-content {
    background: white;
    border-radius: 1.25rem;
    padding: 1.75rem;
    width: 100%;
    max-width: 28rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    animation: scaleIn 0.25s ease-out;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content.modal-lg {
    max-width: 34rem;
}

/* Scrollbar custom */
.modal-content::-webkit-scrollbar,
.overflow-y-auto::-webkit-scrollbar {
    width: 4px;
}

.modal-content::-webkit-scrollbar-track,
.overflow-y-auto::-webkit-scrollbar-track {
    background: transparent;
}

.modal-content::-webkit-scrollbar-thumb,
.overflow-y-auto::-webkit-scrollbar-thumb {
    background: rgba(39, 174, 96, 0.2);
    border-radius: 9999px;
}

.modal-content::-webkit-scrollbar-thumb:hover,
.overflow-y-auto::-webkit-scrollbar-thumb:hover {
    background: rgba(39, 174, 96, 0.4);
}

/* Login page */
.login-wrapper {
    animation: fadeInUp 0.6s ease-out;
}

/* Nav link active glow */
.nav-link.bg-primary {
    position: relative;
}

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

/* Card hover lift */
.link-card:hover {
    transform: translateY(-2px);
}

/* Smooth transitions on page load — opacity only to preserve fixed positioning */
@keyframes bodyFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

body {
    opacity: 0;
    animation: bodyFadeIn 0.4s ease-out forwards;
}

/* Stats card number counter effect */
.stat-number {
    animation: fadeIn 0.6s ease-out 0.2s both;
}

/* Select dropdown styling */
select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 2.5rem;
}

/* Focus visible for accessibility */
*:focus-visible {
    outline: 2px solid rgb(39, 174, 96);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Table responsive */
@media (max-width: 640px) {
    .modal-content {
        padding: 1.25rem;
        margin: 0.5rem;
    }
}

/* Sidebar fixed behavior */
.sidebar-fixed {
    position: fixed !important;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 1023px) {
    .sidebar-fixed {
        left: -16rem;
    }

    .sidebar-fixed.sidebar-open {
        left: 0;
    }
}

@media (min-width: 1024px) {
    .sidebar-fixed {
        left: 0;
    }
}

/* Chart bar animation */
.bg-primary.h-2\.5,
.bg-blue-500.h-2\.5,
.bg-amber-500.h-2\.5,
.bg-purple-500.h-2\.5,
.bg-rose-500.h-2\.5,
.bg-cyan-500.h-2\.5 {
    animation: slideInRight 0.8s ease-out both;
}