.boton-inscripcion-text {
    color: white;
}

/* Home-specific Video and Main Content */
.main-content {
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    z-index: 0;
}

/* Video a pantalla completa (specific for background pages) */
.main-content video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
}

/* Itineraries Section (Stripe Connect-inspired) */
.itineraries-section {
    background-color: #ffffff;
    padding: 100px 20px;
    color: var(--heading-color);
    position: relative;
}

.section-container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    font-size: 40px;
    font-weight: 700;
    margin-bottom: 60px;
    letter-spacing: -1px;
    text-align: center;
}

.itineraries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    position: relative;
}

/* SVG connecting paths */
.connection-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.connection-path {
    fill: none;
    stroke: rgba(var(--primary-green-rgb), 0.2);
    stroke-width: 2;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawPath 2s ease-out forwards;
    animation-delay: 0.5s;
}

@keyframes drawPath {
    to {
        stroke-dashoffset: 0;
    }
}

/* Card container */
.itinerary-card {
    position: relative;
    background: #f8f9fa;
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 30px;
    cursor: pointer;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    z-index: 1;
    min-height: 350px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.itinerary-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 4px;
    background: var(--primary-green);
    transition: width 0.6s ease;
    z-index: 5;
}

.itinerary-card:hover .itinerary-line {
    width: 100%;
}

.itinerary-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.12);
    border-color: rgba(var(--primary-green-rgb), 0.3);
    z-index: 10;
}

/* Focus Mode: Dim other cards when one is hovered */
.itineraries-grid:has(.itinerary-card:hover) .itinerary-card:not(:hover) {
    opacity: 0.4;
    filter: blur(2px) grayscale(50%);
    transform: scale(0.95);
}

/* Icon container that morphs */
.icon-morph {
    width: 60px;
    height: 60px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(var(--primary-green-rgb), 0.1), rgba(13, 169, 255, 0.1));
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.itinerary-card:hover .icon-morph {
    width: 100%;
    height: 200px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(var(--primary-green-rgb), 0.05), rgba(13, 169, 255, 0.05));
}

.icon-svg {
    width: 32px;
    height: 32px;
    stroke: rgb(0, 164, 67);
    stroke-width: 2;
    fill: none;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.itinerary-card:hover .icon-svg {
    opacity: 0.2;
    transform: scale(3);
}

/* Expanded UI elements */
.expanded-ui {
    position: absolute;
    top: 30px;
    left: 30px;
    right: 30px;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.itinerary-card:hover .expanded-ui {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition-delay: 0.2s;
}

.ui-terminal {
    background: #1a1a1a;
    border-radius: 8px;
    padding: 12px;
    margin: 10px 0;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: #00ff00;
    height: 80px;
    overflow: hidden;
}

.ui-graph {
    height: 60px;
    background: linear-gradient(to right, rgba(var(--primary-green-rgb), 0.1) 0%, rgba(13, 169, 255, 0.2) 100%);
    border-radius: 6px;
    margin: 10px 0;
    position: relative;
    overflow: hidden;
}

.ui-graph::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: rgba(var(--primary-green-rgb), 0.3);
    clip-path: polygon(0 70%, 20% 50%, 40% 60%, 60% 30%, 80% 40%, 100% 20%, 100% 100%, 0 100%);
}

.ui-metrics {
    display: flex;
    gap: 10px;
    margin: 10px 0;
}

.ui-metric {
    flex: 1;
    background: rgba(var(--primary-green-rgb), 0.1);
    border-radius: 6px;
    padding: 8px;
    font-size: 10px;
    text-align: center;
}

.ui-metric-value {
    font-size: 16px;
    font-weight: 700;
    color: rgb(0, 164, 67);
}

.ui-progress {
    height: 6px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
    overflow: hidden;
    margin: 10px 0;
}

.ui-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, rgb(0, 164, 67), rgba(13, 169, 255));
    border-radius: 3px;
    animation: progressGrow 2s ease-out;
}

@keyframes progressGrow {
    from {
        width: 0;
    }
}

.ui-alert {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    margin: 5px;
    font-weight: 600;
}

.ui-alert.success {
    background: rgba(var(--primary-green-rgb), 0.2);
    color: rgb(0, 100, 40);
}

.ui-alert.warning {
    background: rgba(255, 156, 26, 0.2);
    color: rgb(200, 100, 0);
}

.itinerary-title {
    font-size: 22px;
    font-weight: 700;
    margin: 20px 0 10px;
    color: var(--heading-color);
    transition: opacity 0.3s;
    position: relative;
    z-index: 2;
}

.itinerary-card:hover .itinerary-title {
    opacity: 0.4;
    color: white;
    transform: translateY(-5px);
}

.itinerary-desc {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-color);
    margin: 0;
    transition: all 0.4s ease;
    position: relative;
    z-index: 2;
}

.itinerary-card:hover .itinerary-desc {
    opacity: 0.3;
    color: rgba(255, 255, 255, 0.9);
    transform: translateY(-5px);
}

/* Collaborators Section (Infinite Ticker) */
.collaborators-section {
    background-color: #ffffff;
    padding: 60px 0;
    overflow: hidden;
    border-top: 1px solid #e6ebf1;
}

.ticker-wrap {
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
}



.ticker-wrap::before,
.ticker-wrap::after {
    content: "";
    position: absolute;
    top: 0;
    width: 100px;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.ticker-wrap::before {
    left: 0;
    background: linear-gradient(to right, white, transparent);
}

.ticker-wrap::after {
    right: 0;
    background: linear-gradient(to left, white, transparent);
}

.ticker {
    display: inline-block;
    animation: ticker 30s linear infinite;
}

.ticker-item {
    display: inline-block;
    padding: 0 40px;
    vertical-align: middle;
}

.ticker-item img {
    height: 40px;
    width: auto;
    transition: opacity 0.3s, filter 0.3s;
}

.ticker-item img:hover {
    opacity: 1;
    filter: grayscale(0%);
}


.ticker-wrap-unique {
    display: flex;
    align-items: center;
    vertical-align: middle;
    align-content: center;
    justify-content: center;
}

.ticker-item-unique {
    display: flex;
    align-items: center;
    align-content: center;
    vertical-align: middle;
    justify-content: center;
    padding-left: 20px;
    padding-right: 20px;
    font-size: 24px;
    font-weight: 600;
    color: var(--heading-color);
}

.ticker-item-unique img {
    width: 120px;
    height: auto;
    transition: opacity 0.3s, filter 0.3s;
}

#ticker-item-unique-ciic img {
    width: 80px;
    height: auto;
}

/* Animations for Expanded UI */
.typewriter-line {
    overflow: hidden;
    white-space: nowrap;
    margin: 0;
    width: 0;
    border-right: 2px solid transparent;
    font-family: 'Courier New', monospace;
}

.itinerary-card:hover .typewriter-line {
    animation: typing 1.5s steps(30, end) forwards, blink-caret .75s step-end infinite;
}

.itinerary-card:hover .typewriter-line:nth-child(1) {
    animation-delay: 0.2s;
}

.itinerary-card:hover .typewriter-line:nth-child(2) {
    animation-delay: 1.0s;
}

.itinerary-card:hover .typewriter-line:nth-child(3) {
    animation-delay: 1.8s;
}

.itinerary-card:hover .typewriter-line:nth-child(4) {
    animation-delay: 2.6s;
}

.itinerary-card:hover .typewriter-line:nth-child(5) {
    animation-delay: 3.4s;
}

@keyframes typing {
    from {
        width: 0
    }

    to {
        width: 100%;
        border-color: transparent
    }
}

@keyframes blink-caret {

    from,
    to {
        border-color: transparent
    }

    50% {
        border-color: #00ff00;
    }
}

.graph-line {
    fill: none;
    stroke: var(--primary-blue);
    stroke-width: 2;
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
}

.itinerary-card:hover .graph-line {
    animation: drawGraph 2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    animation-delay: 0.5s;
}

@keyframes drawGraph {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes pulse-soft {

    0%,
    100% {
        opacity: 0.8;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

.pulse-item {
    display: inline-block;
}

.itinerary-card:hover .pulse-item {
    animation: pulse-soft 2s infinite ease-in-out;
}

.bar-grow {
    transform: scaleX(0);
    transform-origin: left;
}

.itinerary-card:hover .bar-grow {
    animation: growX 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    animation-delay: 0.3s;
}

@keyframes growX {
    to {
        transform: scaleX(1);
    }
}

@keyframes spin-slow {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.spin-icon {
    transform-origin: center;
}

.itinerary-card:hover .spin-icon {
    animation: spin-slow 4s linear infinite;
}

@keyframes blink-node {

    0%,
    100% {
        opacity: 0.3;
        r: 1.5;
    }

    50% {
        opacity: 1;
        r: 2.5;
        fill: #fff;
    }
}

.node-point {
    fill: rgba(255, 255, 255, 0.8);
}

.itinerary-card:hover .node-point {
    animation: blink-node 1.5s infinite ease-in-out;
}

.node-p1 {
    animation-delay: 0s;
}

.node-p2 {
    animation-delay: 0.3s;
}

.node-p3 {
    animation-delay: 0.6s;
}

.node-p4 {
    animation-delay: 0.9s;
}

@keyframes ticker {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* Helper Classes from Inline Styles migration */
.itinerary-ia,
.itinerary-ciber,
.itinerary-industria,
.itinerary-smartgrids {
    text-decoration: none;
    color: inherit;
    display: block;
}

.bold {
    font-weight: bold;
}

.bg-green {
    background: #00ff00 !important;
}

.bg-green-soft {
    background: rgba(var(--primary-green-rgb), 0.1) !important;
}

.bg-orange-soft {
    background: rgba(255, 156, 26, 0.1) !important;
}

.text-orange {
    color: var(--primary-orange) !important;
}

.text-red {
    color: #ff3333 !important;
}

.text-green {
    color: #00ff00 !important;
}

.text-green-stable {
    color: rgb(0, 164, 67) !important;
}

.text-blue {
    color: var(--primary-blue) !important;
}

.ui-margin-top {
    margin-top: 15px;
}

/* IA Specifics */
.ui-terminal-ia {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ui-graph-ia {
    background: rgba(0, 0, 0, 0.02);
}

.graph-line-blue {
    stroke: var(--primary-blue);
    stroke-width: 2;
    fill: none;
}

.metric-row {
    font-size: 10px;
    color: #424242;
}

.metric-value-blue {
    font-weight: bold;
    color: var(--primary-blue);
}

/* Ciber Specifics */
.ui-alert-container {
    display: flex;
    gap: 5px;
    margin: 10px 0;
}

.delay-alert {
    animation-delay: 0.5s;
}

.ui-terminal-ciber {
    height: auto;
    padding: 10px;
}

.integrity-text {
    font-size: 9px;
    margin-top: 4px;
    color: #666;
    text-align: right;
}

/* Industria Specifics */
.bar-orange-1 {
    fill: var(--primary-orange);
    opacity: 0.5;
    animation-delay: 0.2s;
}

.bar-orange-2 {
    fill: var(--primary-orange);
    opacity: 0.6;
    animation-delay: 0.4s;
}

.bar-orange-3 {
    fill: var(--primary-orange);
    opacity: 0.7;
    animation-delay: 0.6s;
}

.bar-orange-4 {
    fill: var(--primary-orange);
    opacity: 0.8;
    animation-delay: 0.8s;
}

.bar-orange-5 {
    fill: var(--primary-orange);
    opacity: 0.9;
    animation-delay: 1.0s;
}

.bar-orange-6 {
    fill: var(--primary-orange);
    opacity: 1.0;
    animation-delay: 1.2s;
}

/* Smartgrids Specifics */
.ui-graph-smartgrids {
    background: #0d2b3e;
    position: relative;
}

.energy-flow {
    fill: none;
    stroke: #00ff00;
    stroke-width: 1.5;
    stroke-dasharray: 5, 5;
    animation: drawGraph 3s linear infinite;
}

/* Connection Delays */
.conn-delay-1 {
    animation-delay: 0.5s;
}

.conn-delay-2 {
    animation-delay: 0.8s;
}

.conn-delay-3 {
    animation-delay: 1.1s;
}

/* =========================================
   RESPONSIVE STYLES FOR HOMEPAGE
   ========================================= */

@media (max-width: 1024px) {

    /* Itineraries Grid - 2 columns on tablet */
    .itineraries-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }

    .itinerary-card {
        min-height: 320px;
    }

    /* Simplify hover effects */
    .itinerary-card:hover {
        transform: translateY(-6px) scale(1.01);
    }
}

@media (max-width: 768px) {

    /* ===== HERO SECTION ===== */
    .main-content {
        height: 70vh;
        min-height: 500px;
    }

    .main-content video {
        object-fit: cover;
    }

    /* ===== ITINERARIES SECTION ===== */
    .itineraries-section {
        padding: 60px 15px;
    }

    .section-title {
        font-size: 32px !important;
        margin-bottom: 40px;
    }

    .itineraries-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .itinerary-card {
        min-height: 280px;
        padding: 25px;
    }

    /* Simplify to basic hover on mobile */
    .itinerary-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    }

    /* Hide complex expanded UI on mobile for performance */
    .expanded-ui,
    .ui-terminal,
    .ui-graph,
    .ui-metrics,
    .ui-progress,
    .ui-alert {
        display: none !important;
    }

    /* Keep basic content visible */
    .itinerary-card:hover .itinerary-title {
        opacity: 1;
        color: var(--heading-color);
        transform: none;
    }

    .itinerary-card:hover .itinerary-desc {
        opacity: 1;
        color: var(--text-color);
        transform: none;
    }

    /* Icon morphing simplified */
    .icon-morph {
        width: 50px;
        height: 50px;
        margin-bottom: 15px;
    }

    .itinerary-card:hover .icon-morph {
        width: 50px;
        height: 50px;
    }

    .icon-svg {
        width: 28px;
        height: 28px;
    }

    .itinerary-card:hover .icon-svg {
        opacity: 1;
        transform: scale(1.1);
    }

    .itinerary-title {
        font-size: 20px;
        margin: 15px 0 8px;
    }

    .itinerary-desc {
        font-size: 14px;
    }

    /* Disable focus mode dimming on mobile */
    .itineraries-grid:has(.itinerary-card:hover) .itinerary-card:not(:hover) {
        opacity: 1;
        filter: none;
        transform: none;
    }

    /* Hide connection SVG on mobile */
    .connection-svg {
        display: none;
    }

    /* ===== COLLABORATORS TICKER ===== */
    .collaborators-section {
        padding: 40px 0;
    }

    .ticker-item {
        padding: 0 25px;
    }

    .ticker-item img {
        height: 30px;
    }

    .ticker-item-unique {
        padding: 0 10px;
    }

    .ticker-item-unique img {
        height: auto;
        width: 100px;
    }

    #ticker-item-unique-ciic {
        padding: 0 20px;
    }

    #ticker-item-unique-ciic img {
        height: auto;
        width: 70px;
    }

    /* Speed up ticker animation on mobile */
    .ticker {
        animation-duration: 20s;
    }
}

@media (max-width: 425px) {

    /* Extra small devices */
    .main-content {
        height: 60vh;
        min-height: 400px;
    }

    .itineraries-section {
        padding: 40px 15px;
    }

    .section-title {
        font-size: 28px !important;
        margin-bottom: 30px;
    }

    .itinerary-card {
        min-height: 250px;
        padding: 20px;
    }

    .icon-morph {
        width: 45px;
        height: 45px;
    }

    .icon-svg {
        width: 24px;
        height: 24px;
    }

    .itinerary-title {
        font-size: 18px;
    }

    .itinerary-desc {
        font-size: 13px;
        line-height: 1.5;
    }

    .ticker-item img {
        height: 25px;
    }

    .ticker-item-unique img {
        height: auto;
        width: 100px;
    }
}