/* src/styles/global.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
@import url('../editor/tools/eyedropper.css');

:root {
    --color-bg: #0B0D10; /* Fundo futurista */
    --color-surface: #13161c;
    --color-surface-hover: #1c202a;
    --color-primary: #0DF38A; /* Verde neon */
    --color-primary-hover: #1DEFC8; /* Verde água / turquesa */
    --color-secondary: #33D9FF; /* Ciano claro */
    --color-glow-green: #18F59A; /* Brilho verde */
    --color-glow-blue: #39D8FF; /* Brilho azul */
    --color-text: #f8fafc;
    --color-text-muted: #94a3b8;
    --color-border: #2a313e;
    
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.2), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-family);
    overflow: hidden; /* Evitar scrollbars indesejados no editor */
    overscroll-behavior: none; /* Previne o efeito "bounce" do iOS/Android */
    touch-action: none; /* Trava o scroll e gestos na tela toda por padrão */
    -webkit-touch-callout: none; /* Previne menu nativo do celular ao segurar a tela */
    -webkit-user-select: none; /* Previne seleção de texto */
    user-select: none;
    -webkit-font-smoothing: antialiased;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
}

input, textarea {
    -webkit-user-select: auto;
    user-select: auto;
}

#app-root {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* --- Global Side Menu --- */
.side-menu-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(3px);
    z-index: 998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.side-menu-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.side-menu {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 280px;
    background-color: var(--color-surface);
    z-index: 999;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 5px 0 20px rgba(0,0,0,0.5);
}

.side-menu.open {
    transform: translateX(0);
}

.side-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border);
}

.side-menu-header h3 {
    font-size: 18px;
    margin: 0;
}

.side-menu-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.menu-action-btn {
    background: transparent;
    border: none;
    color: var(--color-text);
    padding: 12px;
    border-radius: var(--radius-sm);
    text-align: left;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background 0.2s;
}

.menu-action-btn:hover {
    background: var(--color-surface-hover);
}

.menu-action-btn i {
    font-size: 20px;
    color: var(--color-text-muted);
}
.menu-toggle-btn {
    background: transparent;
    border: none;
    color: var(--color-text);
    padding: 8px 12px;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.menu-toggle-btn:hover {
    color: var(--color-primary);
}

/* --- Global Loading Overlay --- */
.global-loader {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(11, 13, 16, 0.7); /* Cor de fundo escura translúcida */
    backdrop-filter: blur(15px); /* Efeito vidro fosco */
    -webkit-backdrop-filter: blur(15px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.global-loader.visible {
    opacity: 1;
    pointer-events: all; /* Bloqueia interação de usuário */
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.loader-logo {
    height: 64px;
    width: auto;
    object-fit: contain;
    /* Animação pulsante flutuante */
    animation: pulse-glow 2.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        transform: translateY(0) scale(1);
        filter: drop-shadow(0 0 10px rgba(13, 243, 138, 0.3));
    }
    50% {
        transform: translateY(-12px) scale(1.05);
        filter: drop-shadow(0 0 25px var(--color-glow-green)) drop-shadow(0 0 15px var(--color-glow-blue));
    }
}

.loader-progress-container {
    width: 240px;
    height: 6px;
    background: var(--color-surface);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #1a1e26;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
}

.loader-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
    border-radius: 4px;
    box-shadow: 0 0 12px var(--color-glow-green);
    transition: width 0.3s ease;
}

/* --- Eyedropper Active State --- */
body.eyedropper-active .editor-topbar,
body.eyedropper-active .sidebar-left,
body.eyedropper-active .sidebar-right,
body.eyedropper-active .max-color-picker-wrapper,
body.eyedropper-active .max-color-picker,
body.eyedropper-active .pcr-app,
body.eyedropper-active .side-menu,
body.eyedropper-active .side-menu-overlay {
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}
