:root {
    /* Logo Colors */
    --primary: #eb4818;
    /* Red-Orange */
    --secondary: #0b71b8;
    /* Deep Sky Blue */
    --accent: #00ab9f;
    /* Persian Green - Teal */

    /* Theme Colors (Default Dark) */
    --bg-color: #0e1217;
    --text-color: #f0f2f5;
    --card-bg: #1c2128;
    --card-shadow: rgba(0, 0, 0, 0.4);
    --nav-bg: rgba(14, 18, 23, 0.8);
    --border-color: rgba(255, 255, 255, 0.1);

    /* Gradients */
    --gradient-warm: linear-gradient(135deg, #eb4818 0%, #eb4818 100%);
    /* Simplified for now based on logo dominance */
    --gradient-cool: linear-gradient(135deg, #0b71b8 0%, #00ab9f 100%);
    --gradient-vibrant: linear-gradient(135deg, #eb4818 0%, #0b71b8 50%, #00ab9f 100%);
}

[data-theme="light"] {
    --bg-color: #FFF8F0;
    --text-color: #1A1A2E;
    --card-bg: #ffffff;
    --card-shadow: rgba(0, 0, 0, 0.08);
    --nav-bg: rgba(255, 248, 240, 0.9);
    --border-color: rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Work Sans', sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.background-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background:
        radial-gradient(circle at 20% 50%, rgba(235, 72, 24, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(11, 113, 184, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(0, 171, 159, 0.08) 0%, transparent 50%);
    animation: drift 20s ease-in-out infinite;
    pointer-events: none;
}

@keyframes drift {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(30px, -30px) scale(1.05);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.95);
    }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header */
header {
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    transition: background-color 0.3s ease;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    font-family: 'DM Serif Display', serif;
    font-size: 2rem;
    font-weight: 400;
    color: var(--text-color);
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo span {
    color: var(--primary);
    font-style: italic;
}

nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

nav ul {
    display: flex;
    gap: 2rem;
    list-style: none;
}

nav a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    position: relative;
    transition: color 0.3s ease;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--gradient-warm);
    transition: width 0.3s ease;
}

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

nav a:hover::after {
    width: 100%;
}

/* Theme Toggle Button */
.theme-toggle {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.theme-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: rotate(15deg);
}

/* Banner */
.banner {
    background: var(--gradient-vibrant);
    color: white;
    padding: 1rem 0;
    text-align: center;
    font-weight: 600;
    margin-bottom: 0;
    /* Adjusted since header is sticky */
    box-shadow: 0 4px 20px rgba(235, 72, 24, 0.2);
    /* animation: slideDown 0.6s ease-out; Remove animation for better UX/FOUC avoidance */
}

/* Hero Section */
.hero {
    padding: 4rem 0 6rem;
    position: relative;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-text h1 {
    font-family: 'DM Serif Display', serif;
    font-size: 4.5rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    font-weight: 400;
    letter-spacing: -0.03em;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero-text h1 .highlight {
    background: var(--gradient-warm);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-style: italic;
}

.hero-text p {
    font-size: 1.2rem;
    color: var(--text-color);
    opacity: 0.8;
    margin-bottom: 2rem;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-image {
    position: relative;
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

.hero-image::before {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 100%;
    height: 100%;
    background: var(--gradient-warm);
    border-radius: 20px;
    z-index: -1;
    animation: float 3s ease-in-out infinite;
    opacity: 0.6;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-10px) rotate(1deg);
    }
}

.hero-image-placeholder {
    width: 100%;
    aspect-ratio: 4/3;
    background: var(--gradient-cool);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Horizontal Tabs Navigation */
.tabs-container {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 0.5rem;
    margin: 4rem 0 3rem;
    box-shadow: 0 4px 30px var(--card-shadow);
    position: sticky;
    top: 90px;
    /* Below header */
    z-index: 50;
    animation: fadeInUp 0.8s ease-out 0.8s both;
    border: 1px solid var(--border-color);
}

.horizontal-tabs {
    display: flex;
    gap: 0.5rem;
    list-style: none;
    flex-wrap: wrap;
    justify-content: center;
}

.horizontal-tabs a {
    display: block;
    padding: 1rem 2rem;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.horizontal-tabs a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-warm);
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: -1;
}

.horizontal-tabs a:hover::before,
.horizontal-tabs a.active::before {
    transform: translateY(0);
}

.horizontal-tabs a:hover,
.horizontal-tabs a.active {
    color: white;
}

/* Main Content Layout with Sidebar */
.content-wrapper {
    display: flex;
    gap: 3rem;
    margin: 2rem 0;
    position: relative;
}

/* Left Sidebar with Section Links */
.sidebar {
    width: 280px;
    flex-shrink: 0;
    position: sticky;
    top: 180px;
    align-self: flex-start;
    height: fit-content;
}

.sidebar-nav {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0) 100%);
    border-radius: 15px;
    padding: 2rem 1.5rem;
    border: 1px solid var(--border-color);
}

.sidebar-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-nav li {
    margin-bottom: 0.3rem;
}

.sidebar-nav a {
    display: block;
    padding: 0.8rem 1rem;
    color: var(--primary);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 400;
    transition: all 0.3s ease;
    position: relative;
    border-left: 4px solid transparent;
    border-radius: 5px;
}

.sidebar-nav a:hover {
    background: rgba(235, 72, 24, 0.1);
    padding-left: 1.3rem;
}

.sidebar-nav a.active {
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 600;
    background: rgba(235, 72, 24, 0.1);
}

/* Main Content Area */
.main-content {
    flex: 1;
    min-width: 0;
}

.tab-content {
    display: none;
    animation: fadeIn 0.5s ease-out;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-section {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 3rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 30px var(--card-shadow);
    scroll-margin-top: 200px;
    border: 1px solid var(--border-color);
}

.content-section h2 {
    font-family: 'DM Serif Display', serif;
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    font-weight: 400;
}

.content-section h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.content-section p {
    color: var(--text-color);
    opacity: 0.8;
    line-height: 1.8;
    margin-bottom: 1rem;
}

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

.content-section li {
    color: var(--text-color);
    opacity: 0.8;
    margin-bottom: 0.8rem;
    padding-left: 2rem;
    position: relative;
    line-height: 1.7;
}

.content-section li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-size: 1.2rem;
    font-weight: 700;
}

.project-tag {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(235, 72, 24, 0.1);
    color: var(--primary);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.info-card {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: 15px;
    border-left: 4px solid var(--primary);
    border: 1px solid var(--border-color);
    border-left-width: 4px;
}

.info-card h4 {
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-size: 1rem;
}

.info-card p {
    color: var(--text-color);
    opacity: 0.8;
    font-size: 0.9rem;
    margin: 0;
}

.cta-button {
    display: inline-block;
    padding: 1.2rem 2.5rem;
    background: var(--gradient-warm);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(235, 72, 24, 0.3);
    position: relative;
    overflow: hidden;
    margin-top: 2rem;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.cta-button:hover::before {
    width: 400px;
    height: 400px;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(235, 72, 24, 0.4);
}

.cta-button span {
    position: relative;
    z-index: 1;
}

.alert-box {
    background: rgba(235, 72, 24, 0.05);
    border-left: 4px solid var(--primary);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem 0;
    display: flex;
    align-items: start;
    gap: 1rem;
}

[data-theme="light"] .alert-box {
    background: linear-gradient(135deg, #FFF8F0 0%, #FFE8D6 100%);
}

.alert-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.alert-box p {
    margin: 0;
    color: var(--text-color);
    opacity: 0.9;
}

.alert-box a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: underline;
}

/* Footer */
footer {
    background: var(--gradient-cool);
    color: white;
    padding: 4rem 0 2rem;
    margin-top: 6rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-section h3 {
    font-family: 'DM Serif Display', serif;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 400;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.7rem;
}

.footer-section li::before {
    content: none;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: white;
    /* Brighter on hover */
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: var(--accent);
    transform: translateY(-3px);
}

/* Tech Accordion for La Ruta */
.tech-accordion {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

.tech-item {
    background: rgba(14, 18, 23, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.tech-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 100%;
    background: var(--primary);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.tech-item.active {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(235, 72, 24, 0.1);
    background: rgba(14, 18, 23, 0.8);
}

.tech-item.active::before {
    transform: scaleY(1);
}

.tech-header {
    padding: 1rem 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent;
}

.tech-header:hover {
    background: rgba(255, 255, 255, 0.02);
}

.tech-title {
    font-weight: 600;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.tech-number {
    font-family: 'DM Serif Display', serif;
    color: var(--primary);
    font-size: 1.2rem;
    opacity: 0.5;
    width: 30px;
}

.tech-date {
    font-size: 0.9rem;
    opacity: 0.7;
    margin-left: auto;
    margin-right: 1rem;
    font-family: monospace;
}

.tech-icon {
    transition: transform 0.3s ease;
    color: var(--primary);
}

.tech-item.active .tech-icon {
    transform: rotate(180deg);
}

.tech-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: rgba(0, 0, 0, 0.2);
}

.tech-inner {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: center;
}

.tech-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-virtual {
    background: rgba(11, 113, 184, 0.15);
    color: var(--secondary);
    border: 1px solid rgba(11, 113, 184, 0.3);
}

.badge-presencial {
    background: rgba(0, 171, 159, 0.15);
    color: var(--accent);
    border: 1px solid rgba(0, 171, 159, 0.3);
}

.tech-resources {
    display: flex;
    gap: 1rem;
}

.resource-link {
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9rem;
    opacity: 0.7;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.resource-link:hover {
    opacity: 1;
    color: var(--primary);
}

.resource-link.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    text-decoration: line-through;
}

/* Events Grid */
.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.event-card {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.event-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--card-shadow);
}

.event-image {
    width: 100%;
    height: 180px;
    background: var(--gradient-cool);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.event-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.event-card:hover .event-image img {
    transform: scale(1.05);
}

.event-content {
    padding: 1.5rem;
}

.event-date {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: rgba(235, 72, 24, 0.1);
    padding: 0.2rem 0.8rem;
    border-radius: 20px;
}

.event-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.event-description {
    font-size: 0.9rem;
    color: var(--text-color);
    opacity: 0.7;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.event-btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border: 1px solid var(--primary);
    color: var(--primary);
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    background: transparent;
}

.event-btn:hover {
    background: var(--primary);
    color: white;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    opacity: 1;
}

.modal-content {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    transform: translateY(20px);
    transition: transform 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal.show .modal-content {
    transform: translateY(0);
}

.close-modal {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    font-size: 1.5rem;
    color: var(--text-color);
    cursor: pointer;
    transition: color 0.3s ease;
    background: none;
    border: none;
}

.close-modal:hover {
    color: var(--primary);
    transform: rotate(90deg);
}

.modal-header {
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    font-family: 'DM Serif Display', serif;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.modal-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--text-color);
    opacity: 0.8;
}

.modal-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-body {
    color: var(--text-color);
    line-height: 1.7;
}

.modal-stats {
    display: flex;
    gap: 2rem;
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--bg-color);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.stat-item h4 {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 0.2rem;
}

.stat-item p {
    font-size: 0.85rem;
    opacity: 0.7;
    margin: 0;
}

.modal-gallery {
    margin-top: 2rem;
}

.gallery-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.gallery-link:hover {
    text-decoration: underline;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
}

/* Responsive */
@media (max-width: 1200px) {
    .sidebar {
        width: 220px;
    }
}

@media (max-width: 968px) {
    .hero-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .hero-text h1 {
        font-size: 3rem;
    }

    .content-wrapper {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        position: static;
        margin-bottom: 2rem;
    }

    .horizontal-tabs {
        overflow-x: auto;
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
    }

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

    .horizontal-tabs::-webkit-scrollbar-thumb {
        background: var(--primary);
        border-radius: 4px;
    }

    nav ul {
        flex-wrap: wrap;
        gap: 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 640px) {
    .header-content {
        flex-direction: column;
        gap: 1.5rem;
    }

    .hero-text h1 {
        font-size: 2.5rem;
    }

    .content-section {
        padding: 1.5rem;
    }

    .horizontal-tabs a {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
}