/* ====== SUCCESS STORIES SECTION - FLIP CARD DESIGN ====== */
@import url('https://fonts.googleapis.com/css2?family=Figtree:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&family=Playfair+Display:wght@500;600;700&display=swap');

.success-stories {
  padding: 8rem 0;
  background: linear-gradient(135deg, var(--gray-50) 0%, var(--white) 50%, var(--gray-100) 100%);
  position: relative;
  overflow: hidden;
}

.success-stories::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(circle at 20% 80%, rgba(255, 107, 53, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 107, 53, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(255, 107, 53, 0.02) 0%, transparent 30%);
  pointer-events: none;
}

.font-serif-display {
    font-family: 'Figtree', sans-serif;
}

/* Stories Grid Layout */
.success-stories .stories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2.5rem;
    margin-bottom: 4rem;
    position: relative;
    z-index: 2;
    align-items: center;
    justify-items: center;
}

/* Card Flip Container */
.success-stories .card-flip-container {
    perspective: 1500px;
    width: 100%;
    max-width: 380px;
    aspect-ratio: 9 / 15.5;
    max-height: 90vh;
}

/* Card Container - Base para flip */
.success-stories .card-container {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 1.75rem;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.23, 1, 0.32, 1);
    cursor: pointer;
    will-change: transform;
}

/* Estado flipped - VERSÃO CORRIGIDA */
.success-stories .card-flip-container.flipped .card-container {
    transform: rotateY(180deg) !important;
}

/* Garantir que o tilt não interfira com o flip */
.success-stories .card-flip-container.flipped .card-container[data-tilt] {
    transform: rotateY(180deg) !important;
}

/* Card Faces - Frente e Verso */
.success-stories .card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 1.75rem;
    overflow: hidden;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    box-shadow:
        0 0 0 2px rgba(255, 107, 53, 0.4),
        0 0 25px 8px rgba(255, 107, 53, 0.15);
}

.success-stories .card-face:hover {
    box-shadow:
        0 0 0 3px rgba(255, 107, 53, 0.6),
        0 0 35px 12px rgba(255, 107, 53, 0.25);
}

/* Frente do Card */
.success-stories .card-front {
    background-size: cover;
    background-position: center;
    transform: rotateY(0deg);
}

/* Verso do Card */
.success-stories .card-back {
    background: linear-gradient(135deg, var(--gray-800) 0%, var(--gray-900) 100%);
    transform: rotateY(180deg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.success-stories .inner-border-overlay {
    position: absolute;
    inset: 14px;
    border-radius: 1.375rem;
    pointer-events: none;
    z-index: 10;
    box-shadow:
        inset 0.5px 0.5px 1.5px rgba(255, 138, 92, 0.6),
        inset -1px -1px 1px rgba(229, 90, 43, 0.5),
        inset 3px 3px 6px rgba(0, 0, 0, 0.25);
    transform: translateZ(30px);
    will-change: transform;
    border: 1px solid rgba(255, 107, 53, 0.1);
}

.success-stories .content-area {
    position: absolute;
    inset: 14px;
    border-radius: 1.375rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    z-index: 5;
    transform: translateZ(60px);
    will-change: transform;
    padding: 1rem 1.25rem 1.5rem;
}

.success-stories .elevation-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 107, 53, 0.9);
    border-radius: 9999px;
    padding: 0.5rem 1rem;
    color: var(--white);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.025em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transform: translateZ(70px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    z-index: 25;
    will-change: transform;
}

.success-stories .elevation-badge svg {
    width: 1em;
    height: 1em;
}

.success-stories .gradient-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 75%;
    background: linear-gradient(to top, rgba(10, 10, 10, 0.9) 0%, rgba(10, 10, 10, 0.65) 50%, transparent 100%);
    pointer-events: none;
    z-index: 15;
    transform: translateZ(5px);
    will-change: transform;
}

.success-stories .text-block {
    position: relative;
    z-index: 20;
    color: var(--white);
    text-align: center;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    transform: translateZ(25px);
    will-change: transform;
    font-family: 'Figtree', sans-serif;
}

.success-stories .text-block h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: 0.025em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    line-height: 1.2;
    color: #e2e8f0; /* Cinzento claro para melhor contraste */
    font-family: 'Figtree', sans-serif;
}

.success-stories .text-block p {
    color: #cbd5e1;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    font-weight: 400;
}

.success-stories .story-location {
    font-size: 0.8rem !important;
    color: rgba(203, 213, 225, 0.8) !important;
}

.success-stories .mountain-icon {
    width: 1.5em;
    height: 1.5em;
    fill: currentColor;
    opacity: 0.8;
    vertical-align: middle;
    margin-bottom: -0.1em;
}

.success-stories .tour-button {
    position: relative;
    z-index: 20;
    background: linear-gradient(145deg, var(--primary-orange), var(--primary-orange-dark));
    color: var(--white);
    font-weight: 600;
    padding: 0.75rem 1.75rem;
    border-radius: 9999px;
    text-align: center;
    width: auto;
    min-width: 190px;
    max-width: 85%;
    margin-left: auto;
    margin-right: auto;
    transition: all 0.3s ease;
    border: none;
    box-shadow:
        inset 2px 2px 4px rgba(255, 138, 92, 0.3),
        inset -2px -2px 4px rgba(229, 90, 43, 0.3),
        0 1px 2px rgba(0,0,0,0.1);
    transform: translateZ(40px);
    will-change: transform, box-shadow, background;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    letter-spacing: 0.025em;
    margin-top: 1rem;
    cursor: pointer;
}

.success-stories .tour-button:hover {
    background: linear-gradient(145deg, var(--primary-orange-light), var(--primary-orange));
    box-shadow:
        inset 2px 2px 5px rgba(255, 138, 92, 0.4),
        inset -2px -2px 5px rgba(229, 90, 43, 0.4),
        0 2px 4px rgba(0,0,0,0.15);
    transform: translateZ(40px) translateY(-2px);
}

.success-stories .tour-button:active {
    background: linear-gradient(145deg, var(--primary-orange-dark), var(--primary-orange));
    box-shadow:
        inset -2px -2px 4px rgba(255, 138, 92, 0.3),
        inset 2px 2px 4px rgba(229, 90, 43, 0.3),
        0 0 0 rgba(0,0,0,0);
    transform: translateZ(40px) translateY(0px);
}

/* ===== VERSO DO CARD - HISTÓRIA COMPLETA ===== */
.success-stories .story-content {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 2rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    color: var(--white);
    z-index: 20;
    transform: translateZ(30px);
}

.success-stories .back-button {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 107, 53, 0.9);
    color: var(--white);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    transform: translateZ(50px);
    z-index: 30;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.success-stories .back-button:hover {
    background: var(--primary-orange-light);
    transform: translateZ(50px) scale(1.1);
}

.success-stories .story-header {
    text-align: center;
    margin-bottom: 1.5rem;
    margin-top: 0.5rem;
}

.success-stories .story-header h2 {
    font-family: 'Figtree', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #e2e8f0; /* Cinzento claro para o nome no verso também */
}

.success-stories .story-transformation {
    color: var(--primary-orange);
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.success-stories .story-quote {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 1rem;
    padding: 1.2rem;
    margin: 1rem 0;
    font-style: italic;
    font-size: 0.9rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 107, 53, 0.3);
    position: relative;
    overflow: hidden;
    flex: 1;
    display: flex;
    align-items: center;
    font-family: 'Figtree', sans-serif;
}

.success-stories .story-quote::before {
    content: '"';
    position: absolute;
    top: -0.3rem;
    left: 0.8rem;
    font-size: 3rem;
    color: var(--primary-orange);
    opacity: 0.3;
    font-family: 'Playfair Display', serif;
}

/* Story Stats - Classes específicas para evitar conflito com hero stats */
.success-stories .story-stats {
    display: flex;
    justify-content: space-around;
    margin: 1rem 0;
    gap: 0.5rem;
}

.success-stories .stat {
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 0.8rem 0.3rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 107, 53, 0.2);
    flex: 1;
}

.success-stories .stat-number {
    display: block;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-orange);
    margin-bottom: 0.2rem;
}

.success-stories .stat-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.success-stories .story-footer {
    text-align: center;
    margin-top: 0.5rem;
}

.success-stories .story-footer span {
    display: block;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.8rem;
    margin-bottom: 0.2rem;
}

.success-stories .story-footer span:first-child {
    font-weight: 600;
    color: var(--primary-orange);
}

/* Responsive Design */
@media (max-width: 768px) {
    .success-stories .stories-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 0 1rem;
    }

    .success-stories .card-flip-container {
        max-width: 320px;
        max-height: 85vh;
    }

    .success-stories .text-block h1 {
        font-size: 1.5rem;
    }

    .success-stories .content-area {
        padding: 0.75rem 1rem 1.25rem;
    }

    .success-stories .tour-button {
        padding: 0.625rem 1.5rem;
        min-width: 160px;
        font-size: 0.9rem;
    }

    .success-stories .story-content {
        padding: 1rem;
    }

    .success-stories .story-header h2 {
        font-size: 1.5rem;
    }

    .success-stories .story-quote {
        padding: 1rem;
        font-size: 0.9rem;
    }

    .success-stories .story-stats {
        flex-direction: column;
        gap: 0.75rem;
    }
}

@media (max-width: 480px) {
    .success-stories .card-flip-container {
        max-width: 280px;
    }

    .success-stories .text-block h1 {
        font-size: 1.3rem;
        flex-direction: column;
        gap: 0.25rem;
    }

    .success-stories .mountain-icon {
        width: 1.2em;
        height: 1.2em;
    }

    .success-stories .story-content {
        padding: 0.75rem;
    }

    .success-stories .story-header {
        margin-top: 2rem;
    }

    .success-stories .back-button {
        padding: 0.375rem 0.75rem;
        font-size: 0.75rem;
    }
}
