/* ==========================================================================
   SIBLE DESIGN SYSTEM — Global Resets & Base Styles (globals.css)
   Bare element resets, base typography, Alpine.js cloak,
   Ace Editor base layers, Lucide icon defaults, and keyframes.
   ========================================================================== */

/* Alpine.js cloak - hide elements until Alpine initializes */
[x-cloak] {
    display: none !important;
}

/* --- Base Body --- */
body {
    height: 100vh;
    display: flex;
    overflow: hidden;
    margin: 0;
    padding: 0;
    font-family: var(--pico-font-family);
    background-color: var(--ds-background-100);
    color: var(--pico-color);
    letter-spacing: -0.02em;
    -webkit-font-smoothing: antialiased;
}

/* --- Typography --- */
h1,
h2,
h3,
h4,
h5,
h6 {
    letter-spacing: -0.02em;
    font-weight: 600;
    color: var(--ds-gray-1000);
}

/* --- Links --- */
a {
    color: var(--ds-gray-1000);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: #000;
    text-decoration: none;
}

/* --- Aggressive Global Reset for Blue Highlights --- */
*:focus,
*:active,
*:focus-visible {
    -webkit-tap-highlight-color: transparent !important;
    outline: none !important;
    box-shadow: none !important;
}

/* --- Lucide Icon Defaults --- */
.lucide {
    width: 16px;
    height: 16px;
    stroke-width: 1.5px;
    /* Default stroke is currentColor */
}

/* --- Ace Editor Base Overrides (Geist Clear) --- */
.ace_editor {
    font-family: 'Geist Mono', 'SF Mono', monospace !important;
}

.ace_gutter {
    background: var(--surface-secondary) !important;
    border-right: 1px solid var(--border-subtle) !important;
    color: var(--text-muted) !important;
}

.ace_marker-layer .ace_active-line {
    background: var(--surface-secondary) !important;
}

.ace_marker-layer .ace_selection {
    background: #d7eaff !important;
}

#editor {
    height: 100%;
    width: 100%;
}

/* --- Dark Theme: Ace Editor (Catppuccin Mocha) --- */
[data-theme='dark'] .ace_gutter {
    background: #181825 !important;
    border-right: 1px solid #313244 !important;
    color: var(--pico-muted-color) !important;
}

[data-theme='dark'] .ace_marker-layer .ace_active-line {
    background: rgba(0, 0, 0, 0.1) !important;
}

[data-theme='dark'] .ace_marker-layer .ace_selection {
    background: rgba(180, 190, 254, 0.2) !important;
}

/* Custom Catppuccin Mocha Ace Editor Overrides */
[data-theme='dark'] .ace_editor {
    background-color: #1e1e2e !important;
    color: #cdd6f4 !important;
}

[data-theme='dark'] .ace_gutter {
    background-color: #181825 !important;
    color: #bac2de66 !important;
    border-right: 1px solid #313244 !important;
}

[data-theme='dark'] .ace_active-line {
    background-color: #313244 !important;
}

[data-theme='dark'] .ace_gutter-active-line {
    background-color: #313244 !important;
    color: #cba6f7 !important;
}

[data-theme='dark'] .ace_marker-layer .ace_selection {
    background-color: rgba(137, 180, 250, 0.2) !important;
}

[data-theme='dark'] .ace_cursor {
    color: #f5e0dc !important;
}

/* Syntax Highlighting Tweaks for Tomorrow Night Eighties base */
[data-theme='dark'] .ace_keyword {
    color: #cba6f7 !important;
}

[data-theme='dark'] .ace_string {
    color: #a6e3a1 !important;
}

[data-theme='dark'] .ace_variable {
    color: #f5e0dc !important;
}

[data-theme='dark'] .ace_comment {
    color: #6c7086 !important;
}

[data-theme='dark'] .ace_function {
    color: #89b4fa !important;
}

[data-theme='dark'] .ace_numeric {
    color: #fab387 !important;
}

[data-theme='dark'] .ace_constant {
    color: #fab387 !important;
}

[data-theme='dark'] .ace_operator {
    color: #89dceb !important;
}

/* --- Keyframe Animations --- */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes modalScaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}