/* Aparat Channel Elementor Widget Styles */

.aparat-channel-container {
    width: 100%;
    margin: 0 auto;
}

/* Grid Layout Styles */
.aparat-channel-grid {
    display: grid;
    gap: 25px;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    padding: 10px;
}

/* Video Item Styles */
.aparat-video-item {
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.aparat-video-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 40px rgba(0, 124, 186, 0.15);
    border-color: rgba(0, 124, 186, 0.2);
}

.aparat-video-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #007cba, #00a0d2, #0073aa);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.aparat-video-item:hover::before {
    opacity: 1;
}

/* Video Embed Styles */
.aparat-video-embed {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    overflow: hidden;
    border-radius: 12px 12px 0 0;
}

.aparat-video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 12px 12px 0 0;
}

/* Video Info Styles */
.aparat-video-info {
    padding: 20px;
    background: linear-gradient(180deg, #ffffff, #fafbfc);
}

.aparat-video-title {
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 12px 0;
    color: #1a1a1a;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
}

.aparat-video-item:hover .aparat-video-title {
    color: #007cba;
}

.aparat-video-description {
    font-size: 14px;
    color: #6c757d;
    margin: 0;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    opacity: 0.9;
}

/* Pagination Styles */
.aparat-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin: 50px auto 30px;
    padding: 25px 30px;
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    border-radius: 25px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: fit-content;
}

/* Page Number Buttons */
.aparat-pagination a,
.aparat-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: 48px;
    padding: 0;
    text-decoration: none;
    border: 2px solid #e9ecef;
    border-radius: 50%;
    color: #6c757d;
    font-size: 16px;
    font-weight: 700;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    position: relative;
    overflow: hidden;
}

/* Ripple Effect */
.aparat-pagination a::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(0, 124, 186, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.aparat-pagination a:active::after {
    width: 120%;
    height: 120%;
}

/* Hover Effects for Page Numbers */
.aparat-pagination a:hover {
    background: linear-gradient(145deg, #007cba, #0073aa);
    color: white;
    border-color: #007cba;
    transform: translateY(-4px) scale(1.1);
    box-shadow: 
        0 12px 24px rgba(0, 124, 186, 0.4),
        0 0 0 4px rgba(0, 124, 186, 0.1);
}

/* Current Page Styling */
.aparat-pagination-current {
    background: linear-gradient(145deg, #007cba, #0073aa) !important;
    color: white !important;
    border-color: #007cba !important;
    box-shadow: 
        0 8px 20px rgba(0, 124, 186, 0.5),
        0 0 0 4px rgba(0, 124, 186, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
    transform: scale(1.15);
    position: relative;
}

.aparat-pagination-current::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #007cba, #00a0d2, #0073aa);
    border-radius: 50%;
    z-index: -1;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

/* Navigation Buttons (Previous/Next) */
.aparat-pagination-prev,
.aparat-pagination-next {
    min-width: 120px;
    height: 52px;
    padding: 0 24px;
    font-weight: 700;
    font-size: 15px;
    background: linear-gradient(145deg, #6c757d, #495057);
    color: white;
    border-radius: 26px;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.aparat-pagination-prev::before,
.aparat-pagination-next::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s;
}

.aparat-pagination-prev:hover::before,
.aparat-pagination-next:hover::before {
    left: 100%;
}

.aparat-pagination-prev:hover,
.aparat-pagination-next:hover {
    background: linear-gradient(145deg, #007cba, #0073aa);
    border-color: #007cba;
    transform: translateY(-4px) scale(1.05);
    box-shadow: 
        0 12px 28px rgba(0, 124, 186, 0.4),
        0 0 0 4px rgba(0, 124, 186, 0.1);
}

/* Arrow Icons */
.aparat-pagination-prev::after,
.aparat-pagination-next::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 8px;
    height: 8px;
    border: 2px solid currentColor;
    border-right: none;
    border-bottom: none;
    transition: transform 0.3s ease;
}

.aparat-pagination-prev::after {
    left: 20px;
    transform: translateY(-50%) rotate(-45deg);
}

.aparat-pagination-next::after {
    right: 20px;
    transform: translateY(-50%) rotate(135deg);
}

.aparat-pagination-prev:hover::after {
    transform: translateY(-50%) rotate(-45deg) translateX(-2px);
}

.aparat-pagination-next:hover::after {
    transform: translateY(-50%) rotate(135deg) translateX(2px);
}

/* Carousel Layout Styles */
.aparat-channel-carousel {
    position: relative;
}

.aparat-channel-carousel .swiper-container {
    width: 100%;
    overflow: hidden;
    padding: 0 0 40px 0;
}

.aparat-channel-carousel .swiper-wrapper {
    display: flex;
    align-items: stretch;
}

.aparat-channel-carousel .swiper-slide {
    height: auto;
    display: flex;
    flex-direction: column;
}

.aparat-channel-carousel .swiper-slide .aparat-video-item {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.aparat-channel-carousel .aparat-video-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Full-size video embed for carousel (no info) */
.aparat-video-embed-full {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    overflow: hidden;
    border-radius: 8px;
}

.aparat-video-embed-full iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 8px;
}

/* Navigation Styles */
.aparat-channel-carousel .swiper-button-next,
.aparat-channel-carousel .swiper-button-prev {
    color: #007cba;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    margin-top: -20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.aparat-channel-carousel .swiper-button-next:hover,
.aparat-channel-carousel .swiper-button-prev:hover {
    background: #007cba;
    color: white;
    transform: scale(1.1);
}

.aparat-channel-carousel .swiper-button-next::after,
.aparat-channel-carousel .swiper-button-prev::after {
    font-size: 16px;
    font-weight: bold;
}

/* Pagination Styles */
.aparat-channel-carousel .swiper-pagination {
    bottom: 10px;
    text-align: center;
}

.aparat-channel-carousel .swiper-pagination-bullet {
    background: #ccc;
    opacity: 1;
    margin: 0 4px;
    transition: all 0.3s ease;
}

.aparat-channel-carousel .swiper-pagination-bullet-active {
    background: #007cba;
    transform: scale(1.2);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .aparat-channel-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 15px;
    }
    
    .aparat-video-info {
        padding: 12px;
    }
    
    .aparat-video-title {
        font-size: 15px;
    }
    
    .aparat-video-description {
        font-size: 13px;
    }
}

@media (max-width: 768px) {
    .aparat-channel-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 12px;
    }
    
    .aparat-channel-carousel .swiper-button-next,
    .aparat-channel-carousel .swiper-button-prev {
        width: 35px;
        height: 35px;
        margin-top: -17.5px;
    }
    
    .aparat-channel-carousel .swiper-button-next::after,
    .aparat-channel-carousel .swiper-button-prev::after {
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    .aparat-pagination {
        gap: 8px;
        padding: 20px 15px;
        margin: 40px auto 20px;
        border-radius: 20px;
    }
    
    .aparat-pagination a,
    .aparat-pagination span {
        min-width: 42px;
        height: 42px;
        font-size: 15px;
    }
    
    .aparat-pagination-prev,
    .aparat-pagination-next {
        min-width: 100px;
        height: 46px;
        padding: 0 20px;
        font-size: 14px;
        border-radius: 23px;
    }
    
    .aparat-pagination-prev::after {
        left: 16px;
    }
    
    .aparat-pagination-next::after {
        right: 16px;
    }
}

@media (max-width: 480px) {
    .aparat-channel-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 5px;
    }
    
    .aparat-video-item {
        border-radius: 12px;
    }
    
    .aparat-video-info {
        padding: 15px;
    }
    
    .aparat-video-title {
        font-size: 15px;
    }
    
    .aparat-video-description {
        font-size: 13px;
        -webkit-line-clamp: 2;
    }
    
    .aparat-pagination {
        gap: 6px;
        padding: 15px 10px;
        margin: 30px auto 15px;
        border-radius: 18px;
        flex-wrap: wrap;
    }
    
    .aparat-pagination a,
    .aparat-pagination span {
        min-width: 38px;
        height: 38px;
        font-size: 14px;
        font-weight: 600;
    }
    
    .aparat-pagination-current {
        transform: scale(1.1) !important;
    }
    
    .aparat-pagination-prev,
    .aparat-pagination-next {
        min-width: 80px;
        height: 40px;
        padding: 0 16px;
        font-size: 13px;
        border-radius: 20px;
        order: -1;
        margin-bottom: 8px;
    }
    
    .aparat-pagination-prev::after {
        left: 12px;
        width: 6px;
        height: 6px;
    }
    
    .aparat-pagination-next::after {
        right: 12px;
        width: 6px;
        height: 6px;
    }
    
    .aparat-channel-carousel .swiper-button-next,
    .aparat-channel-carousel .swiper-button-prev {
        display: none;
    }
}

/* Extra Small Devices (phones, 480px and down) */
@media (max-width: 480px) {
    .aparat-channel-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 5px;
    }
    
    .aparat-video-item {
        border-radius: 10px;
    }
    
    .aparat-video-info {
        padding: 12px;
    }
    
    .aparat-video-title {
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    .aparat-video-description {
        font-size: 12px;
        line-height: 1.5;
    }
    
    .aparat-pagination {
        gap: 4px;
        padding: 15px 5px;
        margin-top: 25px;
        border-radius: 12px;
    }
    
    .aparat-pagination a,
    .aparat-pagination span {
        min-width: 36px;
        height: 36px;
        padding: 0 8px;
        font-size: 13px;
        border-radius: 8px;
    }
    
    .aparat-pagination-prev,
    .aparat-pagination-next {
        padding: 0 12px;
        border-radius: 18px;
        font-size: 12px;
    }
}

/* RTL Support */
.rtl .aparat-channel-carousel .swiper-button-next {
    left: 10px;
    right: auto;
}

.rtl .aparat-channel-carousel .swiper-button-prev {
    right: 10px;
    left: auto;
}

/* Loading State */
.aparat-video-item.loading {
    opacity: 0.7;
    pointer-events: none;
}

.aparat-video-item.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Error State */
.aparat-channel-error {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 16px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #ddd;
}

/* Dark Theme Support */
@media (prefers-color-scheme: dark) {
    .aparat-video-item {
        background: #2c2c2c;
        color: #fff;
    }
    
    .aparat-video-title {
        color: #fff;
    }
    
    .aparat-video-description {
        color: #ccc;
    }
    
    .aparat-channel-carousel .swiper-button-next,
    .aparat-channel-carousel .swiper-button-prev {
        background: rgba(44, 44, 44, 0.9);
        color: #007cba;
    }
    
    .aparat-channel-carousel .swiper-button-next:hover,
    .aparat-channel-carousel .swiper-button-prev:hover {
        background: #007cba;
        color: white;
    }
}