@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;900&display=swap');

/* ================= Base Settings ================= */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px; 
}

body {
    font-family: 'Inter', sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
}

/* Hide Scrollbar Utility */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Custom Selection */
::selection { background-color: #000; color: #fff; }
.dark ::selection { background-color: #fff; color: #000; }

/* Focus States */
input:focus {
    outline: none;
    box-shadow: none;
}

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

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); } 
}
.animate-marquee {
    animation: marquee 30s linear infinite;
}

/* ================= Navigation ================= */
.nav-transition {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease;
}
.nav-hidden {
    transform: translateY(-100%);
}
.nav-visible {
    transform: translateY(0);
}

/* Dropdown Delay Fix */
.group:hover .absolute {
    transition-delay: 0s;
}

/* Docs Nav Active State */
.active-doc-btn {
    color: #000 !important;
    font-weight: 700 !important;
}
.dark .active-doc-btn {
    color: #fff !important;
}

/* ================= Components ================= */

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2.5rem;
    right: 2.5rem;
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}
.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Accordion */
.accordion-content { transition: grid-template-rows 0.3s ease-out; }
.accordion-open { grid-template-rows: 1fr; }
.accordion-closed { grid-template-rows: 0fr; }

/* Custom Range Slider (Used in Image Viewers) */
input[type=range] {
    -webkit-appearance: none;
    background: transparent;
}
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: #000;
    cursor: pointer;
    margin-top: -6px; /* Center on track */
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: transform 0.1s;
}
.dark input[type=range]::-webkit-slider-thumb {
    background: #fff;
    box-shadow: 0 2px 6px rgba(255,255,255,0.2);
}
input[type=range]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}
input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: #e5e7eb; /* gray-200 */
    border-radius: 999px;
}
.dark input[type=range]::-webkit-slider-runnable-track {
    background: #374151; /* gray-700 */
}

/* Image Viewer Utilities */
.cursor-grab { cursor: grab; }
.active\:cursor-grabbing:active { cursor: grabbing; }