/* =========================================== */
/* =========== Variables Globales ============ */
/* =========================================== */
:root {
    --bg: #0a0a0a;
    --terminal-bg: #0f0f0f;
    --text: #e8e8e8;
    --text-muted: #888;
    --accent: #4aff4a;
    --accent-secondary: #4a88ff;
    --border: #222;
    --success: #00cc66;
    --warning: #ffcc00;
    --error: #ff4d4d;
    --max-width: 1200px;
    --radius-sm: 2px;
    --radius-md: 4px;
}

.logo-img {
    height: 25px;
    width: auto;
    display: block;
}

/* =========================================== */
/* ============== Estilos Base =============== */
/* =========================================== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

.mono {
    font-family: 'IBM Plex Mono', monospace;
}

/* Container */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}


/* =========================================== */
/* ========== Dashboard Terminal ============= */
/* =========================================== */
.dashboard-terminal {
    background-color: var(--terminal-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2rem;
    margin: 2rem 0;
    position: relative;
    overflow: hidden;
}

.terminal-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.terminal-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.terminal-dot.red {
    background-color: var(--error);
}

.terminal-dot.yellow {
    background-color: var(--warning);
}

.terminal-dot.green {
    background-color: var(--success);
}

.terminal-title {
    margin-left: auto;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.terminal-content--new {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.stats-key-data {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

@media (max-width: 900px) {
    .stats-key-data {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .stats-key-data {
        grid-template-columns: 1fr;
    }
}

.stat-item--key {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(74, 255, 74, 0.1);
    border-radius: 4px;
    padding: 1rem;
    text-align: center;
}

.stat-item--key .stat-value {
    font-size: 1.25rem;
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.stat-item--key .stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Columna de Gráfica y Log */
.terminal-stack-log-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 900px) {
    .terminal-stack-log-grid {
        grid-template-columns: 1fr;
    }
}

/* Gráfica Clustering (SVG) */
.chart-container {
    height: 100%;
    min-height: 200px;
    padding: 0.5rem 0.5rem 0 0.5rem;
    position: relative;
}

.predictive-chart-svg {
    width: 100%;
    height: 100%;
}

/* Ejes y Etiquetas */
.axis-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    fill: var(--text-muted);
}

.grid-line {
    stroke: var(--border);
    stroke-width: 1;
}

/* Animación para los puntos */
@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }

    100% {
        opacity: 0.8;
        transform: scale(1);
    }
}

/* Puntos de datos - Clústering */
.cluster-point {
    r: 3;
    opacity: 0; /* Inicialmente ocultos */
    transform-origin: center;
    animation: fadeInScale 0.5s ease-out forwards;
}

/* Clusters de color */
.cluster-1-point {
    fill: var(--warning);
    /* Verde */
}

.cluster-2-point {
    fill: var(--accent-secondary);
    /* Azul */
    animation-delay: 0.2s; /* Pequeño retraso */
}

.centroid-point {
    fill: var(--text); /* Centroides en blanco/gris para distinguirlos */
    r: 5;
    stroke: var(--bg);
    stroke-width: 1.5;
    opacity: 0;
    animation: fadeInScale 0.5s ease-out forwards 0.6s; /* Aparecen al final */
    animation-fill-mode: forwards;
}

/* Línea de Frontera (Decision Boundary) */
.decision-boundary {
    stroke: var(--text-muted);
    stroke-width: 1;
    stroke-dasharray: 4 2; /* Crea el efecto punteado */
    opacity: 0.5;
    animation: fadeInScale 0.5s ease-out forwards 0.7s;
    animation-fill-mode: forwards;
}

/* Estilo para el log de actividad */
.activity-log-lines {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    font-size: 0.85rem;
    line-height: 1.4;
    padding: 0.5rem 0;
}

.log-line span:first-child {
    color: var(--text-muted);
    margin-right: 0.5rem;
}

.log-line .text-success {
    color: var(--success);
    font-weight: 500;
}

.log-line .text-warning {
    color: var(--warning);
    font-weight: 500;
}

.log-line .text-accent-secondary {
    color: var(--accent-secondary);
    font-weight: 500;
}

/* Panel de Información */
.info-panel {
    background: rgba(15, 15, 15, 0.7);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1.5rem;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.panel-title {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.9rem;
    color: var(--accent);
}

.panel-icon {
    color: var(--accent-secondary);
    font-size: 1rem;
}

/* Línea de comando activa */
.active-command {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.command-line {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.terminal-prompt {
    color: var(--accent);
}

.terminal-command {
    color: var(--accent-secondary);
    font-family: 'IBM Plex Mono', monospace;
}

.blink {
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}


/* =========================================== */
/* ================= Hero ==================== */
/* =========================================== */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 6rem 0 4rem;
    position: relative;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 600;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    font-family: 'Inter', sans-serif;
}

.hero-title .accent {
    color: var(--accent);
    font-family: 'IBM Plex Mono', monospace;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* Stats (Sección Hero) */
.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin: 2rem 0;
}

.stat {
    background-color: var(--terminal-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 0.5rem;
    font-family: 'IBM Plex Mono', monospace;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Responsive para Hero y Stats */
@media (max-width: 900px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .stats {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .hero-title {
        font-size: 2rem;
    }
}


/* =========================================== */
/* ================ Services ================= */
/* =========================================== */

/* Hace que una tarjeta ocupe todo el ancho */
.services-grid .service-card--full-width {
    grid-column: 1 / -1;
}

.service-link {
    text-decoration: none;
    color: inherit;
    display: block;
}


.services-header {
    text-align: center;
    margin-bottom: 4rem;
    position: relative;
}

.services-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
    position: relative;
    display: inline-block;
}

.services-title::before {
    content: ">> ";
    color: var(--accent);
    font-family: 'IBM Plex Mono', monospace;
}

.services-subtitle {
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* Grid de servicios futurista */
.services-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-bottom: 4rem;
}

.service-card {
    background: linear-gradient(145deg, #0c0c0c, #0a0a0a);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    text-align: justify;
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
}

.service-card:nth-child(1) {
    animation-delay: 0.1s;
}

.service-card:nth-child(2) {
    animation-delay: 0.2s;
}

.service-card:nth-child(3) {
    animation-delay: 0.3s;
}

.service-card:nth-child(4) {
    animation-delay: 0.4s;
}

.service-card:nth-child(5) {
    animation-delay: 0.5s;
}

.service-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent 0%, rgba(74, 255, 74, 0.03) 50%, transparent 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.service-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: 0 10px 30px rgba(74, 255, 74, 0.1);
}

.service-card:hover::before {
    opacity: 1;
}

.service-icon {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--accent);
    position: relative;
    display: inline-block;
}

.service-icon::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 30px;
    height: 2px;
    background-color: var(--accent);
    transition: width 0.3s ease;
}

.service-card:hover .service-icon::after {
    width: 60px;
}

.service-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.service-description {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.service-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
}

.tech-pill {
    background-color: rgba(74, 255, 74, 0.1);
    color: var(--accent);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-family: 'IBM Plex Mono', monospace;
    border: 1px solid rgba(74, 255, 74, 0.2);
}

/* Efectos especiales */
.grid-line {
    position: absolute;
    background: linear-gradient(to right, transparent, var(--accent), transparent);
    height: 1px;
    width: 100%;
    opacity: 0.1;
    z-index: -1;
}

.grid-line:nth-child(1) {
    top: 25%;
}

.grid-line:nth-child(2) {
    top: 50%;
}

.grid-line:nth-child(3) {
    top: 75%;
}

.grid-line-vertical {
    position: absolute;
    background: linear-gradient(to bottom, transparent, var(--accent), transparent);
    width: 1px;
    height: 100%;
    opacity: 0.1;
    z-index: -1;
}

.grid-line-vertical:nth-child(4) {
    left: 25%;
}

.grid-line-vertical:nth-child(5) {
    left: 50%;
}

.grid-line-vertical:nth-child(6) {
    left: 75%;
}

/* Responsive para Services */
@media (max-width: 900px) {
    .services-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    body {
        padding: 1rem;
    }

    .services-title {
        font-size: 2rem;
    }

    .service-card {
        padding: 1.5rem;
    }
}

/* Animación de aparición */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* =========================================== */
/* ================ Footer =================== */
/* =========================================== */
.footer {
    padding: 4rem 0 2rem;
    border-top: 1px solid var(--border);
    margin-top: 4rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-text {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-heart {
    color: var(--error);
}

/* Responsive para Footer */
@media (max-width: 600px) {
    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

/* =========================================== */
/* ================ Utilities ================ */
/* =========================================== */
/* Utilería de color */
.text-success {
    color: var(--success);
}

.text-warning {
    color: var(--warning);
}

.text-accent-secondary {
    color: var(--accent-secondary);
}

.text-accent {
    color: var(--accent);
}

.mt-2 {
    margin-top: 2rem;
}

.mb-2 {
    margin-bottom: 2rem;
}

.text-center {
    text-align: center;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}


/* =========================================== */
/* ================ Animaciones ============== */
/* =========================================== */
/* Animación para el cursor parpadeante (compartida) */
.blink {
    animation: blink 1s step-end infinite;
}

/* La animación se mantiene aquí ya que puede ser usada por otros componentes */
@keyframes blink {
    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* =========================================== */
/* ============== Accesibilidad ============== */
/* =========================================== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}