:root {
    --nu-purple: #820AD1;
    --nu-dark-purple: #61079E;
    --background-color: #f0f0f7;
    --text-color: #111111;
    --card-background: #ffffff;
    --footer-text: #666;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Lato', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

.main-header {
    background-color: var(--card-background);
    padding: 1rem 2rem;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.main-header .logo {
    display: flex;
    align-items: center;
}

.main-header nav a {
    color: var(--nu-purple);
    text-decoration: none;
    font-weight: 700;
    margin-right: 1.5rem;
    transition: color 0.3s ease;
}

.main-header nav a:hover {
    color: var(--nu-dark-purple);
}

main {
    padding-top: 80px; /* Adjust based on header height */
}

.content-section {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4rem 2rem;
}

.card {
    background-color: var(--card-background);
    padding: 3rem;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
    max-width: 800px;
    width: 100%;
}

.section-supertitle {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--nu-purple);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.card h1 {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 1.5rem;
}

.card p {
    font-size: 1.1rem;
}

.info-section {
    margin-top: 2.5rem;
}

.info-section h2 {
    font-size: 1.8rem;
    font-weight: 900;
    margin-bottom: 1rem;
    border-bottom: 3px solid var(--nu-purple);
    padding-bottom: 0.5rem;
    display: inline-block;
}

.info-section ul {
    list-style: none;
    padding-left: 0;
}

.info-section ul li {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
}

.info-section ul li::before {
    content: '✓';
    color: var(--nu-purple);
    position: absolute;
    left: 0;
    font-weight: bold;
}

.columns-container {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    margin-top: 1rem;
}

.column {
    flex: 1;
}

.column h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.founder {
    text-align: center;
}

.founder-image {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1rem;
    border: 4px solid var(--background-color);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* --- Timeline Styles --- */
.timeline-container {
    position: relative;
    display: flex;
    justify-content: space-between;
    padding: 2rem 0;
    margin-top: 1rem;
}

.timeline-container::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: var(--background-color);
    transform: translateY(-50%);
    z-index: 1;
}

.timeline-event {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

.timeline-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: var(--background-color);
    border: 4px solid var(--nu-purple);
    transition: background-color 0.3s ease;
}

.timeline-event:hover .timeline-dot {
    background-color: var(--nu-dark-purple);
}

.timeline-year {
    margin-top: 1rem;
    font-weight: 700;
}

.timeline-tooltip {
    position: absolute;
    top: 160%; /* Position below the event */
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--nu-dark-purple);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    width: 200px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.timeline-event.active .timeline-tooltip {
    opacity: 1;
    visibility: visible;
}

.timeline-tooltip::after {
    content: '';
    position: absolute;
    bottom: 100%; /* Arrow at the top of the tooltip */
    left: 50%;
    transform: translateX(-50%);
    border-width: 8px;
    border-style: solid;
    border-color: transparent transparent var(--nu-dark-purple) transparent; /* Points up */
}

/* --- Panorama Section Styles --- */

/* Horizontal Bar Chart */
.bar-chart-container {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-top: 1.5rem;
}

.bar-item {
    display: grid;
    grid-template-columns: 125px 1fr; /* Fixed label column, flexible bar column */
    align-items: center;
    gap: 1rem;
}

.bar-label {
    text-align: right;
    font-weight: 700;
}

.bar {
    height: 2.5rem;
    background-color: var(--background-color);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: flex-start; /* Align text to the left */
    padding-left: 1rem;
    color: var(--text-color);
    font-weight: 700;
    animation: growBar 1s ease-out forwards;
    transform-origin: left;
}

.nu-bar {
    background-color: var(--nu-purple);
}

.bar-value {
    opacity: 0;
    animation: fadeIn 0.5s 0.8s ease-in forwards;
    white-space: nowrap;
}

@keyframes growBar {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Country Stats */
.country-stat {
    text-align: center;
}

.flag-image {
    width: 100px;
    height: 70px; /* Fixed height for alignment */
    object-fit: cover; /* Prevents image distortion */
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
}

.stat-number {
    font-size: 4.2rem; /* Increased size again for more impact */
    font-weight: 900;
    color: var(--nu-purple);
}

/* Donut Charts */
.impact-item {
    text-align: center;
}

.donut-chart {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background-image: conic-gradient(var(--nu-purple) 0% var(--percentage), var(--background-color) var(--percentage) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 1.5rem auto;
    position: relative;
}

.donut-chart::before { /* The hole in the middle */
    content: '';
    position: absolute;
    width: 70%;
    height: 70%;
    background: var(--card-background);
    border-radius: 50%;
}

.donut-label {
    position: relative;
    font-size: 1.8rem;
    font-weight: 900;
}

.impact-item p {
    max-width: 200px;
    margin: 0 auto;
}

/* Text Sections */
.text-section p,
.text-section li {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    line-height: 1.7;
}

.text-section ul {
    list-style: none;
    padding: 0;
}

.text-section strong {
    color: var(--nu-purple);
}

/* --- Modelo Section Styles --- */

/* New Product Section */
.product-item-detailed {
    display: flex;
    gap: 2.5rem;
    align-items: center;
    margin-top: 2.5rem;
}

/* Alternating layout */
.product-item-detailed:nth-child(even) {
    flex-direction: row-reverse;
}

.product-item-image {
    flex: 1;
    max-width: 400px;
}

.product-item-image img {
    width: 100%;
    height: auto; /* Maintains aspect ratio */
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.product-item-text {
    flex: 1.2;
}

.product-item-text h3 {
    color: var(--nu-purple);
    font-size: 1.8rem;
    font-weight: 900;
    margin-bottom: 1rem;
}

.product-item-text p {
    margin-bottom: 1rem;
}


/* Oxxo Section */
.oxxo-section {
    display: flex;
    align-items: center;
    gap: 4rem;
    /* margin-top is removed to allow default element spacing */
}

.oxxo-text {
    flex: 1.5; /* Make text column narrower to increase space from image */
}

.oxxo-image {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 2rem 0 0 0; /* User request: 2rem top margin, no other margins */
}

/* --- Liderazgo Section Styles --- */

/* Values Section */
.values-section {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-top: 1.5rem;
}
.values-text { flex: 1.5; }
.values-text ul {
    list-style-position: inside;
    padding-left: 0.5rem;
}
.values-image { flex: 1; }
.values-image img {
    width: 100%;
    border-radius: 12px;
}

/* Q&A List */
.qa-list {
    list-style: none;
    padding: 0;
    margin-top: 1.5rem;
}
.qa-list li {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    position: relative;
}
.qa-list li::before {
    content: '»';
    color: var(--nu-purple);
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* Managerial Grid Refactor V2 */
.managerial-grid-wrapper {
    display: grid;
    grid-template-areas:
        "ytitle ylabels grid"
        ". . xlabels"
        ". . xtitle";
    grid-template-columns: auto auto 1fr;
    grid-template-rows: 1fr auto auto;
    align-items: center;
    gap: 0.5rem 0.5rem;
    margin-top: 2rem;
    max-width: 550px;
    margin-left: auto;
    margin-right: auto;
}

.y-axis-title {
    grid-area: ytitle;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    justify-self: center;
    font-weight: bold;
    white-space: nowrap;
}

.x-axis-title {
    grid-area: xtitle;
    text-align: center;
    font-weight: bold;
    padding-top: 0.5rem;
}

.y-axis-labels {
    grid-area: ylabels;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    height: 100%;
    text-align: right;
    font-size: 0.8rem;
}

.x-axis-labels {
    grid-area: xlabels;
    display: flex;
    justify-content: space-between;
    width: 100%;
    font-size: 0.8rem;
}

.leadership-grid {
    grid-area: grid;
    aspect-ratio: 1 / 1;
    background-color: var(--nu-purple);
    position: relative;
    background-image: 
        linear-gradient(rgba(255,255,255,0.2) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.2) 1px, transparent 1px);
    background-size: calc(100% / 9) calc(100% / 9);
    border: 1px solid var(--nu-dark-purple);
}

.grid-face {
    position: absolute;
    top: 0;
    right: 0;
    width: calc(100% / 9 * 2); /* 2x2 size */
    height: calc(100% / 9 * 2);
    padding: 8px;
}

.grid-face img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 15px rgba(0,0,0,0.4);
}

/* Local Video Player */
.local-video-container {
    margin-top: 1.5rem;
    border-radius: 12px;
    overflow: hidden; /* Ensures the video respects the border-radius */
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    background-color: #000; /* Black background for letterboxing */
}
.local-video-container video {
    width: 100%;
    display: block; /* Removes any bottom space under the video */
}
.video-link-wrapper {
    text-align: center;
    margin-top: 1.5rem;
}
.video-link-button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: var(--nu-purple);
    color: white;
    text-decoration: none;
    font-weight: bold;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}
.video-link-button:hover {
    background-color: var(--nu-dark-purple);
}

/* Disruptive Model Section */
.disruptive-model-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2.5rem;
}

.disruptive-item {
    background-color: var(--background-color);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
}

.disruptive-icon {
    color: var(--nu-purple);
    margin-bottom: 1rem;
}

.disruptive-item h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.oxxo-image img {
    max-width: 200px;
    width: 100%;
}

/* Belinda Section */
.belinda-section {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
    margin-top: 1.5rem;
}

.belinda-text {
    flex: 1;
}

.belinda-image {
    flex: 1;
}

.belinda-image img {
    width: 100%;
    border-radius: 12px;
}

.belinda-text details {
    margin-top: 1rem;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 0.5rem 1rem;
}

.belinda-text summary {
    font-weight: bold;
    cursor: pointer;
    color: var(--nu-purple);
}

.main-footer-credits {
    text-align: center;
    padding: 2rem;
    font-size: 0.9rem;
    color: var(--footer-text);
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-header {
        flex-direction: column-reverse;
        padding: 0.5rem 1rem;
    }

    .main-header nav {
        padding: 0.5rem 0;
    }

    .main-header nav a {
        margin: 0 0.5rem;
    }

    main {
        padding-top: 100px; /* Adjust for taller header */
    }

    .content-section {
        padding: 2rem 1rem;
    }

    .card h1 {
        font-size: 2rem;
    }

    .columns-container {
        flex-direction: column;
        gap: 2rem; /* Increased gap for better separation */
    }

    /* --- Vertical Timeline --- */
    .timeline-container {
        flex-direction: column;
        padding: 0 1rem;
    }

    .timeline-container::before {
        top: 0;
        left: 9px; /* Aligns with the center of the dot */
        width: 4px;
        height: 100%;
        transform: translateX(-50%);
    }

    .timeline-event {
        flex-direction: row;
        align-items: center;
        margin-bottom: 2rem;
        position: relative; /* Ensure tooltip is positioned relative to this */
    }

    .timeline-year {
        margin-top: 0;
        margin-left: 1.5rem;
        font-size: 1.1rem;
    }

    .timeline-tooltip {
        bottom: auto;
        top: 50%;
        left: 6.5rem; /* Increased space from the year */
        transform: translateY(-50%);
        width: auto;
        max-width: calc(100vw - 9.5rem); /* Adjusted to prevent overflow */
        text-align: left;
    }

    .timeline-tooltip::after {
        top: 50%;
        left: -8px; /* Arrow on the left */
        transform: translateY(-50%);
        border-color: transparent var(--nu-dark-purple) transparent transparent;
    }

    /* Modelo Section Responsive */
    .product-section, .oxxo-section, .belinda-section {
        flex-direction: column;
    }

    .oxxo-section {
        flex-direction: column-reverse; /* Puts image on top */
    }

    .product-images img {
        max-width: 350px;
        margin: 0 auto;
    }
}
