/* Success Stories Uniform Height Styling */

/* Main success story card container */
.success-story-card {
    min-height: 480px;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: all 0.3s ease;
    border-radius: 15px;
    overflow: hidden;
}

/* Card body with flexible layout */
.success-story-card .card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 1.5rem;
}

/* Before/After images container */
.success-story-card .row.mb-3 {
    flex-shrink: 0;
    margin-bottom: 1rem !important;
}

/* Before/After images styling */
.success-story-card .img-thumbnail {
    width: 90px !important;
    height: 70px !important;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.success-story-card .img-thumbnail:hover {
    transform: scale(1.05);
    border-color: #4CAF50;
}

/* Patient name styling */
.success-story-card .card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    flex-shrink: 0;
}

/* Treatment type badge */
.success-story-card .treatment-type {
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    margin-bottom: 1rem;
    flex-shrink: 0;
}

/* Testimonial/Description content */
.success-story-card .testimonial {
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    min-height: 6rem;
}

.success-story-card .testimonial em {
    font-style: normal;
    color: #555;
}

/* Meta information container */
.success-story-card .meta-info {
    margin-top: auto;
    flex-shrink: 0;
}

.success-story-card .small {
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Featured ribbon styling */
.success-story-card .featured-ribbon {
    position: absolute;
    top: 20px;
    right: -35px;
    background: linear-gradient(45deg, #ffc107, #ff9800);
    color: white;
    padding: 8px 40px;
    font-size: 0.75rem;
    font-weight: 700;
    transform: rotate(45deg);
    transform-origin: center;
    z-index: 10;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
    white-space: nowrap;
    text-align: center;
    min-width: 120px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.success-story-card .featured-ribbon span {
    display: inline-block;
    font-weight: 700;
}

/* Hover effects */
.success-story-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(76, 175, 80, 0.15);
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .success-story-card {
        min-height: 450px;
    }
    
    .success-story-card .testimonial {
        -webkit-line-clamp: 3;
        min-height: 4.5rem;
    }
    
    .success-story-card .featured-ribbon {
        top: 18px;
        right: -32px;
        padding: 6px 35px;
        font-size: 0.7rem;
        min-width: 110px;
    }
}

@media (max-width: 768px) {
    .success-story-card {
        min-height: 420px;
    }
    
    .success-story-card .card-body {
        padding: 1.25rem;
    }
    
    .success-story-card .img-thumbnail {
        width: 80px !important;
        height: 60px !important;
    }
    
    .success-story-card .testimonial {
        font-size: 0.9rem;
        -webkit-line-clamp: 3;
        min-height: 4rem;
    }
    
    .success-story-card .featured-ribbon {
        top: 15px;
        right: -30px;
        padding: 5px 30px;
        font-size: 0.65rem;
        min-width: 100px;
    }
}

@media (max-width: 576px) {
    .success-story-card {
        min-height: 380px;
    }
    
    .success-story-card .card-body {
        padding: 1rem;
    }
    
    .success-story-card .img-thumbnail {
        width: 70px !important;
        height: 55px !important;
    }
    
    .success-story-card .testimonial {
        font-size: 0.85rem;
        -webkit-line-clamp: 2;
        min-height: 3rem;
    }
    
    .success-story-card .card-title {
        font-size: 1rem;
    }
    
    .success-story-card .small {
        font-size: 0.8rem;
    }
    
    .success-story-card .featured-ribbon {
        top: 12px;
        right: -28px;
        padding: 4px 25px;
        font-size: 0.6rem;
        min-width: 90px;
    }
}

/* Loading animation for better UX */
.success-story-card.loading {
    opacity: 0.7;
    pointer-events: none;
}

.success-story-card.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #4CAF50;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Enhanced visual consistency */
.success-story-card .text-success {
    color: #4CAF50 !important;
}

.success-story-card .bg-light {
    background-color: #f8f9fa !important;
    border: 1px solid #e9ecef;
}

/* Quote icon styling */
.success-story-card .fa-quote-left {
    font-size: 1rem;
    opacity: 0.7;
}

/* Ensure consistent spacing */
.success-story-card .mb-1 {
    margin-bottom: 0.25rem !important;
}

.success-story-card .mb-2 {
    margin-bottom: 0.5rem !important;
}