/* ==========================================================================
   OptiMet Premium CSS Stylesheet
   Design System: Midnight Steel Blue (Trust) + Emerald Teal & Azure Blue (AI)
   ========================================================================== */

/* Design Tokens & Variables */
:root {
    --bg-base: hsl(223, 24%, 6%);
    --bg-surface: hsl(223, 20%, 9%);
    --bg-panel: hsla(223, 20%, 11%, 0.8);
    --bg-panel-solid: hsl(223, 20%, 11%);
    --bg-panel-hover: hsla(223, 20%, 15%, 0.85);
    
    /* Brand Colors (Trust & Automation focus) */
    --primary-h: 159;
    --primary-s: 100%;
    --primary-l: 48%;
    --color-primary: hsl(var(--primary-h), var(--primary-s), var(--primary-l)); /* Emerald Green #00F5A0 */
    --color-primary-glow: hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.35);
    
    --secondary-h: 206;
    --secondary-s: 100%;
    --secondary-l: 42%;
    --color-secondary: hsl(var(--secondary-h), var(--secondary-s), var(--secondary-l)); /* Azure Blue #0078D4 */
    --color-secondary-glow: hsla(var(--secondary-h), var(--secondary-s), var(--secondary-l), 0.35);

    --tertiary-h: 195;
    --tertiary-s: 100%;
    --tertiary-l: 50%;
    --color-tertiary: hsl(var(--tertiary-h), var(--tertiary-s), var(--tertiary-l)); /* Cyan #00D2FF */
    --color-tertiary-glow: hsla(var(--tertiary-h), var(--tertiary-s), var(--tertiary-l), 0.35);

    /* Purple Accent specifically for GanaderIA cards to make it distinct */
    --purple-h: 271;
    --purple-s: 80%;
    --purple-l: 52%;
    --color-purple: hsl(var(--purple-h), var(--purple-s), var(--purple-l)); /* Copilot Purple #8A2BE2 */

    --danger-h: 354;
    --danger-s: 100%;
    --danger-l: 60%;
    --color-danger: hsl(var(--danger-h), var(--danger-s), var(--danger-l)); /* Red alerts */
    
    /* Text Colors */
    --text-main: hsl(210, 20%, 97%);
    --text-muted: hsl(210, 14%, 82%);
    --text-dim: hsl(210, 10%, 60%);
    
    /* Layout & Borders */
    --border-color: hsla(223, 16%, 22%, 0.6);
    --border-glow: hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.25);
    --border-glow-secondary: hsla(var(--secondary-h), var(--secondary-s), var(--secondary-l), 0.25);
    --border-glow-tertiary: hsla(var(--tertiary-h), var(--tertiary-s), var(--tertiary-l), 0.25);
    --border-glow-danger: hsla(var(--danger-h), var(--danger-s), var(--danger-l), 0.25);
    
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
    background-color: var(--bg-base);
    color: var(--text-main);
    font-family: var(--font-body);
}

body {
    overflow-x: hidden;
    line-height: 1.6;
    background-color: var(--bg-base);
}

/* Ambient glow backgrounds */
.bg-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(160px);
    z-index: -10;
    opacity: 0.14;
    pointer-events: none;
}
.bg-glow-1 {
    top: 5%;
    left: -10%;
    background: radial-gradient(circle, var(--color-secondary) 0%, transparent 70%);
}
.bg-glow-2 {
    top: 35%;
    right: -10%;
    background: radial-gradient(circle, var(--color-primary) 0%, transparent 70%);
}
.bg-glow-3 {
    bottom: 10%;
    left: 20%;
    background: radial-gradient(circle, var(--color-tertiary) 0%, transparent 70%);
}

/* Typography & Headers */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

/* Reusable Components */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.text-center { text-align: center; }
.text-gradient {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 50%, var(--color-tertiary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.green-text { color: var(--color-primary); }
.blue-text { color: var(--color-secondary); }
.cyan-text { color: var(--color-tertiary); }
.purple-text { color: var(--color-purple); }
.red-text { color: var(--color-danger); }

/* Glassmorphism Panel */
.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
}

/* Image Wrapper */
.image-wrapper {
    position: relative;
    width: 100%;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    background: #05070a;
}

.visual-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.image-wrapper:hover .visual-img {
    transform: scale(1.03);
}

.visual-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(0deg, rgba(5,7,10,0.6) 0%, rgba(5,7,10,0.1) 60%, rgba(255,255,255,0.02) 100%);
    pointer-events: none;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-weight: 500;
    text-decoration: none;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
}

.btn-large {
    padding: 16px 36px;
    font-size: 1.05rem;
}

.btn-full {
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: #02060c;
    border: none;
    box-shadow: 0 4px 14px 0 rgba(0, 245, 160, 0.25);
    font-weight: 600;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 var(--color-primary-glow);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--text-muted);
    transform: translateY(-2px);
}

.btn-glow {
    position: relative;
    overflow: hidden;
}

.btn-glow::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.btn-glow:hover::after {
    opacity: 1;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 50px;
    background: rgba(0, 245, 160, 0.06);
    border: 1px solid rgba(0, 245, 160, 0.18);
    margin-bottom: 24px;
}

.badge-dot {
    width: 8px;
    height: 8px;
    background-color: var(--color-primary);
    border-radius: 50%;
    margin-right: 8px;
    animation: pulse 1.8s infinite;
}

.badge-text {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Navigation Header */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: var(--transition-smooth);
    border-bottom: 1px solid transparent;
}

.main-header.scrolled {
    background: rgba(5, 7, 10, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 0;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-area {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 12px;
}

.logo-svg {
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.logo-area:hover .logo-svg {
    transform: rotate(60deg) scale(1.05);
}

.brand-name {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.03em;
}

.brand-name span {
    color: var(--color-primary);
}

.nav-menu ul {
    list-style: none;
    display: flex;
    gap: 32px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition-smooth);
}

.nav-link:hover {
    color: var(--color-primary);
}

.header-cta {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.mobile-menu-toggle .bar {
    width: 20px;
    height: 2px;
    background-color: var(--text-main);
    transition: var(--transition-smooth);
}

/* Mobile Nav Open State */
.mobile-menu-toggle.active .bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.mobile-menu-toggle.active .bar:nth-child(2) {
    opacity: 0;
}
.mobile-menu-toggle.active .bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Nav Menu Drawer */
.mobile-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background: var(--bg-panel-solid);
    border-left: 1px solid var(--border-color);
    z-index: 999;
    padding: 100px 32px 32px;
    transition: var(--transition-smooth);
}

.mobile-nav.active {
    right: 0;
}

.mobile-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.mobile-link {
    text-decoration: none;
    color: var(--text-main);
    font-size: 1.1rem;
    font-family: var(--font-heading);
    font-weight: 500;
    display: block;
}

/* Section Common Styles */
section {
    padding: 100px 0;
    border-bottom: 1px solid var(--border-color);
}

.section-header {
    margin-bottom: 64px;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 650px;
    margin: 0 auto;
}

/* Hero Section Styles */
.hero-section {
    position: relative;
    padding-top: 180px;
    padding-bottom: 120px;
    background: radial-gradient(80% 50% at 50% -10%, rgba(0, 120, 212, 0.05) 0%, transparent 100%);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
}

.hero-title {
    font-size: 3.5rem;
    line-height: 1.15;
    margin-bottom: 20px;
    letter-spacing: -0.03em;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 36px;
    max-width: 540px;
}

.hero-actions {
    display: flex;
    gap: 16px;
    margin-bottom: 48px;
}

.hero-stats {
    display: flex;
    gap: 40px;
    border-top: 1px solid var(--border-color);
    padding-top: 32px;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
}

.stat-suffix {
    color: var(--color-primary);
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 4px;
}

.hero-visual {
    position: relative;
}

.hero-visual .image-wrapper {
    aspect-ratio: 1.5;
}

/* Process Flow Section Styles */
.process-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 48px;
    align-items: center;
}

.process-text-area {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.process-step {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.step-number-glow {
    width: 50px;
    height: 50px;
    min-width: 50px;
    border-radius: 50%;
    background: rgba(0, 120, 212, 0.08);
    border: 1px solid var(--border-glow-secondary);
    color: var(--color-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.25rem;
    box-shadow: 0 0 15px rgba(0, 120, 212, 0.2);
}

.process-step:nth-child(odd) .step-number-glow {
    background: rgba(0, 245, 160, 0.08);
    border-color: var(--border-glow);
    color: var(--color-primary);
    box-shadow: 0 0 15px rgba(0, 245, 160, 0.2);
}

.step-body h4 {
    font-size: 1.15rem;
    margin-bottom: 8px;
    color: var(--text-main);
}

.step-body p {
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.process-image-area .image-wrapper {
    aspect-ratio: 1.25;
}

/* Technologies Section Styles */
.tech-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 24px;
}

#tech-vision { grid-column: span 2; }
#tech-molienda { grid-column: span 2; }
#tech-grain { grid-column: span 2; }
#tech-rto { grid-column: span 3; }
#tech-edge { grid-column: span 3; }
#tech-instrumentos { grid-column: span 3; }
#tech-soporte-minero { grid-column: span 3; }

#tech-termografia { grid-column: span 2; }
#tech-cercas { grid-column: span 2; }
#tech-registro { grid-column: span 2; }
#tech-soporte { grid-column: span 3; }
#tech-comederos { grid-column: span 3; }

.tech-card {
    position: relative;
    border-radius: var(--radius-md);
    padding: 36px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: var(--transition-smooth);
    background: rgba(10, 13, 20, 0.45);
}

.tech-card:hover {
    background: var(--bg-panel-hover);
    transform: translateY(-4px);
}

.tech-card:hover#tech-vision { border-color: var(--color-primary); box-shadow: 0 10px 30px rgba(0, 245, 160, 0.1); }
.tech-card:hover#tech-molienda { border-color: var(--color-secondary); box-shadow: 0 10px 30px rgba(0, 120, 212, 0.1); }
.tech-card:hover#tech-grain { border-color: var(--color-secondary); box-shadow: 0 10px 30px rgba(0, 120, 212, 0.1); }
.tech-card:hover#tech-rto { border-color: var(--color-secondary); box-shadow: 0 10px 30px rgba(0, 120, 212, 0.1); }
.tech-card:hover#tech-edge { border-color: var(--color-primary); box-shadow: 0 10px 30px rgba(0, 245, 160, 0.1); }
.tech-card:hover#tech-instrumentos { border-color: var(--color-secondary); box-shadow: 0 10px 30px rgba(0, 120, 212, 0.1); }
.tech-card:hover#tech-soporte-minero { border-color: var(--color-secondary); box-shadow: 0 10px 30px rgba(0, 120, 212, 0.1); }
.tech-card:hover#tech-termografia { border-color: var(--color-purple); box-shadow: 0 10px 30px rgba(138, 43, 226, 0.15); }
.tech-card:hover#tech-cercas { border-color: var(--color-purple); box-shadow: 0 10px 30px rgba(138, 43, 226, 0.15); }
.tech-card:hover#tech-registro { border-color: var(--color-purple); box-shadow: 0 10px 30px rgba(138, 43, 226, 0.15); }
.tech-card:hover#tech-soporte { border-color: var(--color-purple); box-shadow: 0 10px 30px rgba(138, 43, 226, 0.15); }
.tech-card:hover#tech-comederos { border-color: var(--color-purple); box-shadow: 0 10px 30px rgba(138, 43, 226, 0.15); }

.tech-card-glow {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: radial-gradient(800px circle at var(--x, 0px) var(--y, 0px), rgba(255, 255, 255, 0.03), transparent 40%);
    pointer-events: none;
}

.tech-icon-wrapper {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    transition: var(--transition-smooth);
}

.tech-icon-wrapper.border-green { color: var(--color-primary); }
.tech-icon-wrapper.border-blue { color: var(--color-secondary); }
.tech-icon-wrapper.border-purple { color: var(--color-purple); }

.tech-card:hover .tech-icon-wrapper.border-green {
    background: rgba(0, 245, 160, 0.08);
    border-color: var(--border-glow);
}
.tech-card:hover .tech-icon-wrapper.border-blue {
    background: rgba(0, 120, 212, 0.08);
    border-color: var(--border-glow-secondary);
}
.tech-card:hover .tech-icon-wrapper.border-purple {
    background: rgba(138, 43, 226, 0.08);
    border-color: rgba(138, 43, 226, 0.35);
}

.tech-card-title {
    font-size: 1.4rem;
    margin-bottom: 12px;
}

.tech-card-description {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.tech-card-image {
    width: 100%;
    aspect-ratio: 1.8;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border-color);
    margin-top: 20px;
    background: #05070a;
}

.tech-card-image img,
.tech-card-image video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.85) contrast(1.02);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), filter 0.6s ease;
}

.tech-card:hover .tech-card-image img,
.tech-card:hover .tech-card-image video {
    transform: scale(1.1);
    filter: brightness(1.05) contrast(1.05);
}

/* Ajustes de encuadre específicos para fotos reales */
#tech-soporte .tech-card-image img {
    object-position: center 15%; /* Muestra la cabeza y el torso del técnico */
}

#tech-registro .tech-card-image img {
    object-position: center 20%; /* Ajusta el encuadre del equipamiento */
}

#tech-comederos .tech-card-image img {
    object-position: center 25%; /* Ajusta el encuadre de los comederos */
}

#tech-soporte-minero .tech-card-image img {
    object-position: center 20%; /* Muestra adecuadamente al personal de soporte minero */
}

/* GanaderIA High-Impact Banner */
.ganaderia-banner {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.05) 0%, rgba(5, 7, 10, 0.85) 100%);
    padding: 48px;
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.ganaderia-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(138, 43, 226, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 1;
}

.ganaderia-banner:hover {
    transform: translateY(-4px);
    border-color: rgba(138, 43, 226, 0.35);
    box-shadow: 0 20px 50px rgba(138, 43, 226, 0.06);
}

.ganaderia-banner h2 {
    font-size: 2.2rem;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #fff 30%, rgba(255, 255, 255, 0.7) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.ganaderia-banner-desc {
    font-size: 1.05rem;
    color: var(--text-muted);
    max-width: 800px;
    margin-bottom: 40px;
    line-height: 1.6;
}

.ganaderia-features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
}

.g-feature {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.g-feature-icon {
    font-size: 1.8rem;
    padding: 8px;
    background: rgba(138, 43, 226, 0.08);
    border: 1px solid rgba(138, 43, 226, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: 48px;
    color: var(--color-purple);
}

.g-feature-body h4 {
    font-size: 1.15rem;
    color: var(--text-main);
    margin-bottom: 8px;
    font-weight: 600;
}

.g-feature-body p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Dashboard Section Styles */
.dashboard-shell {
    display: grid;
    grid-template-columns: 280px 1fr;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    height: 550px;
    background: rgba(5, 7, 10, 0.85);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6);
}

.dashboard-sidebar {
    background: rgba(10, 13, 20, 0.85);
    border-right: 1px solid var(--border-color);
    padding: 32px 0;
    display: flex;
    flex-direction: column;
}

.sidebar-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0 24px;
    margin-bottom: 20px;
}

.dashboard-tabs {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tab-item {
    display: flex;
    align-items: center;
    padding: 14px 24px;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: var(--transition-smooth);
}

.tab-item:hover {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-main);
}

.tab-item.active {
    background: rgba(0, 245, 160, 0.04);
    color: var(--text-main);
    border-left-color: var(--color-primary);
}

.tab-item[data-tab="tab-molienda"].active {
    background: rgba(0, 120, 212, 0.04);
    border-left-color: var(--color-secondary);
}

.tab-item[data-tab="tab-rto"].active {
    background: rgba(0, 120, 212, 0.04);
    border-left-color: var(--color-secondary);
}

.tab-item[data-tab="tab-ganaderia"].active {
    background: rgba(138, 43, 226, 0.04);
    border-left-color: var(--color-purple);
}

.tab-item[data-tab="tab-grain"].active {
    background: rgba(255, 159, 67, 0.04);
    border-left-color: #ff9f43;
}

.tab-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-right: 12px;
}
.dot-green { background-color: var(--color-primary); }
.dot-blue { background-color: var(--color-secondary); }
.dot-cyan { background-color: var(--color-tertiary); }
.dot-purple { background-color: var(--color-purple); }
.dot-orange { background-color: #ff9f43; }

/* Dashboard Main Window */
.dashboard-main {
    padding: 32px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.dashboard-main-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
    margin-bottom: 24px;
}

.db-title-area {
    display: flex;
    align-items: center;
    gap: 16px;
}

.db-title-area h4 {
    font-size: 1.25rem;
    font-weight: 600;
}

.badge-success {
    background: rgba(0, 245, 160, 0.1);
    color: var(--color-primary);
    border: 1px solid rgba(0, 245, 160, 0.2);
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: monospace;
}

.db-clock {
    font-family: monospace;
    font-size: 0.95rem;
    color: var(--text-dim);
}

/* Tab Content Visibility */
.tab-content {
    display: none;
    flex-direction: column;
    gap: 24px;
    height: 100%;
}

.tab-content.active {
    display: flex;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.metric-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.m-label {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.m-value {
    font-size: 1.55rem;
    font-weight: 700;
    font-family: var(--font-heading);
}

.m-unit {
    font-size: 0.9rem;
    color: var(--text-dim);
    font-weight: 400;
}

.font-red {
    color: var(--color-danger);
}

/* Visual Streams */
.visual-feed {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: stretch;
}

.camera-stream {
    background: #000;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    aspect-ratio: 1.8;
    position: relative;
    overflow: hidden;
}

.rec-indicator {
    position: absolute;
    top: 12px; left: 12px;
    background: rgba(0,0,0,0.6);
    color: var(--color-primary);
    font-size: 0.65rem;
    font-family: monospace;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
    z-index: 10;
}

.thermal-indicator {
    color: var(--color-purple);
}

.overlay-text {
    position: absolute;
    bottom: 12px; right: 12px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 0.6rem;
    font-family: monospace;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.05em;
    z-index: 10;
}

/* ==========================================================================
   Realistic Simulator Overlays
   ========================================================================== */

/* 1. Flotación CV Overlays */
.froth-stream-container {
    background-color: #11151d;
}

.froth-simulation {
    position: absolute;
    width: 100%; height: 100%;
    background-color: #1c212a;
    overflow: hidden;
}

.cv-grid-lines {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-size: 30px 30px;
    background-image: 
        linear-gradient(to right, rgba(0, 245, 160, 0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0, 245, 160, 0.03) 1px, transparent 1px);
    z-index: 1;
}

.cv-crosshair {
    position: absolute;
    top: 50%; left: 50%;
    width: 40px; height: 40px;
    border: 1px dashed rgba(0, 245, 160, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}

.cv-crosshair::before, .cv-crosshair::after {
    content: '';
    position: absolute;
    background-color: rgba(0, 245, 160, 0.3);
}
.cv-crosshair::before { width: 100%; height: 1px; top: 50%; left: 0; }
.cv-crosshair::after { height: 100%; width: 1px; left: 50%; top: 0; }

.cv-bubble {
    position: absolute;
    border: 1.5px solid var(--color-primary);
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, rgba(0, 245, 160, 0.12) 0%, rgba(10, 20, 30, 0.6) 80%);
    box-shadow: 0 0 10px rgba(0, 245, 160, 0.15);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 3;
}

.cv-tag {
    font-family: monospace;
    font-size: 0.5rem;
    background-color: rgba(0,0,0,0.85);
    color: var(--color-primary);
    padding: 1px 3px;
    border-radius: 2px;
    border: 0.5px solid var(--border-glow);
    white-space: nowrap;
    position: absolute;
    top: -12px;
}

.cv-vec {
    color: var(--color-tertiary);
    font-size: 0.75rem;
    font-weight: 700;
}

/* Position bubbles and animate their lateral flow velocity */
.cv-b1 { width: 55px; height: 55px; left: 10%; top: 40%; animation: cv-flow-bubble 4.2s infinite linear; }
.cv-b2 { width: 68px; height: 68px; left: 35%; top: 20%; animation: cv-flow-bubble 3.1s infinite linear 0.4s; }
.cv-b3 { width: 50px; height: 50px; left: 60%; top: 50%; animation: cv-flow-bubble 3.8s infinite linear 0.8s; }
.cv-b4 { width: 42px; height: 42px; left: 80%; top: 15%; animation: cv-flow-bubble 3.5s infinite linear 1.2s; }

@keyframes cv-flow-bubble {
    0% { transform: translate(-80px, 0) scale(0.9); opacity: 0; }
    10% { opacity: 0.85; }
    85% { opacity: 0.85; }
    100% { transform: translate(320px, -20px) scale(1.05); opacity: 0; }
}

/* 2. Molienda Drum Load & Acoustics */
.grinding-stream {
    background-color: #0b0d12;
}

.grinding-stream .mill-animation-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.mill-visual-wrapper {
    position: relative;
    width: 140px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mill-drum {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid var(--border-color);
    background: rgba(10, 13, 20, 0.4);
    z-index: 1;
    animation: rotate-mill 12s linear infinite;
}

.mill-lifter {
    position: absolute;
    width: 6px;
    height: 12px;
    background: var(--border-color);
    left: calc(50% - 3px);
    top: 0;
    transform-origin: 3px 70px;
}

.mill-lifter.l1 { transform: rotate(0deg); }
.mill-lifter.l2 { transform: rotate(45deg); }
.mill-lifter.l3 { transform: rotate(90deg); }
.mill-lifter.l4 { transform: rotate(135deg); }
.mill-lifter.l5 { transform: rotate(180deg); }
.mill-lifter.l6 { transform: rotate(225deg); }
.mill-lifter.l7 { transform: rotate(270deg); }
.mill-lifter.l8 { transform: rotate(315deg); }

.mill-load-profile {
    position: absolute;
    width: 82%;
    height: 82%;
    border-radius: 50%;
    /* Cascading load layout tilted at 45deg representing charge lift */
    background: conic-gradient(
        from 140deg,
        rgba(0, 120, 212, 0.45) 0deg,
        rgba(0, 120, 212, 0.1) 90deg,
        transparent 140deg,
        transparent 360deg
    );
    border: 1px dashed rgba(0, 120, 212, 0.2);
    transform: rotate(15deg);
    z-index: 2;
    pointer-events: none;
}

.mill-angle-line {
    position: absolute;
    width: 50%;
    height: 1.5px;
    background-color: var(--color-tertiary);
    top: 50%;
    left: 50%;
    transform-origin: left center;
    z-index: 5;
}

.angle-shoulder {
    transform: rotate(-38deg); /* 52 degrees */
    background-color: var(--color-primary);
}
.angle-toe {
    transform: rotate(62deg); /* 242 degrees */
    background-color: var(--color-danger);
}

.angle-tag {
    position: absolute;
    right: -75px;
    top: -10px;
    font-family: monospace;
    font-size: 0.55rem;
    background: rgba(0,0,0,0.85);
    padding: 1px 4px;
    border-radius: 2px;
    border: 0.5px solid var(--border-color);
    color: #fff;
}
.angle-shoulder .angle-tag { color: var(--color-primary); }
.angle-toe .angle-tag { color: var(--color-danger); }

.acoustic-spectrum {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 90px;
}

.spec-bar {
    width: 10%;
    background: linear-gradient(to top, rgba(0, 120, 212, 0.15) 0%, var(--color-secondary) 100%);
    border-radius: 2px 2px 0 0;
    transition: height 0.15s ease-out;
}

/* 2.5 Granulometría (Grain) Simulation */
.conveyor-stream-container {
    background-color: #0b0d12;
}

.conveyor-simulation {
    position: absolute;
    width: 100%; height: 100%;
    background-color: #11141a;
    overflow: hidden;
}

.conveyor-belt-track {
    position: absolute;
    bottom: 20%;
    left: 0;
    width: 100%;
    height: 14px;
    background: #1e222b;
    border-top: 3px solid #3a4153;
    border-bottom: 3px solid #0f1115;
    z-index: 2;
}

.conveyor-laser-line {
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 80%;
    background: #ff9f43;
    box-shadow: 0 0 12px #ff9f43, 0 0 4px #ff9f43;
    z-index: 5;
}

.belt-rock {
    position: absolute;
    bottom: 22%;
    background: radial-gradient(circle at 35% 35%, #596172 0%, #2f343f 90%);
    border-radius: 45% 55% 50% 50% / 40% 45% 55% 60%;
    border: 1px solid transparent;
    z-index: 3;
}

.rock-tag {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translate(-50%, 0);
    font-family: monospace;
    font-size: 0.55rem;
    background-color: rgba(0,0,0,0.85);
    color: #ff9f43;
    padding: 1px 3px;
    border-radius: 2px;
    border: 0.5px solid rgba(255, 159, 67, 0.4);
    white-space: nowrap;
    opacity: 0;
    z-index: 4;
}

/* Animations for rocks moving left to right */
.rock-1 { width: 32px; height: 26px; animation: move-rock-1 6s infinite linear 0s; }
.rock-2 { width: 22px; height: 18px; animation: move-rock-2 5.2s infinite linear 1.2s; }
.rock-3 { width: 50px; height: 42px; animation: move-rock-3 6.8s infinite linear 2.5s; }
.rock-4 { width: 26px; height: 21px; animation: move-rock-4 5.6s infinite linear 3.8s; }
.rock-5 { width: 35px; height: 28px; animation: move-rock-5 6.2s infinite linear 5s; }

.rock-1 .rock-tag { animation: fade-tag-1 6s infinite linear 0s; }
.rock-2 .rock-tag { animation: fade-tag-2 5.2s infinite linear 1.2s; }
.rock-3 .rock-tag { animation: fade-tag-3 6.8s infinite linear 2.5s; color: var(--color-danger); border-color: rgba(255, 65, 54, 0.4); }
.rock-4 .rock-tag { animation: fade-tag-4 5.6s infinite linear 3.8s; }
.rock-5 .rock-tag { animation: fade-tag-5 6.2s infinite linear 5s; }

/* Rock 1 animations */
@keyframes move-rock-1 {
    0% { left: -60px; }
    42% { border-color: transparent; box-shadow: none; }
    45% { border-color: #ff9f43; box-shadow: 0 0 8px rgba(255, 159, 67, 0.4); }
    53% { border-color: #ff9f43; box-shadow: 0 0 8px rgba(255, 159, 67, 0.4); }
    56% { border-color: transparent; box-shadow: none; }
    100% { left: 100%; }
}
@keyframes fade-tag-1 {
    0%, 43% { opacity: 0; transform: translate(-50%, 5px) scale(0.85); }
    45%, 52% { opacity: 1; transform: translate(-50%, 0) scale(1); }
    54%, 100% { opacity: 0; transform: translate(-50%, 5px) scale(0.85); }
}

/* Rock 2 animations */
@keyframes move-rock-2 {
    0% { left: -60px; }
    42% { border-color: transparent; box-shadow: none; }
    45% { border-color: #ff9f43; box-shadow: 0 0 8px rgba(255, 159, 67, 0.4); }
    53% { border-color: #ff9f43; box-shadow: 0 0 8px rgba(255, 159, 67, 0.4); }
    56% { border-color: transparent; box-shadow: none; }
    100% { left: 100%; }
}
@keyframes fade-tag-2 {
    0%, 43% { opacity: 0; transform: translate(-50%, 5px) scale(0.85); }
    45%, 52% { opacity: 1; transform: translate(-50%, 0) scale(1); }
    54%, 100% { opacity: 0; transform: translate(-50%, 5px) scale(0.85); }
}

/* Rock 3 animations (Colpa - Alarm / red) */
@keyframes move-rock-3 {
    0% { left: -60px; }
    42% { border-color: transparent; box-shadow: none; }
    45% { border-color: var(--color-danger); box-shadow: 0 0 10px rgba(255, 65, 54, 0.5); }
    53% { border-color: var(--color-danger); box-shadow: 0 0 10px rgba(255, 65, 54, 0.5); }
    56% { border-color: transparent; box-shadow: none; }
    100% { left: 100%; }
}
@keyframes fade-tag-3 {
    0%, 43% { opacity: 0; transform: translate(-50%, 5px) scale(0.85); }
    45%, 52% { opacity: 1; transform: translate(-50%, 0) scale(1); }
    54%, 100% { opacity: 0; transform: translate(-50%, 5px) scale(0.85); }
}

/* Rock 4 animations */
@keyframes move-rock-4 {
    0% { left: -60px; }
    42% { border-color: transparent; box-shadow: none; }
    45% { border-color: #ff9f43; box-shadow: 0 0 8px rgba(255, 159, 67, 0.4); }
    53% { border-color: #ff9f43; box-shadow: 0 0 8px rgba(255, 159, 67, 0.4); }
    56% { border-color: transparent; box-shadow: none; }
    100% { left: 100%; }
}
@keyframes fade-tag-4 {
    0%, 43% { opacity: 0; transform: translate(-50%, 5px) scale(0.85); }
    45%, 52% { opacity: 1; transform: translate(-50%, 0) scale(1); }
    54%, 100% { opacity: 0; transform: translate(-50%, 5px) scale(0.85); }
}

/* Rock 5 animations */
@keyframes move-rock-5 {
    0% { left: -60px; }
    42% { border-color: transparent; box-shadow: none; }
    45% { border-color: #ff9f43; box-shadow: 0 0 8px rgba(255, 159, 67, 0.4); }
    53% { border-color: #ff9f43; box-shadow: 0 0 8px rgba(255, 159, 67, 0.4); }
    56% { border-color: transparent; box-shadow: none; }
    100% { left: 100%; }
}
@keyframes fade-tag-5 {
    0%, 43% { opacity: 0; transform: translate(-50%, 5px) scale(0.85); }
    45%, 52% { opacity: 1; transform: translate(-50%, 0) scale(1); }
    54%, 100% { opacity: 0; transform: translate(-50%, 5px) scale(0.85); }
}

/* Granulometry Histogram Chart styles */
.granulometry-histogram {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px 12px 24px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 90px;
    position: relative;
    width: 100%;
}

.hist-bar {
    width: 10%;
    background: rgba(255, 159, 67, 0.15);
    border: 1px solid rgba(255, 159, 67, 0.3);
    border-radius: 2px 2px 0 0;
    transition: height 0.3s ease;
    position: relative;
}

.hist-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: #ff9f43;
    box-shadow: 0 0 8px rgba(255, 159, 67, 0.8);
}

.hist-label {
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-family: monospace;
    font-size: 0.55rem;
    color: var(--text-dim);
}

/* 3. RTO Process Flow Layout */
.rto-simulation-layout {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.rto-pfd-grid {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    background: rgba(10, 13, 20, 0.5);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.pfd-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px 16px;
    min-width: 110px;
}

.pfd-node .node-lbl {
    font-size: 0.65rem;
    color: var(--text-dim);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.pfd-node .node-val {
    font-size: 0.85rem;
    font-family: monospace;
    font-weight: 700;
    color: #fff;
}

.pfd-node.highlight-node {
    border-color: var(--color-tertiary);
    background: rgba(0, 210, 255, 0.03);
    box-shadow: 0 0 12px rgba(0, 210, 255, 0.1);
}

.pfd-node.highlight-node .node-val {
    color: var(--color-tertiary);
}

.pfd-arrow {
    color: var(--text-dim);
    font-weight: bold;
    font-size: 1rem;
}

.rto-simulation-layout .control-panel-sim {
    height: 110px;
    padding: 12px 18px;
}

/* 4. GanaderIA Thermal Scanner */
.thermal-stream-container {
    background-color: #0b0214;
    padding-left: 48px;
}

.thermal-legend {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 25px;
    height: 70%;
    display: flex;
    gap: 8px;
    align-items: stretch;
    z-index: 10;
}

.legend-scale {
    width: 8px;
    border-radius: 4px;
    background: linear-gradient(to top, #440099 0%, #ff007f 50%, #ffff00 100%);
    border: 0.5px solid rgba(255,255,255,0.15);
}

.legend-labels {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-family: monospace;
    font-size: 0.55rem;
    color: var(--text-dim);
    line-height: 1;
    padding: 4px 0;
}

.cattle-simulation {
    position: absolute;
    width: 100%; height: 100%;
    background: linear-gradient(135deg, #0f021f 0%, #1e0338 100%);
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.cow-thermal-box {
    position: relative;
    width: 100px;
    height: 70px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.cv-target-box {
    position: absolute;
    width: 100%; height: 100%;
    border-radius: 6px;
    pointer-events: none;
    z-index: 2;
}

.border-green-cv {
    border: 1.5px solid var(--color-primary);
    background: radial-gradient(circle, rgba(0, 245, 160, 0.08) 0%, rgba(68, 0, 153, 0.45) 80%);
    box-shadow: 0 0 10px rgba(0, 245, 160, 0.15);
}

.border-red-cv {
    border: 1.5px solid var(--color-danger);
    background: radial-gradient(circle, rgba(255, 65, 54, 0.15) 0%, rgba(68, 0, 153, 0.45) 80%);
    box-shadow: 0 0 15px rgba(255, 65, 54, 0.3);
    animation: cv-alert-flash 1s infinite alternate;
}

.cow-thermal-box .temp-badge {
    position: absolute;
    top: -14px;
    background: rgba(0,0,0,0.85);
    font-size: 0.55rem;
    font-family: monospace;
    padding: 1px 4px;
    border-radius: 2px;
    color: var(--text-main);
    border: 0.5px solid var(--border-color);
    white-space: nowrap;
    z-index: 5;
}

.cow-thermal-box.cow1 { transform: translate(-10px, 10px); }
.cow-thermal-box.cow2 { transform: translate(10px, -10px); }

@keyframes cv-alert-flash {
    from { border-color: var(--color-danger); box-shadow: 0 0 10px rgba(255, 65, 54, 0.2); }
    to { border-color: #ff3333; box-shadow: 0 0 20px rgba(255, 65, 54, 0.6); }
}

/* ROI Section Interactive Calculator */
.roi-grid-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 48px;
    background: rgba(10, 13, 20, 0.6);
    box-shadow: 0 20px 50px rgba(0,0,0,0.4);
    align-items: center;
}

.roi-inputs {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.roi-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.roi-group label {
    font-size: 0.95rem;
    font-family: var(--font-heading);
    color: var(--text-main);
    font-weight: 500;
}

.roi-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 5px;
    background: var(--border-color);
    outline: none;
    transition: background 0.3s;
}

.roi-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-primary);
    cursor: pointer;
    box-shadow: 0 0 10px var(--color-primary-glow);
    transition: transform 0.1s;
}

.roi-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.roi-slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-dim);
}

.roi-select {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.95rem;
    outline: none;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.roi-select:focus {
    border-color: var(--color-secondary);
    box-shadow: 0 0 10px var(--color-secondary-glow);
}

.roi-select option {
    background-color: var(--bg-surface);
    color: #fff;
}

.roi-outputs {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.roi-out-box {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
}

.roi-out-label {
    font-size: 0.8rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.roi-out-value {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
}

.total-box {
    border-color: var(--color-primary);
    background: rgba(0, 245, 160, 0.02);
    box-shadow: inset 0 0 15px rgba(0, 245, 160, 0.05);
}

.total-box .roi-out-value {
    font-size: 2.2rem;
    text-shadow: 0 0 15px var(--color-primary-glow);
}

/* Security Section Styles */
.security-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.security-card {
    border-radius: var(--radius-lg);
    padding: 48px 36px;
    border: 1px solid var(--border-color);
    transition: var(--transition-smooth);
    background: rgba(10, 13, 20, 0.45);
}

.security-card:hover {
    transform: translateY(-4px);
    background: var(--bg-panel-hover);
}

.security-card:nth-child(1):hover { border-color: var(--color-secondary); box-shadow: 0 10px 30px rgba(0,120,212,0.08); }
.security-card:nth-child(2):hover { border-color: var(--color-primary); box-shadow: 0 10px 30px rgba(0,245,160,0.08); }
.security-card:nth-child(3):hover { border-color: var(--color-purple); box-shadow: 0 10px 30px rgba(138, 43, 226, 0.1); }

.sec-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    transition: var(--transition-smooth);
}

.sec-icon.border-green { color: var(--color-primary); }
.sec-icon.border-blue { color: var(--color-secondary); }
.sec-icon.border-purple { color: var(--color-purple); }

.security-card:hover .sec-icon.border-green { background: rgba(0, 245, 160, 0.08); border-color: var(--border-glow); }
.security-card:hover .sec-icon.border-blue { background: rgba(0, 120, 212, 0.08); border-color: var(--border-glow-secondary); }
.security-card:hover .sec-icon.border-purple { background: rgba(138, 43, 226, 0.08); border-color: rgba(138, 43, 226, 0.35); }

.security-card h4 {
    font-size: 1.25rem;
    margin-bottom: 12px;
}

.security-card p {
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.6;
}

/* Virtues Section Styles */
.virtues-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.virtue-card {
    border-radius: var(--radius-lg);
    padding: 48px 36px;
    border: 1px solid var(--border-color);
    transition: var(--transition-smooth);
    background: rgba(10, 13, 20, 0.45);
    position: relative;
    overflow: hidden;
}

.virtue-card:hover {
    transform: translateY(-4px);
    background: var(--bg-panel-hover);
}

.virtue-card:nth-child(1):hover { border-color: var(--color-secondary); box-shadow: 0 10px 30px rgba(0,120,212,0.08); }
.virtue-card:nth-child(2):hover { border-color: var(--color-primary); box-shadow: 0 10px 30px rgba(0,245,160,0.08); }
.virtue-card:nth-child(3):hover { border-color: var(--color-tertiary); box-shadow: 0 10px 30px rgba(0,210,255,0.08); }

.virtue-num {
    font-family: var(--font-heading);
    font-size: 4rem;
    font-weight: 700;
    color: rgba(255,255,255,0.02);
    position: absolute;
    top: 12px;
    right: 24px;
    line-height: 1;
    pointer-events: none;
    transition: var(--transition-smooth);
}

.virtue-card:hover .virtue-num {
    color: rgba(255,255,255,0.04);
}

.virtue-card h3 {
    font-size: 1.35rem;
    margin-bottom: 16px;
    position: relative;
    z-index: 2;
}

.virtue-card p {
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.6;
    position: relative;
    z-index: 2;
}

/* Mision Visión Styles */
.mision-vision-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.mv-block {
    border-radius: var(--radius-lg);
    padding: 48px;
    border: 1px solid var(--border-color);
    transition: var(--transition-smooth);
}

.mv-block:hover {
    transform: translateY(-4px);
}
.mv-block:first-child:hover { border-color: var(--color-primary); }
.mv-block:last-child:hover { border-color: var(--color-secondary); }

.mv-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.mv-block h3 {
    font-size: 1.7rem;
    margin-bottom: 16px;
}

.mv-block p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* FAQ Accordion Styles */
.faq-container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.faq-item {
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: var(--transition-smooth);
}

.faq-item:hover {
    border-color: var(--color-secondary);
}

.faq-trigger {
    width: 100%;
    background: none;
    border: none;
    padding: 24px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-main);
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
}

.faq-icon-state {
    font-size: 1.3rem;
    color: var(--color-secondary);
    transition: transform 0.3s;
}

.faq-item.active .faq-icon-state {
    transform: rotate(45deg);
}

.faq-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
    padding: 0 32px;
}

.faq-content p {
    padding-bottom: 24px;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Contact Section Styles */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 64px;
    align-items: center;
}

.info-details {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 32px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 1rem;
    color: var(--text-muted);
}

.contact-link:hover {
    color: var(--color-primary) !important;
}

.contact-form-container {
    border-radius: var(--radius-lg);
    padding: 48px;
    border: 1px solid var(--border-color);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.8rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.form-group input,
.form-group textarea {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 10px var(--color-primary-glow);
    background: rgba(255, 255, 255, 0.06);
}

.form-status {
    font-size: 0.85rem;
    margin-top: 8px;
    text-align: center;
}

/* Footer Styles */
.main-footer {
    background: hsl(223, 24%, 2%);
    padding: 64px 0 32px;
    border-top: 1px solid var(--border-color);
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 48px;
}

.footer-brand {
    max-width: 320px;
}

.footer-brand p {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-top: 12px;
}

.footer-links h5 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-main);
    margin-bottom: 16px;
}

.footer-links ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links ul a {
    text-decoration: none;
    color: var(--text-dim);
    font-size: 0.85rem;
    transition: var(--transition-smooth);
}

.footer-links ul a:hover {
    color: var(--color-primary);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    padding-top: 24px;
}

.footer-bottom-container {
    display: flex;
    justify-content: center;
    font-size: 0.75rem;
    color: var(--text-dim);
}

/* Animations */
@keyframes pulse {
    0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(0, 245, 160, 0.5); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(0, 245, 160, 0); }
    100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(0, 245, 160, 0); }
}

@keyframes float-node {
    0% { transform: translateY(0px) scale(1); }
    50% { transform: translateY(-15px) scale(1.1); }
    100% { transform: translateY(0px) scale(1); }
}

@keyframes bar-rise {
    from { transform: scaleY(0); }
    to { transform: scaleY(1); }
}

@keyframes float-bubble {
    0% { transform: translateY(120px) scale(0.8); opacity: 0; }
    10% { opacity: 0.7; }
    90% { opacity: 0.5; }
    100% { transform: translateY(-30px) scale(1); opacity: 0; }
}

@keyframes rotate-mill {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 64px;
        text-align: center;
    }
    .hero-subtitle {
        margin-left: auto;
        margin-right: auto;
    }
    .hero-actions {
        justify-content: center;
    }
    .hero-stats {
        justify-content: center;
    }
    .hero-visual {
        max-width: 550px;
        margin: 0 auto;
    }
    .process-grid {
        grid-template-columns: 1fr;
        gap: 48px;
    }
    .process-image-area {
        max-width: 550px;
        margin: 0 auto;
        width: 100%;
    }
    .tech-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    #tech-vision, #tech-molienda, #tech-rto, #tech-edge, #tech-ganaderia, #tech-termografia, #tech-cercas, #tech-registro, #tech-instrumentos, #tech-soporte, #tech-comederos, #tech-soporte-minero {
        grid-column: span 1;
    }
    .roi-grid-container {
        grid-template-columns: 1fr;
        gap: 36px;
        padding: 32px 24px;
    }
    .security-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .virtues-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .dashboard-shell {
        grid-template-columns: 200px 1fr;
    }
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 48px;
    }
}

@media (max-width: 768px) {
    section {
        padding: 64px 0;
    }
    .section-title {
        font-size: 2rem;
    }
    .hero-title {
        font-size: 2.5rem;
    }
    .nav-menu {
        display: none;
    }
    .mobile-menu-toggle {
        display: flex;
    }
    .problem-grid {
        grid-template-columns: 1fr;
    }
    .tech-grid {
        grid-template-columns: 1fr;
    }
    .dashboard-shell {
        grid-template-columns: 1fr;
        height: auto;
    }
    .dashboard-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 16px 0;
    }
    .dashboard-tabs {
        flex-direction: row;
        overflow-x: auto;
        padding: 0 16px;
        gap: 4px;
    }
    .tab-item {
        white-space: nowrap;
        padding: 10px 16px;
        border-left: none;
        border-bottom: 2px solid transparent;
    }
    .tab-item.active {
        border-bottom-color: var(--color-primary);
    }
    .tab-item[data-tab="tab-molienda"].active { border-bottom-color: var(--color-secondary); }
    .tab-item[data-tab="tab-grain"].active { border-bottom-color: #ff9f43; }
    .tab-item[data-tab="tab-rto"].active { border-bottom-color: var(--color-secondary); }
    .tab-item[data-tab="tab-ganaderia"].active { border-bottom-color: var(--color-purple); }
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    .visual-feed {
        grid-template-columns: 1fr;
    }
    .footer-container {
        flex-direction: column;
        gap: 32px;
    }
}

/* ==========================================================================
   ENHANCED VISUAL POLISH & ANIMATIONS v2.0
   ========================================================================== */

/* --- Scroll Reveal Animation System --- */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-60px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-left.revealed {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(60px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-right.revealed {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-scale.revealed {
    opacity: 1;
    transform: scale(1);
}

/* Stagger delay utilities */
.stagger-1 { transition-delay: 0.05s; }
.stagger-2 { transition-delay: 0.12s; }
.stagger-3 { transition-delay: 0.2s; }
.stagger-4 { transition-delay: 0.28s; }
.stagger-5 { transition-delay: 0.36s; }

/* --- Animated Gradient Text Shimmer --- */
@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.text-gradient-animated {
    background: linear-gradient(135deg, 
        var(--color-primary) 0%, 
        var(--color-tertiary) 25%, 
        var(--color-secondary) 50%, 
        var(--color-primary) 75%, 
        var(--color-tertiary) 100%);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 6s ease infinite;
}

/* --- Floating Ambient Particles Canvas --- */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -5;
    pointer-events: none;
    opacity: 0.5;
}

/* --- Enhanced Background Glow Animations --- */
@keyframes glow-drift-1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(50px, -30px) scale(1.1); }
    50% { transform: translate(-20px, 40px) scale(0.95); }
    75% { transform: translate(30px, 20px) scale(1.05); }
}

@keyframes glow-drift-2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-40px, 50px) scale(1.15); }
    66% { transform: translate(60px, -20px) scale(0.9); }
}

@keyframes glow-drift-3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(40px, -40px) scale(1.1); }
}

.bg-glow-1 {
    animation: glow-drift-1 20s ease-in-out infinite;
}

.bg-glow-2 {
    animation: glow-drift-2 25s ease-in-out infinite;
}

.bg-glow-3 {
    animation: glow-drift-3 18s ease-in-out infinite;
}

/* --- Enhanced Nav Link Underline Animation --- */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-tertiary));
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1), left 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 2px;
}

.nav-link:hover::after,
.nav-link.active-section::after {
    width: 100%;
    left: 0;
}

.nav-link.active-section {
    color: var(--color-primary);
}

/* --- Enhanced Button Hover Micro-animations --- */
.btn-primary {
    background-size: 200% 200%;
    background-image: linear-gradient(135deg, 
        var(--color-primary) 0%, 
        var(--color-secondary) 50%, 
        var(--color-primary) 100%);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary:hover {
    background-position: 100% 0;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px 0 var(--color-primary-glow),
               0 0 40px -10px var(--color-primary-glow);
}

.btn-primary:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px 0 var(--color-primary-glow);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--color-primary);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px -5px rgba(0, 245, 160, 0.15);
}

/* --- Enhanced Stat Number Glow --- */
.stat-number {
    transition: text-shadow 0.4s ease;
}

.stat-item:hover .stat-number {
    text-shadow: 0 0 20px var(--color-primary-glow);
}

.stat-item {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.stat-item:hover {
    transform: translateY(-2px);
}

/* --- Enhanced Process Steps --- */
.process-step {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 16px;
    border-radius: var(--radius-md);
    margin: -16px;
}

.process-step:hover {
    transform: translateX(8px);
    background: rgba(255, 255, 255, 0.01);
}

.step-number-glow {
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.process-step:hover .step-number-glow {
    transform: scale(1.12);
    box-shadow: 0 0 25px rgba(0, 120, 212, 0.35);
}

.process-step:nth-child(odd):hover .step-number-glow {
    box-shadow: 0 0 25px rgba(0, 245, 160, 0.35);
}

/* --- Enhanced Tech Card Hover --- */
.tech-card {
    will-change: transform, background;
}

.tech-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 40%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.03), transparent);
    transition: none;
    pointer-events: none;
}

.tech-card:hover::before {
    animation: card-shimmer 0.8s ease forwards;
}

@keyframes card-shimmer {
    0% { left: -100%; }
    100% { left: 200%; }
}

.tech-card:hover .tech-icon-wrapper {
    transform: scale(1.1) rotate(5deg);
}

.tech-icon-wrapper {
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Enhanced Dashboard Shell --- */
.dashboard-shell {
    transition: box-shadow 0.5s ease;
}

.dashboard-shell:hover {
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7),
               0 0 40px rgba(0, 245, 160, 0.04);
}

.tab-item {
    position: relative;
    overflow: hidden;
}

.tab-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.02), transparent);
    pointer-events: none;
}

.tab-item:hover::before {
    animation: tab-shimmer 0.6s ease forwards;
}

@keyframes tab-shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.tab-content {
    animation: none;
}

.tab-content.active {
    animation: tab-fade-in 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes tab-fade-in {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* --- Enhanced Metric Boxes --- */
.metric-box {
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.metric-box::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.metric-box:hover {
    background: rgba(255, 255, 255, 0.04);
    transform: translateY(-2px);
    border-color: var(--color-primary);
}

.metric-box:hover::after {
    transform: scaleX(1);
}

/* --- Enhanced Security Cards --- */
.security-card {
    position: relative;
    overflow: hidden;
}

.security-card::after {
    content: '';
    position: absolute;
    top: -2px;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--color-secondary), transparent);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.security-card:hover::after {
    opacity: 1;
}

.security-card:nth-child(2)::after {
    background: linear-gradient(90deg, transparent, var(--color-primary), transparent);
}

.security-card:nth-child(3)::after {
    background: linear-gradient(90deg, transparent, var(--color-purple), transparent);
}

/* --- Enhanced Virtue Cards --- */
.virtue-card::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0;
    background: linear-gradient(to top, rgba(0, 120, 212, 0.03), transparent);
    transition: height 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    z-index: 1;
}

.virtue-card:hover::before {
    height: 100%;
}

.virtue-card:nth-child(2)::before {
    background: linear-gradient(to top, rgba(0, 245, 160, 0.03), transparent);
}

.virtue-card:nth-child(3)::before {
    background: linear-gradient(to top, rgba(0, 210, 255, 0.03), transparent);
}

.virtue-num {
    font-size: 5rem;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.virtue-card:hover .virtue-num {
    color: rgba(255,255,255,0.06);
    transform: scale(1.15);
}

/* --- Enhanced MV Blocks --- */
.mv-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-tertiary));
    opacity: 0;
    transition: opacity 0.5s ease;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.mv-block {
    position: relative;
    overflow: hidden;
}

.mv-block:hover::before {
    opacity: 1;
}

.mv-block:last-child::before {
    background: linear-gradient(90deg, var(--color-secondary), var(--color-purple));
}

/* --- Enhanced FAQ Accordion --- */
.faq-item {
    position: relative;
}

.faq-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(to bottom, var(--color-secondary), var(--color-tertiary));
    opacity: 0;
    transition: opacity 0.4s ease;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.faq-item.active::before,
.faq-item:hover::before {
    opacity: 1;
}

.faq-trigger {
    transition: all 0.3s ease;
}

.faq-trigger:hover {
    padding-left: 38px;
}

/* --- Enhanced ROI Calculator --- */
.roi-out-box {
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.roi-out-box:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--border-glow);
}

.total-box:hover {
    box-shadow: inset 0 0 25px rgba(0, 245, 160, 0.08),
               0 10px 30px rgba(0, 245, 160, 0.1);
}

.roi-slider {
    background: linear-gradient(to right, var(--color-primary), var(--color-secondary));
    background-size: 0% 100%;
    background-repeat: no-repeat;
}

/* --- Enhanced Contact Form --- */
.form-group input,
.form-group textarea {
    position: relative;
}

.form-group input:hover,
.form-group textarea:hover {
    border-color: var(--text-dim);
    background: rgba(255, 255, 255, 0.04);
}

/* --- Enhanced Footer --- */
.footer-links ul a {
    position: relative;
}

.footer-links ul a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--color-primary);
    transition: width 0.3s ease;
}

.footer-links ul a:hover::after {
    width: 100%;
}

/* --- Loading Screen Overlay --- */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-base);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-hexagon {
    width: 60px;
    height: 60px;
    position: relative;
    animation: loader-pulse 1.4s ease-in-out infinite;
}

.loader-hexagon svg {
    width: 100%;
    height: 100%;
}

.loader-hexagon svg path {
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    animation: loader-draw 1.8s ease-in-out infinite;
}

@keyframes loader-draw {
    0% { stroke-dashoffset: 300; }
    50% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: -300; }
}

@keyframes loader-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.loader-text {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-top: 24px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    animation: loader-text-fade 1.4s ease-in-out infinite;
}

@keyframes loader-text-fade {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* --- Smooth scroll indicator for hero --- */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0.5;
    animation: scroll-bounce 2s ease-in-out infinite;
}

.scroll-indicator-line {
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, var(--color-primary), transparent);
}

.scroll-indicator-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-primary);
    animation: scroll-dot 2s ease-in-out infinite;
}

@keyframes scroll-bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(8px); }
}

@keyframes scroll-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* --- Cursor follower glow --- */
.cursor-glow {
    position: fixed;
    width: 350px;
    height: 350px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 245, 160, 0.04) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
    transition: transform 0.15s ease-out;
    will-change: transform;
}

/* --- Image wrapper enhanced parallax tilt --- */
.image-wrapper {
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.image-wrapper:hover {
    box-shadow: 0 25px 60px rgba(0,0,0,0.6),
               0 0 30px rgba(0, 245, 160, 0.05);
}

/* --- Console typing animation --- */
.console-line {
    animation: console-line-appear 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

@keyframes console-line-appear {
    0% { opacity: 0; transform: translateY(5px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* --- Acoustic spectrum enhanced colors --- */
.spec-bar {
    transition: height 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.spec-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--color-secondary);
    border-radius: 2px;
    box-shadow: 0 0 8px var(--color-secondary-glow);
}

/* --- ROI value change animation --- */
@keyframes value-pop {
    0% { transform: scale(1); }
    40% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.roi-out-value.updating {
    animation: value-pop 0.4s ease;
}

/* --- Responsive override: disable heavy animations on mobile --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    .reveal, .reveal-left, .reveal-right, .reveal-scale {
        opacity: 1;
        transform: none;
    }
}

/* --- Premium Mobile Enhancements & Layout Fixes --- */

/* Base fade-in for backdrop overlay */
@keyframes fadeInOverlay {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (max-width: 768px) {
    .cursor-glow { display: none; }
    #particle-canvas { opacity: 0.25; }
    .scroll-indicator { display: none; }
    
    /* Header layout fixes */
    #header-cta-btn {
        display: none;
    }
    .header-container {
        padding: 12px 16px;
    }

    /* Hero section stats overflow fix */
    .hero-stats {
        display: grid;
        grid-template-columns: 1fr;
        gap: 24px;
        text-align: center;
        justify-content: center;
        padding-top: 24px;
        border-top: 1px solid var(--border-color);
    }
    .stat-item {
        align-items: center;
    }

    /* RTO dashboard workflow overflow fix */
    .rto-pfd-grid {
        flex-direction: column;
        gap: 12px;
        padding: 16px;
        width: 100%;
    }
    .rto-pfd-grid .pfd-arrow {
        transform: rotate(90deg);
        margin: 4px 0;
    }

    /* Dashboard mobile polish */
    .dashboard-main {
        padding: 20px 16px;
    }
    .dashboard-tabs::-webkit-scrollbar {
        display: none;
    }
    .dashboard-tabs {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    /* Form mobile padding polish */
    .contact-form-container {
        padding: 24px 16px;
    }

    /* Mission & Vision layout fix */
    .mision-vision-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .mv-block {
        padding: 24px 20px;
    }

    /* Premium mobile drawer backdrop & scroll lock */
    body.mobile-nav-open {
        overflow: hidden;
    }
    body.mobile-nav-open::after {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(5, 7, 10, 0.65);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 998;
        animation: fadeInOverlay 0.3s ease;
    }
}

@media (max-width: 480px) {
    /* Hero CTA wrapping overflow fix */
    .hero-actions {
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }
    .hero-actions .btn {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    /* Hero title font size scale */
    .hero-title {
        font-size: 2.1rem;
    }

    .section-title {
        font-size: 1.65rem;
    }

    .section-subtitle {
        margin-bottom: 32px;
        font-size: 0.9rem;
    }

    /* Badge size adjustments */
    .badge-text {
        font-size: 0.7rem;
    }

    /* Process steps sizing fixes */
    .process-step {
        gap: 16px;
    }
    .step-number-glow {
        width: 40px;
        height: 40px;
        min-width: 40px;
        font-size: 1.1rem;
    }

    /* Dashboard Mill drum overflow scale fix */
    .mill-visual-wrapper {
        transform: scale(0.75);
    }

    /* Dashboard Conveyor belt scale fix */
    .conveyor-belt-track {
        height: 10px;
        bottom: 15%;
    }
    .belt-rock {
        bottom: 17%;
        transform: scale(0.8);
    }

    /* Dashboard Thermal scanner overflow scale fix */
    .thermal-stream-container {
        padding-left: 36px;
    }
    .thermal-legend {
        left: 6px;
        height: 80%;
    }
    .cow-thermal-box {
        width: 80px;
        height: 55px;
    }
    .cow-thermal-box .temp-badge {
        font-size: 0.5rem;
        top: -12px;
    }

    /* ROI panel padding polish */
    .roi-grid-container {
        padding: 24px 16px;
    }
}
