/**
 * Derosetta Supermarket - Custom Styles
 * Glassmorphic design system with print styles, receipt formatting, and custom components
 */

/* ===== Root Variables ===== */
:root {
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.3);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
    --glass-blur: 16px;
    --gradient-start: #eff6ff;
    --gradient-mid: #dbeafe;
    --gradient-end: #eff6ff;
    --sidebar-from: #1e3a8a;
    --sidebar-to: #1e40af;
}

/* ===== Body Background ===== */
body {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 25%, #bfdbfe 50%, #93c5fd 75%, #eff6ff 100%);
    background-attachment: fixed;
}

/* ===== Glassmorphic Card ===== */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 1rem;
}

.glass-card-solid {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
    border-radius: 1rem;
}

/* ===== Glassmorphic Header ===== */
.glass-header {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 1px 12px rgba(0, 0, 0, 0.03);
    position: relative;
    z-index: 30;
}

/* ===== Glassmorphic Sidebar ===== */
.glass-sidebar {
    background: linear-gradient(180deg, var(--sidebar-from) 0%, var(--sidebar-to) 100%);
    position: relative;
    overflow: hidden;
}

.glass-sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(255, 255, 255, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(255, 255, 255, 0.04) 0%, transparent 50%);
    pointer-events: none;
}

.glass-sidebar > * {
    position: relative;
    z-index: 1;
}

/* ===== Glassmorphic Login ===== */
.glass-login-bg {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 25%, #1d4ed8 50%, #2563eb 75%, #3b82f6 100%);
    position: relative;
    overflow: hidden;
}

.glass-login-bg::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 70% 70%, rgba(255, 255, 255, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.04) 0%, transparent 60%);
    animation: loginShimmer 20s ease-in-out infinite;
}

@keyframes loginShimmer {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(2%, 1%) rotate(1deg); }
    66% { transform: translate(-1%, 2%) rotate(-1deg); }
}

.glass-login-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border-radius: 1.5rem;
}

.glass-login-input {
    background: rgba(255, 255, 255, 0.12) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: white !important;
    transition: all 0.2s ease;
}

.glass-login-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.glass-login-input:focus {
    background: rgba(255, 255, 255, 0.18) !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.glass-login-btn {
    background: rgba(255, 255, 255, 0.2) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    transition: all 0.2s ease;
}

.glass-login-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

/* ===== Glassmorphic Modal ===== */
.glass-modal-overlay {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.glass-modal {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.12);
    border-radius: 1.25rem;
}

/* ===== Print Styles ===== */
@media print {
    @page {
        size: 80mm auto;
        margin: 0;
    }

    body * {
        visibility: hidden;
    }

    #print-area,
    #print-area * {
        visibility: visible;
    }

    #print-area {
        position: absolute;
        left: 0;
        top: 0;
        width: 80mm;
    }

    .no-print {
        display: none !important;
    }
}

/* ===== Receipt Styles ===== */
.receipt-item {
    margin-bottom: 4px;
}

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

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

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

/* ===== Smooth Transitions ===== */
.sidebar-transition {
    transition: transform 0.3s ease-in-out;
}

/* ===== POS Grid ===== */
.pos-product-card {
    transition: all 0.2s ease;
}

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

/* ===== Table Row Hover ===== */
tbody tr {
    transition: background-color 0.15s ease;
}

/* ===== Glass Table ===== */
.glass-table-container {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 1rem;
    overflow: hidden;
}

.glass-table-container thead {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.glass-table-container tbody tr:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* ===== Toast Animation (consolidated) ===== */

/* ===== Focus Ring Consistency ===== */
input:focus,
select:focus,
textarea:focus {
    outline: none;
}

/* ===== Loading Spinner ===== */
.spinner {
    border: 2px solid rgba(0, 0, 0, 0.05);
    border-top-color: #3b82f6;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 0.6s linear infinite;
}

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

/* ===== Glass Stat Card ===== */
.glass-stat-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.glass-stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #2563eb, #1d4ed8);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.glass-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
}

.glass-stat-card:hover::after {
    opacity: 1;
}

/* Legacy stat-card support */
.stat-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
}

/* ===== Badge Pulse ===== */
.badge-pulse {
    animation: pulse 2s infinite;
}

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

/* ===== Mobile Sidebar Overlay ===== */
@media (max-width: 768px) {
    .sidebar-overlay {
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
    }
}

/* Force sidebar visible inside mobile overlay (it has hidden md:flex on the aside) */
#mobile-sidebar #sidebar {
    display: flex !important;
}

/* ===== Mobile Responsive ===== */
@media (max-width: 768px) {
    /* iOS Safari zoom prevention — inputs must be >= 16px */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="tel"],
    input[type="search"],
    input[type="date"],
    select,
    textarea {
        font-size: 16px !important;
    }

    /* Touch-friendly targets — minimum 44x44px */
    button, a, [role="button"] {
        min-height: 44px;
        min-width: 44px;
    }

    /* But keep small icon buttons in groups compact */
    .pay-method,
    .cat-filter {
        min-height: 36px;
        min-width: auto;
    }

    /* Tables: horizontal scroll with snap */
    .overflow-x-auto {
        -webkit-overflow-scrolling: touch;
    }

    /* Modals: full-width on mobile with less margin */
    .glass-modal,
    [id$="-modal"] > div {
        margin-left: 0.5rem !important;
        margin-right: 0.5rem !important;
        max-width: calc(100vw - 1rem) !important;
    }

    /* Floating help button: reposition to avoid bottom nav */
    a.fixed.bottom-6 {
        bottom: 5rem !important;
    }

    /* Toast container: full-width on mobile */
    #toast-container {
        left: 1rem;
        right: 1rem;
    }
    #toast-container > div {
        max-width: 100% !important;
    }

    /* Page content: less padding on mobile */
    .page-content {
        padding: 0.75rem !important;
    }

    /* Stat cards: stack nicely */
    .glass-stat-card, .stat-card {
        padding: 1rem;
    }

    /* Charts: reduce height on mobile */
    .h-64 {
        height: 12rem;
    }
}

/* ===== Mobile Bottom Navigation ===== */
.mobile-bottom-nav {
    display: none;
}

@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 35;
        background: rgba(255, 255, 255, 0.92);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid rgba(255, 255, 255, 0.3);
        box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06);
        padding: 0.25rem 0;
        padding-bottom: env(safe-area-inset-bottom, 0.25rem);
    }

    .mobile-bottom-nav a {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        padding: 0.35rem 0.25rem;
        font-size: 0.625rem;
        font-weight: 500;
        color: #6b7280;
        text-decoration: none;
        transition: color 0.2s ease;
        min-height: 52px;
    }

    .mobile-bottom-nav a.active {
        color: #2563eb;
    }

    .mobile-bottom-nav a:not(.active):hover {
        color: #374151;
    }

    .mobile-bottom-nav a i,
    .mobile-bottom-nav a svg {
        width: 20px;
        height: 20px;
    }

    /* Add bottom padding to main content so it's not hidden behind bottom nav */
    .page-content {
        padding-bottom: 4.5rem !important;
    }

    /* Adjust main area to account for bottom nav */
    .flex.h-screen {
        padding-bottom: 52px;
    }
}

/* ===== Number Input Arrows Removal ===== */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

/* ===== Gradient Text ===== */
.gradient-text {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== Form Input Consistency ===== */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="search"],
input[type="date"],
select,
textarea {
    font-size: 0.875rem;
    line-height: 1.5;
}

/* ===== Prevent layout shift on modal open ===== */
body.modal-open {
    overflow: hidden;
}

/* ===== Chart Container ===== */
.chart-container {
    position: relative;
    width: 100%;
}

/* ===== Glass Chart Card ===== */
.glass-chart-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 1rem;
    padding: 1.5rem;
}

/* ===== Low Stock Indicator ===== */
.stock-low {
    color: #f59e0b;
    font-weight: 600;
}

.stock-out {
    color: #ef4444;
    font-weight: 600;
}

.stock-ok {
    color: #3b82f6;
}

/* ===== Glass Button Variants ===== */
.glass-btn-primary {
    background: rgba(59, 130, 246, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #1d4ed8;
    transition: all 0.2s ease;
}

.glass-btn-primary:hover {
    background: rgba(59, 130, 246, 0.25);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.15);
}

.glass-btn-danger {
    background: rgba(239, 68, 68, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #dc2626;
    transition: all 0.2s ease;
}

.glass-btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.1);
}

/* ===== Sidebar Nav Item Hover ===== */
.glass-sidebar nav a {
    position: relative;
    transition: all 0.2s ease;
}

.glass-sidebar nav a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 0 2px 2px 0;
    transition: height 0.2s ease;
}

.glass-sidebar nav a:hover::before {
    height: 60%;
}

.glass-sidebar nav a[class*="bg-white"]::before {
    height: 60%;
}

/* ===== Glassmorphic Dropdown ===== */
.glass-dropdown {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
    border-radius: 0.75rem;
}

/* ===== Subtle Shimmer for Active Elements ===== */
@keyframes subtleShimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.glass-active-shimmer {
    background-image: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.08) 50%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: subtleShimmer 3s ease-in-out infinite;
}

/* ===== Glassmorphic Filter Bar ===== */
.glass-filter-bar {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 0.75rem;
    padding: 1rem;
}

/* ===== Glassmorphic Toast ===== */
.glass-toast {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    border-radius: 0.75rem;
}

/* ===== Decorative Blobs for Login ===== */
.login-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.3;
    pointer-events: none;
}

.login-blob-1 {
    width: 300px;
    height: 300px;
    background: #60a5fa;
    top: 10%;
    left: 10%;
    animation: blobFloat 12s ease-in-out infinite;
}

.login-blob-2 {
    width: 250px;
    height: 250px;
    background: #93c5fd;
    bottom: 15%;
    right: 10%;
    animation: blobFloat 15s ease-in-out infinite reverse;
}

.login-blob-3 {
    width: 200px;
    height: 200px;
    background: #bfdbfe;
    top: 50%;
    right: 30%;
    animation: blobFloat 18s ease-in-out infinite 3s;
}

@keyframes blobFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(20px, -30px) scale(1.05); }
    50% { transform: translate(-10px, 20px) scale(0.95); }
    75% { transform: translate(15px, 10px) scale(1.02); }
}

/* ===== Page Content Fade-In ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-content {
    animation: fadeInUp 0.4s ease-out;
}

/* ===== Modal Scale Animation ===== */
@keyframes modalScaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.glass-modal {
    animation: modalScaleIn 0.2s ease-out;
}

/* ===== Card Stagger Animation ===== */
@keyframes cardSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-card,
.glass-stat-card,
.glass-card {
    animation: cardSlideIn 0.3s ease-out backwards;
}

.stat-card:nth-child(1), .glass-stat-card:nth-child(1), .glass-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2), .glass-stat-card:nth-child(2), .glass-card:nth-child(2) { animation-delay: 0.1s; }
.stat-card:nth-child(3), .glass-stat-card:nth-child(3), .glass-card:nth-child(3) { animation-delay: 0.15s; }
.stat-card:nth-child(4), .glass-stat-card:nth-child(4), .glass-card:nth-child(4) { animation-delay: 0.2s; }
.stat-card:nth-child(5), .glass-stat-card:nth-child(5), .glass-card:nth-child(5) { animation-delay: 0.25s; }
.stat-card:nth-child(6), .glass-stat-card:nth-child(6), .glass-card:nth-child(6) { animation-delay: 0.3s; }

/* ===== Button Ripple Effect ===== */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease, opacity 0.4s ease;
    opacity: 0;
}

.btn-ripple:active::after {
    width: 200px;
    height: 200px;
    opacity: 1;
    transition: 0s;
}

/* ===== Sidebar Icon Animation ===== */
.glass-sidebar nav a i[data-lucide] {
    transition: transform 0.2s ease;
}

.glass-sidebar nav a:hover i[data-lucide] {
    transform: scale(1.15);
}

.glass-sidebar nav a[class*="bg-white"] i[data-lucide] {
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ===== Stats Number Animation ===== */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-value {
    animation: countUp 0.5s ease-out;
}

/* ===== Enhanced Toast Animation ===== */
@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

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

@keyframes toastProgress {
    from { width: 100%; }
    to { width: 0%; }
}

.toast-enter {
    animation: toastSlideIn 0.35s ease-out;
}

.toast-exit {
    animation: toastSlideOut 0.35s ease-in forwards;
}

.toast-progress-bar {
    height: 3px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 0 0 0 8px;
    animation: toastProgress linear forwards;
}

/* ===== Table Row Animation ===== */
@keyframes rowFadeIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

tbody tr {
    animation: rowFadeIn 0.3s ease-out backwards;
}

tbody tr:nth-child(1) { animation-delay: 0.02s; }
tbody tr:nth-child(2) { animation-delay: 0.04s; }
tbody tr:nth-child(3) { animation-delay: 0.06s; }
tbody tr:nth-child(4) { animation-delay: 0.08s; }
tbody tr:nth-child(5) { animation-delay: 0.1s; }
tbody tr:nth-child(6) { animation-delay: 0.12s; }
tbody tr:nth-child(7) { animation-delay: 0.14s; }
tbody tr:nth-child(8) { animation-delay: 0.16s; }
tbody tr:nth-child(9) { animation-delay: 0.18s; }
tbody tr:nth-child(10) { animation-delay: 0.2s; }

/* ===== Filter Bar Animation ===== */
@keyframes filterSlideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.glass-filter-bar,
.glass-card:has(input[type="search"]) {
    animation: filterSlideDown 0.3s ease-out;
}

/* ===== Badge Bounce Animation ===== */
@keyframes badgeBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.badge-bounce {
    animation: badgeBounce 0.4s ease;
}

/* ===== Loading Skeleton Animation ===== */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,0.1) 25%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0.1) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 0.5rem;
}

/* ===== Icon Spin for Loading ===== */
@keyframes iconSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.icon-spin {
    animation: iconSpin 1s linear infinite;
}

/* ===== Hover Lift Effect ===== */
.hover-lift {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

/* ===== Gradient Border Animation ===== */
@keyframes gradientRotate {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.gradient-border {
    position: relative;
    background: linear-gradient(white, white) padding-box,
                linear-gradient(90deg, #3b82f6, #2563eb, #1d4ed8, #3b82f6) border-box;
    background-size: 300% 300%;
    animation: gradientRotate 3s ease infinite;
    border: 2px solid transparent;
}

/* ===== Success Checkmark Animation ===== */
@keyframes checkmarkDraw {
    0% { stroke-dashoffset: 24; }
    100% { stroke-dashoffset: 0; }
}

.checkmark-circle {
    stroke-dasharray: 24;
    stroke-dashoffset: 24;
    animation: checkmarkDraw 0.4s ease forwards;
}

/* ===== Smooth Page Transitions ===== */
main {
    animation: fadeInUp 0.3s ease-out;
}

/* ===== Notification Bell Ring ===== */
@keyframes bellRing {
    0%, 100% { transform: rotate(0); }
    10%, 30% { transform: rotate(-10deg); }
    20%, 40% { transform: rotate(10deg); }
    50% { transform: rotate(0); }
}

.bell-ring {
    animation: bellRing 0.6s ease;
}

/* ===== Sidebar Nav Item Active Indicator ===== */
.glass-sidebar nav a[class*="bg-white"] {
    position: relative;
}

.glass-sidebar nav a[class*="bg-white"]::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: white;
    border-radius: 3px 0 0 3px;
}

/* ===== Print Styles ===== */
@media print {
    /* Hide everything except print content */
    body * {
        visibility: hidden;
    }
    #print-area, #print-area * {
        visibility: visible;
    }
    #print-area {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }

    /* Hide UI chrome */
    .glass-sidebar,
    .glass-header,
    .mobile-bottom-nav,
    #toast-container,
    #contextual-tip,
    #mobile-sidebar-overlay,
    .fixed.bottom-6.right-6 {
        display: none !important;
    }

    /* Print modal: hide controls, show content */
    .print\\:hidden {
        display: none !important;
    }
}
