/* ========================================================
   ESTILOS PREMIUM - PROYECTO DRAW_NET (SaaS)
   Diseñado con Glassmorphism, Micro-animaciones y HSL variables
   ======================================================== */

:root {
    /* Paleta de Colores HSL */
    --primary-h: 210;
    --primary-s: 100%;
    --primary-l: 50%; /* Azul de alta tecnología (#007bff) */
    
    --accent-h: 260;
    --accent-s: 85%;
    --accent-l: 60%; /* Púrpura Eléctrico */
    
    --success-h: 145;
    --success-s: 63%;
    --success-l: 44%; /* Verde Bosque */

    --warning-h: 38;
    --warning-s: 100%;
    --warning-l: 50%; /* Oro Cálido */
    
    --danger-h: 354;
    --danger-s: 70%;
    --danger-l: 54%; /* Rojo Alerta */

    /* Fuentes y bordes */
    --font-primary: 'Outfit', sans-serif;
    --border-radius-sm: 8px;
    --border-radius-md: 16px;
    --border-radius-lg: 24px;
    
    /* Configuración de cristalería (Glassmorphism - Modo Claro por defecto) */
    --glass-bg: rgba(255, 255, 255, 0.45);
    --glass-border: rgba(255, 255, 255, 0.25);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.08);
    --glass-blur: blur(12px) saturate(180%);
    
    --card-glow-shadow: 0 10px 40px rgba(0, 123, 255, 0.05);
}

/* Overrides para el Modo Oscuro */
[data-bs-theme="dark"] {
    --glass-bg: rgba(18, 18, 30, 0.55);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --card-glow-shadow: 0 10px 40px rgba(111, 66, 193, 0.12);
}

/* ========================================================
   ESTILOS GENERALES
   ======================================================== */
body {
    font-family: var(--font-primary);
    transition: background-color 0.4s ease, color 0.4s ease;
    overflow-x: hidden;
}

.font-outfit {
    font-family: var(--font-primary);
}

/* Scrollbars Premium */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.2);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.4);
}

/* ========================================================
   COMPONENTES GLASSMORPHISM
   ======================================================== */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: var(--border-radius-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-nav {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    transition: background-color 0.4s, border-color 0.4s;
}

/* Tarjetas Premium con Brillo en Hover */
.premium-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-md);
    box-shadow: var(--glass-shadow);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.premium-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0,123,255,0.08) 0%, rgba(111,66,193,0.08) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 0;
}

.premium-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--card-glow-shadow);
    border-color: rgba(0, 123, 255, 0.3);
}

.premium-card:hover::before {
    opacity: 1;
}

.premium-card * {
    position: relative;
    z-index: 1;
}

/* ========================================================
   INTERACTIVIDAD Y MICRO-ANIMACIONES
   ======================================================== */
/* Botones Premium con Efectos de Gradiente */
.btn-premium {
    background: linear-gradient(135deg, hsl(var(--primary-h), var(--primary-s), 50%) 0%, hsl(var(--accent-h), var(--accent-s), 55%) 100%);
    border: none;
    color: #ffffff;
    font-weight: 600;
    padding: 0.75rem 1.75rem;
    border-radius: var(--border-radius-sm);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-premium:hover {
    background: linear-gradient(135deg, hsl(var(--primary-h), var(--primary-s), 45%) 0%, hsl(var(--accent-h), var(--accent-s), 50%) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.35);
    color: #ffffff;
}

.btn-premium:active {
    transform: translateY(1px);
}

/* Botones Flotantes del Editor (Comandos) */
.btn-command {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-sm);
    background: transparent;
    border: 1px solid transparent;
    color: inherit;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}

.btn-command:hover {
    background: rgba(100, 116, 139, 0.12);
    transform: scale(1.08);
}

.btn-command.active {
    background: hsl(var(--primary-h), var(--primary-s), 50%);
    color: #ffffff !important;
    box-shadow: 0 0 12px rgba(0, 123, 255, 0.4);
}

/* ========================================================
   HOME / MARKETING LANDING SECTIONS
   ======================================================== */
.hero-section {
    position: relative;
    padding: 9rem 0 6rem 0;
    overflow: hidden;
    background: radial-gradient(circle at 10% 20%, rgba(0, 123, 255, 0.04) 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(111, 66, 193, 0.05) 0%, transparent 40%);
}

.hero-mockup-container {
    position: relative;
    perspective: 1000px;
}

.hero-mockup-stage {
    position: relative;
    isolation: isolate;
    padding: 0 0 1.75rem 1.25rem;
}

.hero-mockup-stage::before {
    content: '';
    position: absolute;
    z-index: -2;
    width: 75%;
    height: 70%;
    top: 8%;
    right: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.26), rgba(111, 66, 193, 0.18));
    filter: blur(48px);
    animation: hero-glow 6s ease-in-out infinite;
}

.hero-mockup-image {
    position: relative;
    z-index: 1;
    width: calc(100% + 1rem);
    border-radius: var(--border-radius-md);
    padding: 0.45rem;
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.22), 0 0 0 1px rgba(255,255,255,0.2);
    border: 1px solid var(--glass-border);
    transform: rotateY(-6deg) rotateX(3deg) translateY(0);
    transform-origin: center right;
    transition: transform 0.5s ease, box-shadow 0.5s ease;
    animation: hero-float 7s ease-in-out infinite;
}

.hero-mockup-image:hover {
    transform: rotateY(0deg) rotateX(0deg) translateY(-0.35rem) scale(1.015);
    box-shadow: 0 34px 80px rgba(15, 23, 42, 0.28), 0 0 0 1px rgba(0,123,255,0.3);
    animation-play-state: paused;
}

.hero-mockup-screen {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1.55;
    border-radius: calc(var(--border-radius-md) - 4px);
    background: #111827;
}

.hero-mockup-screen::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(115deg, transparent 25%, rgba(255,255,255,0.13) 48%, transparent 63%);
    transform: translateX(-120%);
    animation: hero-shimmer 5.5s ease-in-out infinite;
}

.hero-mockup-screen img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 62% center;
}

.hero-scan-line {
    position: absolute;
    z-index: 1;
    top: 0;
    left: 12%;
    width: 2px;
    height: 100%;
    background: linear-gradient(180deg, transparent, rgba(0, 209, 255, 0.8), transparent);
    box-shadow: 0 0 18px rgba(0, 209, 255, 0.75);
    opacity: 0;
    animation: hero-scan 7s ease-in-out infinite;
}

.hero-live-status {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    position: absolute;
    z-index: 2;
    left: 1.25rem;
    bottom: -0.8rem;
    padding: 0.55rem 0.8rem;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.78);
    color: rgba(255,255,255,0.9);
    backdrop-filter: blur(12px);
    font-size: 0.72rem;
    letter-spacing: 0.02em;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.2);
}

.hero-live-dot {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.16), 0 0 12px rgba(34, 197, 94, 0.75);
}

.hero-orbit {
    position: absolute;
    z-index: 0;
    border: 1px solid rgba(0, 123, 255, 0.25);
    border-radius: 50%;
    pointer-events: none;
    animation: hero-orbit 8s linear infinite;
}

.hero-orbit-one {
    width: 4.5rem;
    height: 4.5rem;
    top: -0.5rem;
    right: 3.5rem;
}

.hero-orbit-two {
    width: 1.1rem;
    height: 1.1rem;
    top: 1.2rem;
    right: 5.1rem;
    background: #00b7ff;
    box-shadow: 0 0 18px rgba(0, 183, 255, 0.75);
}

@keyframes hero-float {
    0%, 100% { transform: rotateY(-6deg) rotateX(3deg) translateY(0); }
    50% { transform: rotateY(-4deg) rotateX(2deg) translateY(-0.55rem); }
}

@keyframes hero-glow {
    0%, 100% { transform: scale(0.92); opacity: 0.7; }
    50% { transform: scale(1.08); opacity: 1; }
}

@keyframes hero-shimmer {
    0%, 35% { transform: translateX(-120%); }
    70%, 100% { transform: translateX(120%); }
}

@keyframes hero-scan {
    0%, 15% { left: 8%; opacity: 0; }
    25% { opacity: 0.9; }
    75% { opacity: 0.9; }
    88%, 100% { left: 92%; opacity: 0; }
}

@keyframes hero-orbit {
    from { transform: rotate(0deg) translateX(1.2rem) rotate(0deg); }
    to { transform: rotate(360deg) translateX(1.2rem) rotate(-360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .hero-mockup-image,
    .hero-mockup-stage::before,
    .hero-mockup-screen::after,
    .hero-scan-line,
    .hero-orbit {
        animation: none;
    }
}

/* Tarjetas de Planes de Pago (SaaS Grid) */
.pricing-card {
    border-radius: var(--border-radius-md);
    border: 1px solid var(--glass-border);
    transition: all 0.4s ease;
    overflow: hidden;
}

.pricing-card.popular {
    border: 2px solid hsl(var(--accent-h), var(--accent-s), 55%);
    box-shadow: 0 15px 40px rgba(111, 66, 193, 0.15);
}

.pricing-card:hover {
    transform: scale(1.03);
}

/* ========================================================
   ESTILOS DE LA INTERFAZ DEL EDITOR (PANTALLA COMPLETA)
   ======================================================== */
.editor-container {
    height: 100vh;
    width: 100vw;
    position: relative;
    overflow: hidden;
    display: flex;
    min-width: 0;
    min-height: 0;
}

#map-canvas {
    flex: 1 1 auto;
    height: 100%;
    width: auto;
    min-width: 0;
    position: relative;
    top: 0;
    left: 0;
    z-index: 1;
}

/* Controles e interfaces sobrepuestas sobre Google Maps (Z-Index > 1) */
.editor-overlay {
    position: absolute;
    z-index: 10;
    pointer-events: none; /* Permite hacer clic a través de áreas transparentes del lienzo */
}

.editor-overlay * {
    pointer-events: auto; /* Reactiva los clics dentro de los paneles específicos */
}

/* Panel lateral unificado del editor */
.editor-sidebar-right {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    z-index: 1000;
    flex: 0 0 min(390px, max(300px, 38vw));
    width: min(390px, max(300px, 38vw));
    height: 100%;
    transition: flex-basis 0.25s ease, width 0.25s ease;
}

.editor-sidebar-right.is-collapsed {
    right: auto;
    flex-basis: 58px;
    width: 58px;
}

.editor-sidebar-shell {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    pointer-events: auto;
    border: 0;
    border-left: 1px solid var(--glass-border);
    border-radius: 0;
    box-shadow: none;
}

.editor-sidebar-header {
    min-height: 56px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-bottom: 1px solid var(--glass-border);
}

.editor-sidebar-brand-icon {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: rgba(0, 123, 255, 0.12);
    color: hsl(var(--primary-h), var(--primary-s), 50%);
}

.editor-sidebar-toggle {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    padding: 0;
}

.editor-sidebar-right.is-collapsed .editor-sidebar-header {
    justify-content: center;
    padding: 8px 6px;
}

.editor-sidebar-right.is-collapsed .editor-sidebar-header > .d-flex:first-child {
    display: none !important;
}

.editor-sidebar-right.is-collapsed .editor-sidebar-toggle {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
    border-color: transparent;
    background: transparent;
    box-shadow: none;
    color: var(--bs-secondary-color);
    transition: color 0.2s ease, box-shadow 0.2s ease;
}

.editor-sidebar-right.is-collapsed .editor-sidebar-toggle:hover,
.editor-sidebar-right.is-collapsed .editor-sidebar-toggle:focus {
    border-color: transparent;
    background: rgba(100, 116, 139, 0.14);
    box-shadow: none;
    color: var(--bs-primary);
}

.editor-sidebar-content {
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0 8px 10px;
    scrollbar-gutter: stable;
}

.editor-collapsed-actions {
    min-height: 0;
    flex: 1 1 auto;
    overflow-x: hidden;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 8px 5px 10px;
}

.editor-quick-action {
    width: 40px;
    height: 34px;
    flex: 0 0 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 14px;
}

.editor-collapsed-actions .editor-quick-action {
    border-color: transparent !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--bs-secondary-color) !important;
}

.editor-collapsed-actions .editor-quick-action.btn-success {
    color: var(--bs-success) !important;
}

.editor-collapsed-actions .editor-quick-action.btn-primary,
.editor-collapsed-actions .editor-quick-action.btn-outline-primary {
    color: var(--bs-primary) !important;
}

.editor-collapsed-actions .editor-quick-action.btn-outline-info {
    color: var(--bs-info) !important;
}

.editor-collapsed-actions .editor-quick-action:hover,
.editor-collapsed-actions .editor-quick-action:focus {
    border-color: transparent !important;
    background: transparent !important;
    box-shadow: none !important;
}

.editor-collapsed-actions .editor-quick-action:hover,
.editor-collapsed-actions .editor-quick-tool:not(.active):hover {
    box-shadow: 0 2px 8px rgba(100, 116, 139, 0.28) !important;
}

.editor-quick-tool.btn-command {
    width: 40px;
    height: 34px;
    flex: 0 0 34px;
    padding: 0;
    border-radius: 7px;
    font-size: 14px;
}

.editor-collapsed-actions .editor-quick-tool:not(.active),
.editor-collapsed-actions .editor-quick-tool:not(.active):hover,
.editor-collapsed-actions .editor-quick-tool:not(.active):focus {
    border-color: transparent;
    background: transparent;
    box-shadow: none;
    transform: none;
}

.editor-collapsed-actions .editor-quick-action:hover,
.editor-collapsed-actions .editor-quick-tool:not(.active):hover {
    background: rgba(100, 116, 139, 0.14) !important;
    box-shadow: none !important;
}

.editor-collapsed-actions .editor-quick-tool.active {
    border-color: hsl(var(--primary-h), var(--primary-s), 50%);
}

.editor-quick-divider {
    width: 28px;
    height: 1px;
    flex: 0 0 1px;
    margin: 2px 0;
    background: var(--glass-border);
}

.editor-sidebar-content::-webkit-scrollbar {
    width: 7px;
}

.editor-sidebar-content::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.35);
    border-radius: 10px;
}

.editor-mode-strip {
    min-height: 38px;
    padding: 7px 3px 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-bottom: 1px solid var(--glass-border);
}

.editor-mode-strip .badge {
    max-width: 72%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10px;
}

.editor-sidebar-group {
    border-bottom: 1px solid var(--glass-border);
}

.editor-sidebar-group-toggle {
    width: 100%;
    min-height: 40px;
    padding: 8px 3px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    font-size: 12px;
}

.editor-sidebar-group-toggle:hover {
    color: hsl(var(--primary-h), var(--primary-s), 50%);
}

.editor-sidebar-group-toggle > .bi:last-child {
    font-size: 10px;
    color: var(--bs-secondary-color);
}

.editor-sidebar-group-body {
    padding: 0 3px 10px;
    font-size: 12px;
}

.editor-action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.editor-action-grid .btn {
    min-height: 34px;
    padding: 0.35rem 0.4rem;
    font-size: 11px;
    line-height: 1.15;
}

.editor-export-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
    padding: 3px;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    background: rgba(100, 116, 139, 0.06);
}

.editor-export-row select {
    min-width: 0;
    padding: 0.25rem 1.5rem 0.25rem 0.35rem;
    font-size: 11px;
}

.editor-export-row .btn {
    min-height: 30px;
    padding: 0.25rem 0.55rem;
    font-size: 11px;
}

.editor-tool-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
}

.editor-tool.btn-command {
    width: auto;
    height: 46px;
    min-width: 0;
    padding: 4px 2px;
    flex-direction: column;
    gap: 2px;
    border-radius: 8px;
    font-size: 10px;
    line-height: 1.05;
}

.editor-tool.btn-command .bi {
    font-size: 1rem;
}

.editor-tool.btn-command span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.editor-category-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    font-size: 11px;
}

.editor-category-tabs::-webkit-scrollbar {
    height: 4px;
}

.editor-category-tabs .nav-link {
    min-height: 28px;
    font-size: 11px;
    white-space: nowrap;
}

.editor-subsection-label {
    display: block;
    margin-bottom: 6px;
    color: var(--bs-secondary-color);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.45px;
    text-transform: uppercase;
}

.editor-line-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42%;
    min-width: 58px;
    max-width: 125px;
    height: 22px;
    overflow: hidden;
}

.editor-layers-list {
    max-height: 190px;
    overflow-x: hidden;
    overflow-y: auto;
}

.editor-layers-list .layer-node {
    padding: 4px 6px;
}

.editor-layers-list .layer-input-edit {
    width: 100px;
    font-size: 12px;
}

@media (max-width: 768px) {
    .editor-sidebar-right {
        flex-basis: min(360px, 82vw);
        width: min(360px, 82vw);
    }

    .editor-sidebar-right.is-collapsed {
        right: auto;
        flex-basis: 52px;
        width: 52px;
    }
}

@media (max-width: 480px) {
    .editor-sidebar-right {
        flex-basis: 78vw;
        width: 78vw;
    }

    .editor-sidebar-content {
        padding-right: 6px;
        padding-left: 6px;
    }
}

/* Árbol de Capas */
.layer-node {
    padding: 6px 12px;
    border-radius: var(--border-radius-sm);
    transition: background 0.2s ease;
}

.layer-node:hover {
    background: rgba(100, 116, 139, 0.08);
}

.layer-node.selected {
    background: rgba(0, 123, 255, 0.1);
    border-left: 3px solid hsl(var(--primary-h), var(--primary-s), 50%);
}

/* Anotaciones Flotantes del Mapa */
.custom-map-annotation {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0,0,0,0.15);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    white-space: pre-wrap;
    text-align: left;
}

[data-bs-theme="dark"] .custom-map-annotation {
    background: rgba(20, 20, 30, 0.95);
    border-color: rgba(255,255,255,0.1);
    color: #ffffff;
}

/* Animación de Pulso Premium */
@keyframes premium-pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.03); opacity: 0.85; }
    100% { transform: scale(1); opacity: 1; }
}
.animate-pulse {
    animation: premium-pulse 1.8s infinite ease-in-out;
}

/* Fila Seleccionada en Gestor de Símbolos */
.table-row-editing {
    background-color: rgba(0, 123, 255, 0.08) !important;
    border-left: 4px solid hsl(var(--primary-h), var(--primary-s), 50%) !important;
    font-weight: 500;
}

/* Soporte para Símbolos de Nodos con SVG Completo */
.svg-raw-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}
.svg-raw-container svg {
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
    max-height: 100%;
    display: block;
}
.svg-raw-container svg [stroke]:not([stroke="none"]) {
    stroke: currentColor !important;
}

/* Gradiente Blend para el texto Graphio */
.text-graphio-gradient {
    background: linear-gradient(135deg, #00ffff 0%, #3b82f6 50%, #ff66cc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

.navbar-brand .text-graphio-gradient {
    font-size: 1.2em;
}

