/* static/main/css/historia.css */

/* Variables específicas para la página de historia */
:root {
    --historia-primary: #005D99;
    --historia-secondary: #A3C947;
    --historia-accent: #F7D038;
    --historia-highlight: #009FD9;
    --historia-dark: #1a202c;
    --historia-light: #f7fafc;
    --historia-text: #2d3748;
    --historia-text-light: #718096;
    --historia-border: #e2e8f0;
    --historia-shadow: 0 10px 25px rgba(0,0,0,0.1);
    --historia-shadow-lg: 0 20px 40px rgba(0,0,0,0.15);
}

/* Hero Section */
.historia-hero {
    position: relative;
    background: linear-gradient(135deg, var(--historia-primary) 0%, var(--historia-highlight) 50%, var(--historia-secondary) 100%);
    padding: 8rem 0 6rem;
    overflow: hidden;
    min-height: 60vh;
    display: flex;
    align-items: center;
}

.historia-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" fill="white" opacity="0.1"><polygon points="0,0 1000,0 1000,80 0,100"/></svg>') repeat-x;
    background-size: 100px 100px;
    animation: heroPattern 20s linear infinite;
}

@keyframes heroPattern {
    0% { background-position-x: 0; }
    100% { background-position-x: 100px; }
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.1);
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.2);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    backdrop-filter: blur(10px);
    margin-bottom: 2rem;
    border: 1px solid rgba(255,255,255,0.3);
    animation: fadeInUp 0.6s ease-out;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.hero-subtitle {
    font-size: 1.3rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 2rem;
    line-height: 1.6;
    animation: fadeInUp 0.6s ease-out 0.4s both;
}

.hero-decoration {
    width: 100px;
    height: 4px;
    background: var(--historia-accent);
    margin: 0 auto;
    border-radius: 2px;
    animation: fadeInUp 0.6s ease-out 0.6s both;
}

/* Timeline Section */
.timeline-section {
    padding: 6rem 0;
    background: var(--historia-light);
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--historia-dark);
    margin-bottom: 1rem;
}

.section-divider {
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--historia-primary), var(--historia-secondary));
    margin: 0 auto;
    border-radius: 2px;
}

.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--historia-primary), var(--historia-secondary));
    transform: translateX(-50%);
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    margin-bottom: 4rem;
    display: flex;
    align-items: center;
    opacity: 0;
    animation: fadeInTimeline 0.8s ease-out forwards;
}

.timeline-item:nth-child(1) { animation-delay: 0.2s; }
.timeline-item:nth-child(2) { animation-delay: 0.4s; }
.timeline-item:nth-child(3) { animation-delay: 0.6s; }

.timeline-item:nth-child(odd) {
    flex-direction: row;
}

.timeline-item:nth-child(even) {
    flex-direction: row-reverse;
}

.timeline-marker {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: white;
    border: 4px solid var(--historia-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    box-shadow: var(--historia-shadow);
}

.timeline-marker i {
    color: var(--historia-primary);
    font-size: 1.2rem;
}

.timeline-content {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--historia-shadow);
    width: calc(50% - 40px);
    position: relative;
    border: 1px solid var(--historia-border);
    transition: all 0.3s ease;
}

.timeline-content:hover {
    transform: translateY(-5px);
    box-shadow: var(--historia-shadow-lg);
}

.timeline-content::before {
    content: '';
    position: absolute;
    top: 50%;
    width: 0;
    height: 0;
    border: 15px solid transparent;
    transform: translateY(-50%);
}

.timeline-item:nth-child(odd) .timeline-content::before {
    right: -30px;
    border-left-color: white;
}

.timeline-item:nth-child(even) .timeline-content::before {
    left: -30px;
    border-right-color: white;
}

.timeline-year {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--historia-primary);
    margin-bottom: 0.5rem;
}

.timeline-content h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--historia-dark);
    margin-bottom: 1rem;
}

.timeline-content p {
    color: var(--historia-text-light);
    line-height: 1.6;
}

/* Content Section */
.content-section {
    padding: 6rem 0;
    background: white;
}

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

.image-container {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--historia-shadow-lg);
}

.main-image {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease;
}

.image-container:hover .main-image {
    transform: scale(1.05);
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(0,93,153,0.8), rgba(163,201,71,0.6));
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: flex-end;
    padding: 2rem;
}

.image-container:hover .image-overlay {
    opacity: 1;
}

.image-badge {
    background: rgba(255,255,255,0.9);
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--historia-primary);
}

.text-block {
    margin-bottom: 2.5rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
}

.text-block:nth-child(1) { animation-delay: 0.2s; }
.text-block:nth-child(2) { animation-delay: 0.4s; }
.text-block:nth-child(3) { animation-delay: 0.6s; }

.text-block h3 {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--historia-dark);
    margin-bottom: 1rem;
    position: relative;
}

.text-block h3::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: -5px;
    width: 50px;
    height: 3px;
    background: var(--historia-accent);
    border-radius: 2px;
}

.text-block p {
    color: var(--historia-text-light);
    line-height: 1.7;
    font-size: 1.05rem;
}

/* Features Section */
.features-section {
    padding: 6rem 0;
    background: var(--historia-light);
}

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

.feature-card {
    background: white;
    padding: 2.5rem 2rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: var(--historia-shadow);
    transition: all 0.3s ease;
    border: 1px solid var(--historia-border);
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
}

.feature-card:nth-child(1) { animation-delay: 0.1s; }
.feature-card:nth-child(2) { animation-delay: 0.2s; }
.feature-card:nth-child(3) { animation-delay: 0.3s; }
.feature-card:nth-child(4) { animation-delay: 0.4s; }

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--historia-shadow-lg);
}

.feature-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--historia-primary), var(--historia-highlight));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    transition: transform 0.3s ease;
}

.feature-card:hover .feature-icon {
    transform: scale(1.1);
}

.feature-icon i {
    color: white;
    font-size: 1.8rem;
}

.feature-card h4 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--historia-dark);
    margin-bottom: 1rem;
}

.feature-card p {
    color: var(--historia-text-light);
    line-height: 1.6;
}

/* CTA Section */
.cta-section {
    padding: 6rem 0;
    background: linear-gradient(135deg, var(--historia-dark) 0%, var(--historia-primary) 100%);
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cta-decoration {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"><circle cx="50" cy="50" r="40"/><circle cx="50" cy="50" r="20"/></svg>') repeat;
    background-size: 200px 200px;
    animation: ctaPattern 30s linear infinite;
}

@keyframes ctaPattern {
    0% { background-position: 0 0; }
    100% { background-position: 200px 200px; }
}

.cta-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
}

.cta-content h2 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.cta-content p {
    font-size: 1.2rem;
    margin-bottom: 2.5rem;
    opacity: 0.9;
    line-height: 1.6;
}

.cta-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    min-width: 200px;
    justify-content: center;
}

.btn-primary {
    background: var(--historia-accent);
    color: var(--historia-dark);
}

.btn-primary:hover {
    background: var(--historia-secondary);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    color: white;
}

.btn-outline {
    background: transparent;
    color: white;
    border-color: white;
}

.btn-outline:hover {
    background: white;
    color: var(--historia-primary);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInTimeline {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive Design */
@media (max-width: 1199.98px) {
    .hero-title {
        font-size: 3rem;
    }
    
    .section-title {
        font-size: 2.4rem;
    }
}

@media (max-width: 991.98px) {
    .content-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .timeline::before {
        left: 30px;
    }
    
    .timeline-item {
        flex-direction: row !important;
        padding-left: 80px;
    }
    
    .timeline-marker {
        left: 30px;
    }
    
    .timeline-content {
        width: 100%;
    }
    
    .timeline-content::before {
        left: -30px !important;
        border-right-color: white !important;
        border-left-color: transparent !important;
    }
    
    .cta-content h2 {
        font-size: 2.4rem;
    }
}

@media (max-width: 767.98px) {
    .historia-hero {
        padding: 6rem 0 4rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .timeline-section,
    .content-section,
    .features-section,
    .cta-section {
        padding: 4rem 0;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .timeline-item {
        padding-left: 60px;
    }
    
    .timeline-marker {
        width: 50px;
        height: 50px;
        left: 25px;
    }
    
    .timeline-marker i {
        font-size: 1rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 575.98px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .timeline-content {
        padding: 1.5rem;
    }
    
    .feature-card {
        padding: 2rem 1.5rem;
    }
    
    .cta-content h2 {
        font-size: 2rem;
    }
}