/* ===================================
   BASE STYLES - Reset & Global
   =================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background: var(--color-bg-primary);
    color: var(--color-text-primary);
    min-height: 100dvh;
    font-size: var(--font-size-base);
    line-height: 1.6;
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
    isolation: isolate;
}

body::before,
body::after {
    content: '';
    position: fixed;
    pointer-events: none;
    z-index: -1;
    filter: none;
    opacity: .85;
}

body::before {
    top: -140px;
    right: -80px;
    width: 440px;
    height: 440px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(124, 140, 255, 0.24) 0%, rgba(124, 140, 255, 0.08) 34%, transparent 72%);
}

body::after {
    bottom: -180px;
    left: -140px;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(52, 215, 255, 0.18) 0%, rgba(52, 215, 255, 0.05) 38%, transparent 74%);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: var(--scrollbar-width);
    height: var(--scrollbar-width);
}

::-webkit-scrollbar-track {
    background: var(--color-bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--color-bg-tertiary);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-bg-hover);
}

/* Large Scrollbar */
.scrollbar-lg::-webkit-scrollbar {
    width: var(--scrollbar-width-lg);
}

/* Selection */
::selection {
    background: rgba(59, 130, 246, 0.3);
    color: var(--color-text-primary);
}

/* Focus Outline */
*:focus-visible {
    outline: 2px solid var(--color-brand-primary);
    outline-offset: 2px;
}

/* Hide Input File */
input[type="file"] {
    display: none;
}

/* App Container */
.app-container {
    display: flex;
    height: 100dvh;
    min-height: 100dvh;
    width: 100%;
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
    min-height: 0;
}

/* Workspace - área rolável principal */
.workspace {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: var(--spacing-xl);
    scroll-behavior: auto;
    overscroll-behavior: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateZ(0);
    will-change: scroll-position;
}

/* Hidden Element */
.hidden {
    display: none !important;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-display);
    letter-spacing: -0.03em;
}

img {
    max-width: 100%;
    display: block;
}

input,
select,
textarea {
    font: inherit;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Spin Animation */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Pulse Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Slide Up Animation */
@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}
