* {
    font-family: 'Vazirmatn', sans-serif;
}

.font-vazir {
    font-family: 'Vazirmatn', sans-serif;
}

/* Owl Carousel RTL Styles */
.owl-carousel.owl-rtl {
    direction: rtl;
}

.owl-carousel.owl-rtl .owl-item {
    float: right;
}

/* Ensure the carousel container enforces single row */
/* Ensure the carousel container enforces single row */
.story-carousel {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    width: 100% !important;
    white-space: nowrap !important;
}

/* Ensure owl items stay in a single row */
.story-carousel .owl-item {
    display: inline-flex !important;
    width: auto !important;
    min-width: fit-content !important;
    flex-shrink: 0 !important;
    justify-content: center; /* Center the story items */
}

/* Story item styling */
.story-item {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0.5rem;
    transition: all 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    width: 88px; /* Fixed width to contain 80px image + padding */
    margin: 0 4px;
}

/* Story image styling */
.story-item img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    transition: all 0.3s ease;
    pointer-events: none;
    aspect-ratio: 1/1;
    flex-shrink: 0;
    display: block; /* Ensure proper rendering */
}

@media (min-width: 768px) {
    .story-item img {
        width: 5rem;
        height: 5rem;
    }
    .story-item {
        margin: 0 6px;
        width: 96px; /* Adjusted for larger image size */
    }
}

/* Mobile-specific styles */
@media (max-width: 768px) {
    .story-item img {
        width: 70px !important;
        height: 70px !important;
        border-radius: 50% !important;
    }
    .story-item {
        margin: 0 4px;
        width: 88px !important; /* Fixed width for mobile */
        flex: 0 0 auto; /* Prevent flexbox from resizing */
    }
    .story-carousel .owl-item {
        width: 88px !important; /* 80px image + 4px margin on each side */
        min-width: 88px !important;
    }
}

/* Swiper Customization */
.swiper-pagination-bullet {
    background: rgba(255, 255, 255, 0.5);
    opacity: 1;
}

.swiper-pagination-bullet-active {
    background: white;
}

.testimonial-swiper .swiper-pagination {
    bottom: -50px;
}

.packages-swiper .swiper-pagination {
    bottom: -50px !important;
    position: relative !important;
}

.packages-swiper .swiper-pagination-bullet {
    background: #9333ea !important;
    opacity: 0.5 !important;
    width: 12px !important;
    height: 12px !important;
}

.packages-swiper .swiper-pagination-bullet-active {
    background: #9333ea !important;
    opacity: 1 !important;
}

/* Background Pattern */
.bg-pattern {
    background-image: radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
}

/* Play Button Animation */
.teacher-video-btn {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
    }

    70% {
        box-shadow: 0 0 0 20px rgba(255, 255, 255, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
}

@media (max-width: 768px) {
    .story-swiper .swiper-slide {
        width: 20% !important;
        flex-shrink: 0;
    }

    .story-swiper .story-item img {
        width: 80px !important;
        height: 80px !important;
    }
}

/* Custom Scroll */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #9333ea, #ec4899);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #7c3aed, #db2777);
}

/* RTL Specific Styles */
.swiper-button-next {
    left: 10px;
    right: auto;
}

.swiper-button-prev {
    right: 10px;
    left: auto;
}

/* Story Swiper Spacing */
.story-swiper .swiper-slide {
    width: auto !important;
    margin-left: 8px;
}

@media (min-width: 768px) {
    .story-swiper .swiper-slide {
        margin-left: 12px;
    }
}

/* Teacher Video Hover Effects */
.teacher-video {
    transition: all 0.3s ease;
}

.teacher-video:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* Consultation Button Hover */
.consultation-btn {
    transition: all 0.3s ease;
}

.consultation-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(147, 51, 234, 0.3);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .story-item img {
        width: 3rem;
        height: 3rem;
    }

    .story-item span {
        font-size: 0.75rem;
    }

    h1 {
        font-size: 1.5rem !important;
        line-height: 2rem !important;
    }

    h2 {
        font-size: 1.25rem !important;
        line-height: 1.75rem !important;
    }

    h3 {
        font-size: 1.125rem !important;
        line-height: 1.5rem !important;
    }

    h4 {
        font-size: 1rem !important;
        line-height: 1.25rem !important;
    }

    p {
        font-size: 0.875rem !important;
        line-height: 1.25rem !important;
    }

    .text-lg {
        font-size: 0.875rem !important;
        line-height: 1.25rem !important;
    }

    .text-xl {
        font-size: 1rem !important;
        line-height: 1.25rem !important;
    }

    .text-2xl {
        font-size: 1.125rem !important;
        line-height: 1.5rem !important;
    }

    .text-3xl {
        font-size: 1.25rem !important;
        line-height: 1.75rem !important;
    }

    .text-4xl {
        font-size: 1.5rem !important;
        line-height: 2rem !important;
    }

    .text-5xl {
        font-size: 1.75rem !important;
        line-height: 2.25rem !important;
    }
}

/* Card Hover Effects */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Floating Animation */
.float {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }
}

/* Responsive Text Sizes */
@media (max-width: 640px) {
    .text-5xl {
        font-size: 2.25rem;
        line-height: 2.5rem;
    }

    .text-4xl {
        font-size: 1.875rem;
        line-height: 2.25rem;
    }

    .text-3xl {
        font-size: 1.5rem;
        line-height: 2rem;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Package Cards */
.packages-swiper .swiper-slide>div {
    position: relative;
}

/* Animation for elements coming into view */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Beautiful Video Modal Styles */
#videoModal {
    backdrop-filter: blur(10px);
}

#videoModal video {
    max-width: 100vw;
    max-height: 100vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 0;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

/* For vertical videos */
#videoModal video.vertical-video {
    max-height: 95vh;
    max-width: 60vw;
    width: auto !important;
    height: auto !important;
}

/* For horizontal videos */
#videoModal video.horizontal-video {
    max-width: 95vw;
    max-height: 90vh;
    width: auto !important;
    height: auto !important;
}

/* For square videos */
#videoModal video.square-video {
    max-width: 80vh;
    max-height: 80vh;
    width: auto !important;
    height: auto !important;
}

/* Video controls styling */
#videoModal video::-webkit-media-controls-panel {
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
}

#videoModal video::-webkit-media-controls-current-time-display,
#videoModal video::-webkit-media-controls-time-remaining-display {
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* Fullscreen styles */
#videoModal video:-webkit-full-screen {
    width: 100vw !important;
    height: 100vh !important;
    object-fit: contain !important;
    background: black;
}

#videoModal video:-moz-full-screen {
    width: 100vw !important;
    height: 100vh !important;
    object-fit: contain !important;
    background: black;
}

#videoModal video:fullscreen {
    width: 100vw !important;
    height: 100vh !important;
    object-fit: contain !important;
    background: black;
}

/* Mobile responsive */
@media (max-width: 768px) {
    #videoModal video.vertical-video {
        max-width: 95vw;
        max-height: 90vh;
    }

    #closeModal {
        top: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
    }
}

/* Loading indicator */
.video-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 18px;
    text-align: center;
}

.video-loading::after {
    content: '';
    width: 40px;
    height: 40px;
    margin: 20px auto;
    border: 3px solid transparent;
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: block;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Teacher Video Thumbnail Styles */
.teacher-thumbnail-container {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
    overflow: hidden;
}

.teacher-video-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.teacher-video-thumbnail.loaded {
    opacity: 1;
}

.teacher-thumbnail-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    text-align: center;
    z-index: 1;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px;
    border-radius: 8px;
}

.teacher-thumbnail-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 10px;
    text-align: center;
    z-index: 1;
    background: rgba(255, 0, 0, 0.7);
    padding: 8px;
    border-radius: 8px;
}

/* Error message styling */
.video-error {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    color: white;
    max-width: 400px;
    margin: 0 auto;
}

.video-error .error-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.7;
}

.video-error h3 {
    font-size: 24px;
    margin-bottom: 8px;
    font-weight: bold;
}

.video-error p {
    opacity: 0.8;
    font-size: 16px;
}

/* Video Thumbnail Styles */
.thumbnail-container {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
    border-radius: 50%;
    overflow: hidden;
}

.video-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-thumbnail.loaded {
    opacity: 1;
}

.thumbnail-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 10px;
    text-align: center;
    z-index: 2;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px;
    border-radius: 8px;
}

.thumbnail-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 8px;
    text-align: center;
    z-index: 2;
    background: rgba(255, 0, 0, 0.7);
    padding: 4px;
    border-radius: 4px;
}

/* Loading spinner */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 4px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Beautiful Divider Styles */
.divider-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.divider-wave {
    background: linear-gradient(45deg, #9333ea, #ec4899, #f59e0b);
}