/* --- SCROLLBAR --- */
/* Stable Gutter (prevents layout shift) */
html {
    scrollbar-gutter: stable;
}

/* Webkit (Chrome, Edge, Safari) */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
    /* Transparent track to look more like overlay */
}

::-webkit-scrollbar-thumb {
    background-color: rgba(255, 170, 0, 0.5);
    /* Semi-transparent thumb initially */
    border-radius: 3px;
    transition: background-color 0.2s;
}

::-webkit-scrollbar-thumb:hover {
    background-color: #ffaa00;
    /* Full color on hover */
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #ffaa00 transparent;
    /* Transparent track for Firefox too */
}

/* --- CURSOR --- */
body,
a,
button,
input,
textarea,
select,
label,
.hoverable {
    cursor: none !important;
}

/* Exception for Help Cursor */
.help,
[title] {
    cursor: help !important;
}

.custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    border: 1px solid #ffaa00;
    border-radius: 50%;
    pointer-events: none;
    z-index: 20000;
    transform: translate(-50%, -50%);
    transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1), height 0.5s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.5s;
    mix-blend-mode: difference;
}

.custom-cursor.active {
    width: 8px;
    /* Shrink to dot */
    height: 8px;
    background-color: #ffffff;
    border-color: #ffaa00;
    opacity: 1;
    mix-blend-mode: normal;
}

/* --- MODALS --- */
/* Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Container */
.modal-container {
    background: #080808;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    border-radius: 12px;
    width: 90%;
    max-width: 450px;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
    color: #e1e1e1;
}

.modal-overlay.active .modal-container {
    transform: scale(1);
}

/* Header */
.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.02);
}

.modal-title {
    font-family: 'Syne', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

/* Body */
.modal-body {
    padding: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #cccac4;
    white-space: pre-wrap;
    /* Allow logs/formatting */
}

/* Footer (Actions) */
.modal-footer {
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Buttons */
.modal-btn {
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    outline: none;
}

.modal-btn-primary {
    background: #ffaa00;
    color: #050505;
    border: 1px solid #ffaa00;
}

.modal-btn-primary:hover {
    background: #fff;
    border-color: #fff;
}

.modal-btn-secondary {
    background: transparent;
    color: #888;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-btn-secondary:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.05);
}

/* Types */
.modal-type-alert .modal-btn-cancel {
    display: none;
}

/* --- COMMON UTILS --- */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9000;
    opacity: 0.02;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Navbar Scroll Effect */
nav {
    transition: all 0.3s ease-in-out;
}

nav.nav-scrolled {
    background-color: rgba(5, 5, 5, 0.7) !important;
    background-image: none !important;
    backdrop-filter: blur(12px) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}

/* Lenis */
html.lenis {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
}

.lenis.lenis-stopped {
    overflow: hidden;
}

/* Glass Panel (Shared) */
.glass-panel {
    background: linear-gradient(145deg, rgba(10, 10, 10, 0.9), rgba(5, 5, 5, 0.95));
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
}