/* ================================================================
   LocalClaw v2.0 - Custom Styles
   ================================================================ */

/* ---- Base ---- */
* {
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
}

/* ---- Animated Gradient Text ---- */
.animate-gradient {
    background-size: 200% 200%;
    animation: gradientShift 4s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ---- Particles Canvas ---- */
#particles-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.6;
}

/* ---- Card Styles ---- */
.claw-card {
    background: rgba(15, 15, 17, 0.5);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.claw-card:hover {
    background: rgba(15, 15, 17, 0.85);
    border-color: rgba(255, 69, 58, 0.35);
    box-shadow:
        0 0 40px -15px rgba(255, 69, 58, 0.15),
        0 8px 32px -8px rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
}

/* ---- Animations ---- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(20px) scale(0.95);
    }
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 15px rgba(255, 69, 58, 0.4);
    }
    50% {
        box-shadow: 0 0 30px rgba(255, 69, 58, 0.7);
    }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-6px); }
}

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

/* ---- Custom Scrollbar ---- */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: #050505;
}
::-webkit-scrollbar-thumb {
    background: #27272A;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #FF453A;
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #27272A #050505;
}

/* ---- Details/Summary Polish ---- */
details summary::-webkit-details-marker {
    display: none;
}

details summary::marker {
    content: '';
}

details[open] > summary {
    margin-bottom: 0;
}

/* ---- Progress Bar Glow ---- */
.progress-glow {
    box-shadow: 0 0 10px rgba(255, 69, 58, 0.4), 0 0 20px rgba(255, 69, 58, 0.1);
}

/* ---- Table Styles ---- */
table {
    border-collapse: collapse;
}

table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* ---- Focus Styles ---- */
button:focus-visible,
a:focus-visible,
textarea:focus-visible {
    outline: 2px solid rgba(255, 69, 58, 0.5);
    outline-offset: 2px;
}

/* ---- Selection ---- */
::selection {
    background: rgba(255, 69, 58, 0.3);
    color: white;
}

/* ---- Buy Me a Coffee Widget ---- */
#bmc-wbtn {
    transform: scale(0.85);
    transform-origin: right bottom;
}

/* ---- Toast Styles ---- */
.claw-toast {
    max-width: 90vw;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---- Responsive Fixes ---- */
@media (max-width: 640px) {
    .claw-card {
        padding: 1.25rem;
    }

    .claw-card:hover {
        transform: none; /* Disable transform on mobile for better perf */
    }

    h1 {
        font-size: 2.5rem !important;
    }

    h2 {
        font-size: 1.75rem !important;
    }

    /* Improve touch targets on mobile */
    button, a {
        min-height: 44px;
    }
}

@media (max-width: 380px) {
    h1 {
        font-size: 2rem !important;
    }
}

/* ---- Code Block Styles ---- */
code {
    font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', Monaco, 'Cascadia Code', monospace;
}

/* ---- Loading Skeleton ---- */
.skeleton {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.03) 25%,
        rgba(255, 255, 255, 0.06) 50%,
        rgba(255, 255, 255, 0.03) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

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

/* ---- Noise texture overlay (subtle) ---- */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 999;
    pointer-events: none;
    opacity: 0.015;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
}

/* ---- Glow effect behind hero ---- */
.hero-glow {
    background: radial-gradient(
        ellipse 60% 50% at 50% 30%,
        rgba(255, 69, 58, 0.08) 0%,
        rgba(255, 69, 58, 0.03) 40%,
        transparent 70%
    );
    position: absolute;
    inset: -20% -10%;
    pointer-events: none;
    z-index: -1;
}

/* ---- Benchmark bar animation ---- */
.benchmark-bar {
    transition: width 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* ---- Print Styles ---- */
@media print {
    body::before,
    #particles-canvas,
    nav,
    footer {
        display: none !important;
    }

    .claw-card {
        border: 1px solid #ddd !important;
        background: white !important;
        color: black !important;
        box-shadow: none !important;
    }
}
