/* ============================================================
   style.css — Animazioni custom + stili globali (tema light)
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   ANIMAZIONI KEYFRAME
   ============================================================ */

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

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

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

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-6px); }
    40%       { transform: translateX(6px); }
    60%       { transform: translateX(-4px); }
    80%       { transform: translateX(4px); }
}

@keyframes pulseSlow {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50%       { opacity: 0.6; transform: scale(1.06); }
}

@keyframes shimmer {
    from { background-position: -200% 0; }
    to   { background-position: 200% 0; }
}

/* ============================================================
   CLASSI ANIMAZIONE
   ============================================================ */

.animate-fade-in-up {
    animation: fadeInUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

.animate-slide-in-left {
    animation: slideInLeft 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.animate-scale-in {
    animation: scaleIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.animate-shake {
    animation: shake 0.4s ease both;
}

.animate-pulse-slow {
    animation: pulseSlow 4s ease-in-out infinite;
}

/* ============================================================
   SCROLLBAR — leggera, adatta al tema light
   ============================================================ */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* ============================================================
   TEXTAREA PROMPT
   ============================================================ */

#promptTextarea {
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
    tab-size: 2;
    line-height: 1.7;
}

/* ============================================================
   FORM INPUT — focus glow effect
   ============================================================ */

input:focus,
textarea:focus,
select:focus {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

/* ============================================================
   SIDEBAR — transizione mobile
   ============================================================ */

#sidebar { will-change: transform; }
#sidebar.open { transform: translateX(0) !important; }

/* ============================================================
   STAT CARD — hover shine leggero
   ============================================================ */

.stat-card {
    transition: box-shadow 0.3s ease, transform 0.3s ease, border-color 0.2s ease;
}

.stat-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 1rem;
    background: linear-gradient(
        105deg,
        transparent 30%,
        rgba(99, 102, 241, 0.04) 50%,
        transparent 70%
    );
    background-size: 200% 100%;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.stat-card:hover::before {
    opacity: 1;
    animation: shimmer 0.8s ease forwards;
}

/* ============================================================
   BADGE
   ============================================================ */

span[class*="ring-inset"] { letter-spacing: 0.01em; }

/* ============================================================
   TABLE ROWS
   ============================================================ */

tbody tr { transition: background-color 0.12s ease; }

/* ============================================================
   PRINT
   ============================================================ */

@media print {
    #sidebar, header, .no-print { display: none !important; }
    .lg\:ml-64 { margin-left: 0 !important; }
    body { background: white !important; color: black !important; }
    #promptTextarea {
        border: 1px solid #e5e7eb;
        color: black;
        background: white;
        height: auto;
    }
}

/* ============================================================
   PREFERS REDUCED MOTION
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
