/**
 * Estilos para Sistema de Casos de Éxito
 * Versión 1.0.0 - Responsive y escalable
 */

/* ========== CONTENEDOR PRINCIPAL ========== */
.case-studies-client-view,
.case-studies-view {
    background-image: url(../images/fondo_espacio_naranja.png);
    background-attachment: fixed;
    background-size: cover;
    background-position: center center;
}

.case-studies-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;

}

/* ========== HEADER ========== */
.page-header p {
    font-size: 2rem;
    padding: 10px;
    margin: 30px auto 40px;
}

.case-client-content.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px;
}

/* ========== FILTROS ========== */
.filter-buttons {
    gap: 12px;
    margin-bottom: 40px;
    padding: 10px 20px;
}

.case-tag,
.filter-btn {
    width: fit-content;
    padding: 6px 24px;
    border: 2px solid var(--primary-color);
    background: transparent;
    color: var(--primary-color);
    font-size: 1.3rem;
    font-family: var(--main-accent-font);
    font-weight: 500;
    text-transform: uppercase;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

.filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.15);
}

.case-tag,
.filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.filter-btn:active {
    transform: translateY(0);
}

/* ========== GRID DE CASOS ========== */
.cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 40px 20px;
    margin-bottom: 40px;
}

/* ========== CARD DE CASO ========== */
.case-card {
    position: relative;
    /* background: hsl(23.23deg 49% 10%); */
    background: linear-gradient(0deg, #121316, #292b2e);
    border-radius: 0 12px 12px 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    opacity: 1;
    transform: scale(1);
    cursor: pointer;
    padding: 20px;
    height: 200px;
    align-items: end;
    animation: fadeIn 0.4s ease forwards;
    text-decoration: none;
    color: inherit;
    display: flex;
}

.case-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(228deg, rgb(138 56 0) 0%, rgba(41, 43, 46, 1) 40%);
    border-radius: 0 12px 12px 12px;
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 0;
}

.case-card:visited {
    color: inherit;
    text-decoration: none;
}

.case-card.hidden {
    display: none;
    opacity: 0;
    transform: scale(0.8);
}

.case-card.hiding {
    opacity: 0;
    transform: translateY(-20px);
}

.case-card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-5px);
}

.case-card:hover::before {
    opacity: 1;
}

.case-content {
    width: 100%;
    position: relative;
    z-index: 1;
}

.case-content>hr {
    width: 60%;
    border-color: var(--grey-mid-color);
    box-shadow: none;
    margin: 10px;
}

.case-card .folder-tab {
    position: absolute;
    height: 20px;
    left: 0;
    top: -19px;
    display: block;
    width: 40%;
    border-top-left-radius: 8px;
    background-color: #292b2e;
    z-index: 1;
}

.case-card .folder-tab:after {
    content: '';
    position: absolute;
    display: block;
    top: 0;
    left: calc(100% - 20px);
    border-bottom: 20px solid #292b2e;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
}

/* Imagen del caso */
.case-image {
    width: 100%;
    padding-top: 10px;
}

.case-image img {
    width: auto;
    height: 40px;
}

/* ========== CATEGORÍAS ========== */
.case-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.category-tag {
    font-family: var(--main-accent-font);
    padding: 4px 12px;
    background: transparent;
    color: var(--grey-light-color);
    font-size: 16px;
    border: 1px solid var(--grey-mid-color);
    border-radius: 20px;
    font-weight: 100;
    text-transform: uppercase;
    transition: all 0.2s ease;
}

/* ========== SIN RESULTADOS ========== */
.no-results {
    text-align: center;
    padding: 60px 20px;
    display: none;
}

.no-results.show {
    display: block;
}

.no-results h3 {
    font-size: 1.5rem;
    color: #666;
    margin-bottom: 10px;
}

.no-results p {
    color: #999;
    font-size: 1rem;
}

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

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

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}



.case-card.hiding {
    animation: fadeOut 0.3s ease forwards;
}

/* ========== ESTADOS ========== */
.case-card.featured {
    border: 2px solid #ffd700;
    position: relative;
}

.case-card.featured::before {
    content: '⭐ Destacado';
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ffd700;
    color: #333;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 10;
}

/* ========== CASE STUDIES CLIENT ========== */
.case-client-header {
    margin-bottom: 20px;
}

.case-tag {
    width: fit-content;
    padding: 6px 24px;
    border: none;
    font-size: 1.2rem;
    font-family: var(--main-accent-font);
    font-weight: 500;
    text-transform: uppercase;
    border-radius: 30px;
    outline: none;
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.case-client-content h1 {
    font-size: 2.5rem;
    letter-spacing: 0.5px;
    font-weight: 200;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.case-client-content .case-block-description h2 {
    font-size: 2.2rem;
    font-weight: 200;
    margin-bottom: 15px;
    margin-top: 35px;
}

.case-client-content>.flex-box {
    align-items: stretch;
}

.case-block-description {
    padding: 20px 0;
}

.case-client-content p,
.case-client-content li {
    font-size: 1.1rem;
    line-height: 1.5;
    margin: 8px 0;
}

.case-client-content li {
    list-style-image: url('/images/list-marker.svg');
}

li::marker {
    font-size: 1.6em;
    line-height: .1;
}

.case-client-content ul {
    padding-left: 20px;
}

.case-logo-img {
    margin-bottom: 20px;
}

.case-logo-img img {
    width: auto;
    height: 75px;
}

.case-mockup-img {
    position: relative;
    height: 90%;
}

.case-mockup-img>img {
    width: 50%;
    position: absolute;
    z-index: 2;
}

.case-mockup-img>img:first-child {
    top: 0;
    left: 15%;
}

.case-mockup-img>img:last-child {
    top: 6%;
    left: 36%;
}

.case-mockup-img>img.mockup-pc {
    width: 100%;
    position: sticky;
    top: 10%;
    left: 12%;
}

.metric-box,
.case-resume.flex-10 {
    position: relative;
    border: 1px solid var(--primary-color);
    background: rgba(32, 13, 1, 0.5);
    padding: 20px;
    margin: 20px 0;
}

.case-resume.flex-10 {
    padding: 20px 30px 30px 30px;
}

.case-resume h2 {
    font-size: 2rem;
    font-weight: 200;
    color: var(--primary-color);
}

.case-resume .form-decoration .angle-right {
    display: block;
    width: 20px;
    height: 20px;
    position: absolute;
    top: 10px;
    right: 10px;
    border-bottom: none;
    border-top: 3px solid var(--primary-color);
    border-right: 3px inset var(--primary-color);
}

.metric-box {
    color: var(--primary-color);
    align-content: flex-end;
    text-align: right;
    padding: 16px;
    margin: 10px 5px;
    width: calc(50% - 20px);
}

.metric-box>div {
    width: 100%;
}

.metric-box .form-decoration .angle-left {
    width: 20px;
    height: 20px;
}

h2.metric-value {
    width: 100%;
    text-align: right;
    font-size: 45px;
    font-weight: 200;
    font-variant-numeric: tabular-nums;
}

.case-client-content {
    margin-top: 60px;
}

.case-client-content .contact-text-box {
    margin-left: 50%;
}

.case-client-content .contact-spaceship-box {
    margin-left: 0;
    margin-top: 0;
}

.case-client-content .contact-spaceship-box img {
    width: 90%;
}

/* ========== UTILIDADES ========== */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Reducir movimiento para usuarios que lo prefieren */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
    .cases-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .case-studies-client-view,
    .case-studies-view {
        background-image: none;
    }

    .bg-fixed {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        /* solo ocupa la pantalla */
        background-image: url('../images/fondo_espacio_naranja_mob.png');
        background-size: cover;
        background-position: center center;
        background-repeat: no-repeat;
        z-index: -1;
    }
}

@media (max-width: 991px) {

    .case-client-content.container {
        margin-top: 40px;
        padding: 0px 6%;
    }

    .case-client-content .flex-box>.flex-2 {
        width: 100%;
    }

    .case-mockup-img {
        height: 60vh;
    }

    .case-mockup-img>img {
        width: 32%;
    }

    .case-mockup-img>img:first-child {
        left: 25%;
    }

    .case-mockup-img>img:last-child {
        left: 45%;
    }

    .case-mockup-img>img.mockup-pc {
        width: 100%;
        height: auto;
        margin: 0 auto;
    }

    .case-client-content .contact-spaceship-box img {
        width: 50%;
    }
}

@media (max-width: 768px) {
    .page-header p {
        margin: 10px auto 20px;
    }

    .filter-buttons {
        justify-content: center;
        gap: 8px;
    }

    .filter-btn {
        padding: 10px 20px;
        font-size: 1.2rem;
    }

    .page-header {
        margin-bottom: 0px;
        margin-top: 0px;
    }

    .page-header p {
        font-size: 1.8rem;
        padding: 10px;
    }

    .case-image {
        height: 180px;
        font-size: 2.5rem;
    }

    .case-client-content .contact-text-box {
        margin-left: 0;
        margin-top: 30px;
    }

    .case-logo-img img {
        height: 60px;
    }

    .case-mockup-img>img {
        height: 500px;
        width: auto;
    }

    .case-mockup-img>img:last-child {
        left: 40%;
    }

    .case-client-content .land-contact-box {
        min-height: fit-content;
        padding-top: 60px;
    }

    .case-client-content .contact-spaceship-box {
        display: none;
    }

}

@media (max-width: 500px) {
    .cases-grid {
        grid-template-columns: 1fr;
    }

    .case-client-content .contact-text-box {
        margin-left: 0;
        margin-top: 0px;
    }

    .case-mockup-img>img.mockup-pc {
        width: 100%;
        height: auto;
        margin: 20px auto;
    }

    .case-studies-container {
        padding: 30px 15px;
    }

    .case-content {
        padding: 20px;
    }

    .case-metrics {
        flex-wrap: wrap;
    }

    .metric {
        flex: 0 0 calc(50% - 5px);
        margin-bottom: 10px;
    }

    .metric-box {
        padding: 12px;
        width: 100%;
    }

    .case-logo-img img {
        height: 50px;
    }

    .case-mockup-img>img:first-child {
        left: 0;
    }

    .case-mockup-img>img:last-child {
        left: 24%;
    }

    .case-mockup-img {
        height: 380px;
    }

    .case-mockup-img>img {
        height: 410px;
    }
}