/* ═══════════════════════════════════════════
   Infinity Reseller Services — Custom Styles
   ═══════════════════════════════════════════ */

/* Sidebar link styles */
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.65);
    transition: all 0.2s ease;
}
.sidebar-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}
.sidebar-link.active {
    color: #fff;
    background: rgba(0, 201, 219, 0.15);
    border-left: 3px solid #00C9DB;
    padding-left: calc(0.75rem - 3px);
}
.sidebar-link.active i {
    color: #00C9DB;
}

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.25rem;
}
.status-pending   { background: #FEF3C7; color: #B45309; }
.status-accepted  { background: #DBEAFE; color: #1D4ED8; }
.status-delivered { background: #D1FAE5; color: #047857; }
.status-rejected  { background: #FEE2E2; color: #B91C1C; }

/* Login page floating orbs */
.orb {
    position: absolute;
    border-radius: 9999px;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s ease-in-out infinite;
}
.orb-1 {
    width: 400px; height: 400px;
    background: #00C9DB;
    top: -100px; right: -100px;
    animation-delay: 0s;
}
.orb-2 {
    width: 300px; height: 300px;
    background: #1B3FAD;
    bottom: -50px; left: -50px;
    animation-delay: -7s;
}
.orb-3 {
    width: 200px; height: 200px;
    background: #8B5CF6;
    top: 50%; left: 50%;
    animation-delay: -14s;
}
@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25%      { transform: translate(30px, -30px) scale(1.05); }
    50%      { transform: translate(-20px, 20px) scale(0.95); }
    75%      { transform: translate(15px, 10px) scale(1.02); }
}

/* Login logo pulse */
.login-logo {
    animation: logoPulse 4s ease-in-out infinite;
}
@keyframes logoPulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 20px rgba(0, 201, 219, 0.3)); }
    50%      { transform: scale(1.03); filter: drop-shadow(0 0 40px rgba(0, 201, 219, 0.5)); }
}

/* Shake animation for error */
.animate-shake {
    animation: shake 0.5s ease-in-out;
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%      { transform: translateX(-8px); }
    40%      { transform: translateX(8px); }
    60%      { transform: translateX(-5px); }
    80%      { transform: translateX(5px); }
}

/* ═══════════ NEW: Page animations ═══════════ */

/* Fade-in up for page content */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
.animate-fadeInUp {
    animation: fadeInUp 0.5s ease-out both;
}

/* Staggered children animation */
.stagger-children > * {
    opacity: 0;
    animation: fadeInUp 0.4s ease-out both;
}
.stagger-children > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(7) { animation-delay: 0.35s; }
.stagger-children > *:nth-child(8) { animation-delay: 0.4s; }

/* Fade in */
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.animate-fadeIn {
    animation: fadeIn 0.3s ease-out both;
}

/* Slide in from left */
@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to   { opacity: 1; transform: translateX(0); }
}
.animate-slideInLeft {
    animation: slideInLeft 0.4s ease-out both;
}

/* Scale in for modals */
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to   { opacity: 1; transform: scale(1); }
}
.animate-scaleIn {
    animation: scaleIn 0.25s ease-out both;
}

/* Pulse glow for notification badges */
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50%      { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}
.pulse-glow {
    animation: pulseGlow 2s ease-in-out infinite;
}

/* Counter animation */
@keyframes countUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.animate-countUp {
    animation: countUp 0.6s ease-out both;
}

/* Hover card lift effect */
.card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* Gradient text */
.text-gradient {
    background: linear-gradient(135deg, #1B3FAD, #00C9DB);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Search input styling */
.search-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%239CA3AF'%3E%3Cpath fill-rule='evenodd' d='M9 3.5a5.5 5.5 0 100 11 5.5 5.5 0 000-11zM2 9a7 7 0 1112.452 4.391l3.328 3.329a.75.75 0 11-1.06 1.06l-3.329-3.328A7 7 0 012 9z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 12px center;
    background-size: 18px;
    padding-left: 40px;
}

/* Scrollbar styling */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #D1D5DB; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9CA3AF; }

/* Skeleton loading */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 0.5rem;
}

/* Notification dot */
.notif-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: #EF4444;
    border-radius: 50%;
    border: 2px solid white;
}

/* Glass card */
.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Table row hover slide effect */
.table-row-anim {
    transition: all 0.2s ease;
}
.table-row-anim:hover {
    background-color: #F8FAFC;
    transform: scale(1.002);
}

/* ═══════════ Mobile Responsive ═══════════ */

/* Fix flex overflow on main content */
main.flex-1 { min-width: 0; }

/* Reduce page padding on mobile */
@media (max-width: 639px) {
    .mob-p { padding: 1rem !important; }
    .mob-px { padding-left: 1rem !important; padding-right: 1rem !important; }

    /* Tighter header on mobile */
    header { padding-left: 1rem !important; padding-right: 1rem !important; padding-top: 0.75rem !important; padding-bottom: 0.75rem !important; }
    header h1 { font-size: 1.125rem !important; }

    /* Hide welcome text on mobile */
    .mob-hide { display: none !important; }

    /* Smaller stat card text */
    .stat-value { font-size: 1.5rem !important; }

    /* Narrower modals get no margin */
    .modal-body { margin: 0 !important; border-radius: 1rem 1rem 0 0 !important; align-self: flex-end; max-height: 90vh; }

    /* Balance cards smaller on mobile */
    .balance-text { font-size: 1.5rem !important; }

    /* Tighter table cells on mobile */
    table th, table td {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
        padding-top: 0.625rem !important;
        padding-bottom: 0.625rem !important;
        font-size: 0.8125rem;
    }
    table th { font-size: 0.625rem; }

    /* Bottom-aligned filter pills — scrollable */
    .filter-row { flex-wrap: nowrap !important; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 0.25rem; }
    .filter-row::-webkit-scrollbar { display: none; }
}

/* Ensure sidebar overlay closes sidebar on tap */
@media (max-width: 1023px) {
    .sidebar-anim { width: 280px; max-width: 80vw; }
}

/* Better touch targets */
@media (hover: none) {
    .card-hover:hover { transform: none; box-shadow: inherit; }
    button, a, .sidebar-link { min-height: 44px; }
    .sidebar-link { min-height: 40px; }
}

/* Fade in */
.animate-fadeIn {
    animation: fadeIn 0.3s ease-in-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Balance card hover */
.balance-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.balance-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 60px -15px rgba(27, 63, 173, 0.3);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

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

/* Smooth transitions for sidebar */
.sidebar-anim {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Table row highlight */
tr.highlight {
    background: #EEF2FF !important;
}

/* Custom focus ring override */
input:focus, textarea:focus, select:focus {
    outline: none;
}
