/* 
 * Mobile success stories carousel optimization
 * Only applies to mobile, does not affect desktop
 */

/* Ensure normal display on desktop */
@media (min-width: 769px) {
    .success-stories-section,
    .stories-carousel,
    .story-slide,
    .story-card,
    .story-content,
    .story-image,
    .carousel-controls,
    .stories-container {
        /* Reset all possible mobile overrides */
        all: unset;
        /* Restore basic properties */
        display: initial;
        position: initial;
        box-sizing: border-box;
    }
}

/* Unified path page success stories display as moderately sized carousel format */
.success-stories-section .stories-carousel {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.success-stories-section .story-slide {
    display: none;
    width: 100%;
}

.success-stories-section .story-slide.active {
    display: block;
}

.success-stories-section .story-card {
    display: flex;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    min-height: 200px;
    max-height: 250px;
    box-shadow: none;
}

.success-stories-section .story-image {
    width: 35%;
    background-size: cover;
    background-position: center;
    min-height: 200px;
}

.success-stories-section .story-content {
    width: 65%;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.success-stories-section .story-content h4 {
    font-size: 1.2rem;
    margin-bottom: 0.8rem;
    color: #333;
    font-weight: 600;
    line-height: 1.3;
}

.success-stories-section .story-content p {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #666;
    margin-bottom: 1rem;
}

.success-stories-section .story-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #888;
    font-weight: 500;
}

.success-stories-section .carousel-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.success-stories-section .control-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: 2px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    color: #666;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.success-stories-section .control-btn:hover {
    background: #3498db;
    color: white;
    border-color: #3498db;
    transform: scale(1.05);
}

.success-stories-section .carousel-dots {
    display: flex;
    gap: 0.4rem;
}

.success-stories-section .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ddd;
    cursor: pointer;
    transition: all 0.3s ease;
}

.success-stories-section .dot.active {
    background: #3498db;
    transform: scale(1.2);
}

/* Mobile success stories overall optimization */
@media (max-width: 768px) {
    .success-stories-section {
        padding: 2rem 0;
        margin: 1rem 0;
    }
    
    .success-stories-section .container {
        padding: 0 1rem;
    }
    
    .success-stories-section h2,
    .success-stories-section .section-title {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
        text-align: center;
    }
    
    .success-stories-section p {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
        text-align: center;
    }
    
    /* Change to vertical layout on mobile */
    .success-stories-section .story-card {
        flex-direction: column;
        min-height: auto;
        max-height: 350px;
    }
    
    .success-stories-section .story-image {
        width: 100%;
        height: 150px;
    }
    
    .success-stories-section .story-content {
        width: 100%;
        padding: 1rem;
    }
    
    .success-stories-section .story-content h4 {
        font-size: 1.1rem;
    }
    
    .success-stories-section .story-content p {
        font-size: 0.9rem;
    }
    
    .success-stories-section .control-btn {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
}

/* Mobile carousel container optimization */
@media (max-width: 768px) {
    .success-stories-carousel,
    .stories-carousel {
        height: auto;
        max-height: 400px;
        overflow: hidden;
        border-radius: 8px;
        margin: 0 auto;
        position: relative;
    }
    
    .story-slide {
        height: auto;
        min-height: 350px;
        max-height: 400px;
        padding: 1.5rem;
        display: none;
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        background: white;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    
    .story-slide.active {
        display: flex;
    }
    
    .story-card {
        display: flex;
        flex-direction: column;
        height: 100%;
        background: white;
        border-radius: 8px;
        overflow: hidden;
    }
    
    .story-image {
        height: 150px;
        background-size: cover;
        background-position: center;
        border-radius: 8px 8px 0 0;
        flex-shrink: 0;
    }
}

/* Mobile story content optimization */
@media (max-width: 768px) {
    .story-content {
        padding: 1rem;
        flex-grow: 1;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
    
    .story-content h4 {
        font-size: 1.1rem;
        margin-bottom: 0.8rem;
        line-height: 1.3;
        color: #333;
        font-weight: 600;
    }
    
    .story-content .story-meta {
        font-size: 0.8rem;
        margin-bottom: 0.5rem;
        opacity: 0.8;
    }
    
    .story-content p {
        font-size: 0.9rem;
        line-height: 1.5;
        margin-bottom: 1rem;
        text-align: left;
        color: #666;
        flex-grow: 1;
    }
    
    .story-footer {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-top: auto;
        padding-top: 0.5rem;
        border-top: 1px solid #eee;
        font-size: 0.8rem;
        color: #888;
    }
    
    .story-highlight {
        font-size: 0.9rem;
        padding: 0.3rem 0.6rem;
        margin-top: 0.5rem;
        border-radius: 4px;
        background: #e8f4fd;
        color: #2c5282;
        font-weight: 600;
    }
}

/* Mobile navigation control optimization */
@media (max-width: 768px) {
    .carousel-navigation,
    .carousel-controls {
        margin-top: 1.5rem;
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 1.5rem;
    }
    
    .carousel-dots {
        display: flex;
        gap: 0.5rem;
    }
    
    .carousel-dot,
    .dot {
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background: #ddd;
        cursor: pointer;
        transition: all 0.2s ease;
    }
    
    .carousel-dot.active,
    .dot.active {
        background: #3498db;
        transform: scale(1.2);
    }
    
    .carousel-arrow,
    .control-btn,
    .prev-btn,
    .next-btn {
        width: 35px;
        height: 35px;
        border-radius: 50%;
        background: white;
        border: 2px solid #ddd;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        font-size: 1.1rem;
        color: #666;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    .carousel-arrow:hover,
    .control-btn:hover,
    .prev-btn:hover,
    .next-btn:hover {
        background: #f8f9fa;
        color: #3498db;
        border-color: #3498db;
    }
}

/* Small screen special optimization */
@media (max-width: 480px) {
    .success-stories-carousel,
    .stories-carousel {
        max-height: 380px;
    }
    
    .story-slide {
        min-height: 320px;
        max-height: 380px;
        padding: 1rem;
    }
    
    .story-image {
        height: 120px;
    }
    
    .story-content h4 {
        font-size: 1rem;
    }
    
    .story-content p {
        font-size: 0.85rem;
    }
    
    .story-footer {
        font-size: 0.75rem;
    }
}

/* Homepage success stories special handling */
@media (max-width: 768px) {
    .stories-container {
        position: relative;
        overflow: hidden;
    }
    
    .stories-track {
        display: flex;
        transition: transform 0.3s ease;
    }
    
    .stories-container .story-card {
        min-width: 100%;
        margin-right: 0;
        display: flex;
        flex-direction: column;
        background: white;
        border-radius: 8px;
        overflow: hidden;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    
    .arrow-buttons {
        display: flex;
        justify-content: center;
        gap: 1rem;
        margin-top: 1rem;
    }
    
    .arrow-btn {
        width: 35px;
        height: 35px;
        border-radius: 50%;
        background: white;
        border: 2px solid #ddd;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        font-size: 1.1rem;
        color: #666;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
}

/* Ensure carousel is visible on mobile */
@media (max-width: 768px) {
    .success-stories-section {
        display: block;
        visibility: visible;
        opacity: 1;
    }
    
    .success-stories-carousel,
    .stories-carousel {
        display: block;
        visibility: visible;
        opacity: 1;
    }
    
    .story-slide.active {
        display: flex;
        visibility: visible;
        opacity: 1;
    }
} 