/* Estilos para Reto Guadalupe-Reyes */

/* Animaciones */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

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

.slide-in {
    animation: slideIn 0.5s ease-out backwards;
}

.fade-in {
    animation: fadeIn 0.6s ease-out backwards;
}

.bounce-anim {
    animation: bounce 2s ease-in-out infinite;
}

/* Hero Header */
.reto-hero {
    background: linear-gradient(to right, #dc2626, #15803d, #dc2626);
    color: white;
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
}

.reto-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNjAiIGhlaWdodD0iNjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PHBhdHRlcm4gaWQ9ImdyaWQiIHdpZHRoPSI2MCIgaGVpZ2h0PSI2MCIgcGF0dGVyblVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+PHBhdGggZD0iTSAxMCAwIEwgMCAwIDAgMTAiIGZpbGw9Im5vbmUiIHN0cm9rZT0id2hpdGUiIHN0cm9rZS13aWR0aD0iMC41IiBvcGFjaXR5PSIwLjEiLz48L3BhdHRlcm4+PC9kZWZzPjxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JpZCkiLz48L3N2Zz4=');
    opacity: 0.2;
}

.reto-hero__title {
    font-size: 5rem;
    font-weight: 900;
    text-align: center;
    margin-bottom: 1rem;
    position: relative;
    z-index: 10;
}

@media (max-width: 768px) {
    .reto-hero__title {
        font-size: 3rem;
    }
}

.reto-hero__subtitle {
    text-align: center;
    font-size: 2rem;
    color: #fef3c7;
    margin-bottom: 3rem;
    position: relative;
    z-index: 10;
}

/* Estadísticas Hero */
.reto-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 90rem;
    margin: 0 auto;
    position: relative;
    z-index: 10;
}

.reto-stat {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 1.5rem;
    padding: 3rem 2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    text-align: center;
}

.reto-stat:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-5px);
}

.reto-stat__icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
}

.reto-stat__number {
    font-size: 4rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
}

.reto-stat__label {
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 0.1rem;
    color: #fef3c7;
}

/* Tabs de navegación (como botones) */
.reto-tabs {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 4rem 0;
    flex-wrap: wrap;
}

.reto-tab {
    padding: 1.8rem 4rem;
    border-radius: 1rem;
    font-weight: 700;
    font-size: 1.6rem;
    transition: all 0.3s ease;
    border: 3px solid #d1d5db;
    cursor: pointer;
    background: #d1d5db;
    color: #1f2937;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-transform: uppercase;
    letter-spacing: 0.05rem;
    min-width: 25rem;
    text-align: center;
}

.reto-tab:hover {
    background: #b8bcc4;
    border-color: #9ca3af;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.reto-tab.active {
    background: linear-gradient(135deg, #dc2626 0%, #15803d 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.4);
    transform: translateY(-3px);
}

.reto-tab.active:hover {
    background: linear-gradient(135deg, #b91c1c 0%, #166534 100%);
    transform: translateY(-3px);
}

/* Ranking */
.ranking-container {
    margin-bottom: 8rem;
}

.ranking-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.ranking-header__icon {
    font-size: 4rem;
}

.ranking-header__title {
    font-size: 3.5rem;
    font-weight: 900;
    color: #1f2937;
    margin: 0;
}

.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.ranking-item {
    background: white;
    border-radius: 1.5rem;
    padding: 2.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
    border-left: 8px solid transparent;
}

.ranking-item:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transform: translateY(-5px);
}

.ranking-item--gold {
    border-left-color: #fbbf24;
    background: linear-gradient(to right, #fffbeb, white);
}

.ranking-item--silver {
    border-left-color: #d1d5db;
    background: linear-gradient(to right, #f9fafb, white);
}

.ranking-item--bronze {
    border-left-color: #fb923c;
    background: linear-gradient(to right, #fff7ed, white);
}

.ranking-item--default {
    border-left-color: #16a34a;
}

.ranking-item__position {
    flex-shrink: 0;
    width: 6rem;
    height: 6rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 2.2rem;
}

.ranking-item__position--gold {
    background: #fbbf24;
    color: #78350f;
}

.ranking-item__position--silver {
    background: #d1d5db;
    color: #374151;
}

.ranking-item__position--bronze {
    background: #fb923c;
    color: #7c2d12;
}

.ranking-item__position--default {
    background: #dcfce7;
    color: #166534;
}

.ranking-item__photo {
    flex-shrink: 0;
    width: 8rem;
    height: 8rem;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ranking-item__photo img,
.ranking-item__photo picture {
    width: 100%;
    height: 100%;
}

.ranking-item__photo picture img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ranking-item__info {
    flex: 1;
    min-width: 200px;
}

.ranking-item__name {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.ranking-item__km {
    text-align: right;
    flex-shrink: 0;
}

.ranking-item__km-number {
    font-size: 3.5rem;
    font-weight: 900;
    background: linear-gradient(to right, #dc2626, #15803d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ranking-item__km-label {
    font-size: 1.2rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
}

/* Galería */
.galeria-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2.5rem;
}

.galeria-card {
    background: white;
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.galeria-card:hover {
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
    transform: translateY(-8px);
}

.galeria-card__image {
    position: relative;
    height: 28rem;
    overflow: hidden;
    background: linear-gradient(to bottom right, #f3f4f6, #e5e7eb);
}

.galeria-card__image picture,
.galeria-card__image img {
    width: 100%;
    height: 100%;
}

.galeria-card__image picture img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.galeria-card:hover .galeria-card__image picture img,
.galeria-card:hover .galeria-card__image img {
    transform: scale(1.1);
}

.galeria-card__folio {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    border-radius: 3rem;
    padding: 0.5rem 1.5rem;
    font-size: 1.3rem;
    font-weight: 700;
    color: #1f2937;
}

.galeria-card__content {
    padding: 2rem;
}

.galeria-card__name {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 1.5rem 0;
    line-height: 1.4;
}

.galeria-card__stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.galeria-card__label {
    font-size: 1.3rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.galeria-card__km {
    font-weight: 700;
    color: #16a34a;
    font-size: 1.5rem;
}

/* Utilidades */
.hidden {
    display: none !important;
}

/* Responsive */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    .reto-hero__title {
        font-size: 4rem;
    }

    .reto-stats {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1.5rem;
    }

    /* Botones en tablet */
    .reto-tabs {
        gap: 1.8rem;
    }

    .reto-tab {
        padding: 1.6rem 3rem;
        font-size: 1.5rem;
        min-width: 22rem;
    }

    .galeria-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 2rem;
    }
}

/* Mobile (hasta 768px) */
@media (max-width: 768px) {
    .reto-hero {
        padding: 3rem 0;
    }

    .reto-hero__title {
        font-size: 3rem;
    }

    .reto-hero__subtitle {
        font-size: 1.6rem;
        margin-bottom: 2rem;
    }

    .reto-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .reto-stat {
        padding: 2rem 1.5rem;
    }

    .reto-stat__icon {
        font-size: 3rem;
    }

    .reto-stat__number {
        font-size: 3rem;
    }

    .reto-tabs {
        flex-direction: column;
        gap: 1.5rem;
        padding: 0 1rem;
    }

    .reto-tab {
        width: 100%;
        padding: 1.6rem 2rem;
        font-size: 1.4rem;
        min-width: auto;
    }

    .ranking-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .ranking-header__title {
        font-size: 2.5rem;
    }

    .ranking-item {
        padding: 1.5rem;
        flex-direction: column;
        text-align: center;
    }

    .ranking-item__position {
        width: 5rem;
        height: 5rem;
        font-size: 1.8rem;
    }

    .ranking-item__photo {
        width: 8rem;
        height: 8rem;
    }

    .ranking-item__info {
        min-width: 100%;
    }

    .ranking-item__name {
        font-size: 1.6rem;
    }

    .ranking-item__km {
        text-align: center;
        margin-top: 1rem;
    }

    .ranking-item__km-number {
        font-size: 2.5rem;
    }

    .galeria-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .galeria-card__image {
        height: 35rem;
    }
}

/* Mobile pequeño (hasta 480px) */
@media (max-width: 480px) {
    .reto-hero__title {
        font-size: 2.5rem;
    }

    .reto-hero__subtitle {
        font-size: 1.4rem;
    }

    .reto-stat {
        padding: 1.5rem 1rem;
    }

    .reto-stat__number {
        font-size: 2.5rem;
    }

    .reto-stat__label {
        font-size: 1rem;
    }

    .reto-tab {
        padding: 1rem 1.5rem;
        font-size: 1.3rem;
    }

    .ranking-header__title {
        font-size: 2rem;
    }

    .ranking-item {
        padding: 1rem;
    }

    .ranking-item__position {
        width: 4.5rem;
        height: 4.5rem;
        font-size: 1.6rem;
    }

    .ranking-item__photo {
        width: 7rem;
        height: 7rem;
    }

    .ranking-item__name {
        font-size: 1.4rem;
    }

    .ranking-item__km-number {
        font-size: 2rem;
    }

    .galeria-card__image {
        height: 30rem;
    }

    .galeria-card__content {
        padding: 1.5rem;
    }

    .galeria-card__name {
        font-size: 1.4rem;
    }
}
