/* assets/css/frontend-style.css */

/* ============================================
   کانتینر اصلی
   ============================================ */
.patient-reviews-wrapper {
    padding: 20px 0;
    direction: rtl;
}

.patient-reviews-title {
    text-align: center;
    margin-bottom: 30px;
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
}

/* ============================================
   گرید نمایش
   ============================================ */
.patient-reviews-grid {
    display: grid;
    gap: 20px;
}

.patient-reviews-grid.columns-1 { grid-template-columns: 1fr; }
.patient-reviews-grid.columns-2 { grid-template-columns: repeat(2, 1fr); }
.patient-reviews-grid.columns-3 { grid-template-columns: repeat(3, 1fr); }
.patient-reviews-grid.columns-4 { grid-template-columns: repeat(4, 1fr); }
.patient-reviews-grid.columns-5 { grid-template-columns: repeat(5, 1fr); }
.patient-reviews-grid.columns-6 { grid-template-columns: repeat(6, 1fr); }

/* ============================================
   آیتم نظر
   ============================================ */
.patient-review-item {
    position: relative;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.patient-review-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.patient-review-item.featured {
    border: 2px solid #ffb900;
}

/* حاشیه رنگی برای تمایز نوع */
.patient-review-item.video-item {
    border-top: 3px solid #667eea;
}

.patient-review-item.image-item {
    border-top: 3px solid #11998e;
}

/* ============================================
   بخش رسانه
   ============================================ */
.review-media {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: #f5f5f5;
    cursor: pointer;
}

.review-media[data-action="lightbox"] {
    cursor: zoom-in;
}

.image-wrapper,
.video-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.image-wrapper {
    cursor: pointer;
}

.image-wrapper:hover {
    cursor: zoom-in;
}

.review-media img,
.review-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.patient-review-item:hover .review-media img,
.patient-review-item:hover .review-media video {
    transform: scale(1.05);
}

/* گرادیانت روی رسانه */
.patient-review-item.video-item .review-media::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 60%, rgba(102, 126, 234, 0.1) 100%);
    pointer-events: none;
}

.patient-review-item.image-item .review-media::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 60%, rgba(17, 153, 142, 0.1) 100%);
    pointer-events: none;
}

/* ============================================
   آیکون بزرگنمایی
   ============================================ */
.zoom-icon {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 5;
}

.zoom-icon svg {
    width: 20px;
    height: 20px;
}

.patient-review-item:hover .zoom-icon {
    opacity: 1;
}

/* ============================================
   دکمه پخش ویدیو
   ============================================ */
.video-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(0,0,0,0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 5;
    border: none;
    padding: 0;
}

.video-play-button:hover {
    background: rgba(0,0,0,0.9);
    transform: translate(-50%, -50%) scale(1.1);
}

.video-play-button .play-icon {
    color: #fff;
    margin-right: -3px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-play-button svg {
    width: 28px;
    height: 28px;
}

/* ============================================
   نشانگر نوع رسانه
   ============================================ */
.media-type-indicator {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    z-index: 5;
}

.media-type-indicator svg {
    width: 18px;
    height: 18px;
}

.video-indicator {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.image-indicator {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

/* ============================================
   نشان ویژه
   ============================================ */
.featured-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    animation: pulse 2s infinite;
    z-index: 5;
}

.featured-badge svg {
    width: 18px;
    height: 18px;
}

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

/* ============================================
   بخش محتوا
   ============================================ */
.review-content {
    padding: 15px;
    position: relative;
}

.review-header {
    margin-bottom: 10px;
}

.patient-name {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}

/* ============================================
   لینک اینستاگرام
   ============================================ */
.instagram-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #e1306c;
    text-decoration: none;
    font-size: 13px;
    transition: color 0.3s ease;
}

.instagram-link:hover {
    color: #c13584;
}

.instagram-link svg {
    width: 16px;
    height: 16px;
}

/* ============================================
   نوع درمان
   ============================================ */
.treatment-type {
    margin-bottom: 10px;
}

.treatment-badge {
    display: inline-block;
    padding: 4px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

/* ============================================
   امتیاز ستاره‌ای
   ============================================ */
.review-rating {
    margin-bottom: 10px;
    direction: ltr;
    display: inline-block;
}

.review-rating .star {
    color: #ddd;
    font-size: 16px;
    transition: color 0.2s ease;
}

.review-rating .star.filled {
    color: #ffb900;
}

/* ============================================
   توضیحات
   ============================================ */
.review-description {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #666;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================
   پیام بدون نظر
   ============================================ */
.no-reviews {
    text-align: center;
    padding: 40px;
    background: #f9f9f9;
    border-radius: 12px;
    color: #666;
    font-size: 16px;
}

/* ============================================
   لایت‌باکس
   ============================================ */
.pr-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    direction: rtl;
}

.pr-lightbox.active {
    display: flex !important;
}

body.pr-lightbox-open {
    overflow: hidden !important;
}

/* اورلی */
.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* محتوای لایت‌باکس */
.lightbox-content {
    position: relative;
    z-index: 1;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* دکمه بستن */
.lightbox-close {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    line-height: 1;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: rotate(90deg);
}

/* دکمه‌های ناوبری */
.lightbox-prev,
.lightbox-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.lightbox-prev {
    left: auto;
    right: 20px;
}

.lightbox-next {
    right: auto;
    left: 20px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev svg,
.lightbox-next svg {
    width: 30px;
    height: 30px;
}

/* بخش رسانه لایت‌باکس */
.lightbox-media {
    max-width: 85vw;
    max-height: 70vh;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-media img {
    max-width: 100%;
    max-height: 70vh;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
}

.lightbox-media video {
    max-width: 100%;
    max-height: 70vh;
    width: auto;
    height: auto;
    display: block;
    background: #000;
}

/* اطلاعات لایت‌باکس */
.lightbox-info {
    margin-top: 20px;
    text-align: center;
    color: #fff;
    max-width: 600px;
    padding: 0 20px;
}

.lightbox-info .patient-name {
    color: #fff;
    font-size: 20px;
    margin: 0 0 10px 0;
    font-weight: 600;
}

.lightbox-info .instagram-link {
    color: #e1306c;
    text-decoration: none;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 10px;
}

.lightbox-info .instagram-link:hover {
    text-decoration: underline;
}

.lightbox-info .treatment-type {
    margin: 10px 0;
}

.lightbox-info .treatment-badge {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.lightbox-info .review-rating {
    margin: 10px 0;
}

.lightbox-info .review-rating .star {
    font-size: 20px;
}

.lightbox-info .review-description {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    line-height: 1.7;
    margin: 10px 0 0 0;
    -webkit-line-clamp: unset;
    display: block;
    overflow: visible;
}

/* ============================================
   انیمیشن‌های ورود
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.patient-review-item {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
}

.patient-review-item:nth-child(1) { animation-delay: 0.1s; }
.patient-review-item:nth-child(2) { animation-delay: 0.15s; }
.patient-review-item:nth-child(3) { animation-delay: 0.2s; }
.patient-review-item:nth-child(4) { animation-delay: 0.25s; }
.patient-review-item:nth-child(5) { animation-delay: 0.3s; }
.patient-review-item:nth-child(6) { animation-delay: 0.35s; }
.patient-review-item:nth-child(7) { animation-delay: 0.4s; }
.patient-review-item:nth-child(8) { animation-delay: 0.45s; }
.patient-review-item:nth-child(n+9) { animation-delay: 0.5s; }

/* ============================================
   Lazy Load
   ============================================ */
.review-media img.lazy {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.review-media img.lazy.loaded,
.review-media img.loaded {
    animation: none;
    background: none;
}

/* ============================================
   فیلتر تب‌ها
   ============================================ */
.reviews-filter {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 25px;
    border: 2px solid #e0e0e0;
    background: #fff;
    border-radius: 30px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    font-family: inherit;
}

.filter-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.filter-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    color: #fff;
}

.filter-btn.video-filter.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.filter-btn.image-filter.active {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

/* ============================================
   ریسپانسیو - تبلت
   ============================================ */
@media (max-width: 1200px) {
    .patient-reviews-grid.columns-6 { 
        grid-template-columns: repeat(4, 1fr); 
    }
    .patient-reviews-grid.columns-5 { 
        grid-template-columns: repeat(4, 1fr); 
    }
}

@media (max-width: 992px) {
    .patient-reviews-grid.columns-6,
    .patient-reviews-grid.columns-5,
    .patient-reviews-grid.columns-4 { 
        grid-template-columns: repeat(3, 1fr); 
    }
    
    .patient-reviews-title {
        font-size: 24px;
    }
}

/* ============================================
   ریسپانسیو - موبایل
   ============================================ */
@media (max-width: 768px) {
    .patient-reviews-grid.columns-6,
    .patient-reviews-grid.columns-5,
    .patient-reviews-grid.columns-4,
    .patient-reviews-grid.columns-3 { 
        grid-template-columns: repeat(2, 1fr); 
    }
    
    .patient-reviews-grid {
        gap: 15px;
    }
    
    .patient-reviews-title {
        font-size: 22px;
        margin-bottom: 20px;
    }
    
    /* لایت‌باکس موبایل */
    .lightbox-close {
        top: 15px;
        right: 15px;
        width: 44px;
        height: 44px;
        font-size: 28px;
    }
    
    .lightbox-prev {
        right: 15px;
    }
    
    .lightbox-next {
        left: 15px;
    }
    
    .lightbox-prev,
    .lightbox-next {
        width: 44px;
        height: 44px;
    }
    
    .lightbox-prev svg,
    .lightbox-next svg {
        width: 24px;
        height: 24px;
    }
    
    .lightbox-media {
        max-width: 95vw;
        max-height: 60vh;
        border-radius: 8px;
    }
    
    .lightbox-media img,
    .lightbox-media video {
        max-height: 60vh;
    }
    
    .lightbox-info {
        padding: 0 15px;
        margin-top: 15px;
    }
    
    .lightbox-info .patient-name {
        font-size: 18px;
    }
    
    .lightbox-info .review-description {
        font-size: 13px;
    }
}

@media (max-width: 576px) {
    .patient-reviews-wrapper {
        padding: 15px 0;
    }
    
    .patient-reviews-grid.columns-6,
    .patient-reviews-grid.columns-5,
    .patient-reviews-grid.columns-4,
    .patient-reviews-grid.columns-3,
    .patient-reviews-grid.columns-2 { 
        grid-template-columns: 1fr; 
    }
    
    .patient-reviews-grid {
        gap: 12px;
    }
    
    .patient-reviews-title {
        font-size: 20px;
    }
    
    .patient-review-item {
        border-radius: 10px;
    }
    
    .review-media {
        aspect-ratio: 4/3;
    }
    
    .video-play-button {
        width: 50px;
        height: 50px;
    }
    
    .video-play-button svg {
        width: 22px;
        height: 22px;
    }
    
    .media-type-indicator {
        width: 28px;
        height: 28px;
    }
    
    .media-type-indicator svg {
        width: 14px;
        height: 14px;
    }
    
    .featured-badge {
        width: 28px;
        height: 28px;
    }
    
    .featured-badge svg {
        width: 14px;
        height: 14px;
    }
    
    .zoom-icon {
        width: 32px;
        height: 32px;
    }
    
    .zoom-icon svg {
        width: 16px;
        height: 16px;
    }
    
    .review-content {
        padding: 12px;
    }
    
    .patient-name {
        font-size: 15px;
    }
    
    .instagram-link {
        font-size: 12px;
    }
    
    .treatment-badge {
        font-size: 11px;
        padding: 3px 10px;
    }
    
    .review-rating .star {
        font-size: 14px;
    }
    
    .review-description {
        font-size: 13px;
        -webkit-line-clamp: 2;
    }
    
    /* لایت‌باکس موبایل کوچک */
    .lightbox-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
    
    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
        top: auto;
        bottom: 100px;
        transform: none;
    }
    
    .lightbox-prev {
        right: 60px;
        left: auto;
    }
    
    .lightbox-next {
        left: auto;
        right: 10px;
    }
    
    .lightbox-media {
        max-height: 50vh;
        border-radius: 6px;
    }
    
    .lightbox-media img,
    .lightbox-media video {
        max-height: 50vh;
    }
    
    .lightbox-info .patient-name {
        font-size: 16px;
    }
    
    .lightbox-info .review-rating .star {
        font-size: 18px;
    }
}

/* ============================================
   فیلتر تب‌ها - ریسپانسیو
   ============================================ */
@media (max-width: 576px) {
    .reviews-filter {
        gap: 8px;
    }
    
    .filter-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* ============================================
   پشتیبانی از حالت تاریک (اختیاری)
   ============================================ */
@media (prefers-color-scheme: dark) {
    .patient-review-item {
        background: #2a2a2a;
    }
    
    .patient-name {
        color: #f0f0f0;
    }
    
    .review-description {
        color: #b0b0b0;
    }
    
    .review-media {
        background: #333;
    }
    
    .no-reviews {
        background: #2a2a2a;
        color: #b0b0b0;
    }
}

/* ============================================
   پشتیبانی از کاهش حرکت
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .patient-review-item {
        animation: none;
        opacity: 1;
    }
    
    .patient-review-item:hover {
        transform: none;
    }
    
    .patient-review-item:hover .review-media img,
    .patient-review-item:hover .review-media video {
        transform: none;
    }
    
    .featured-badge {
        animation: none;
    }
    
    .review-media img.lazy {
        animation: none;
    }
    
    .lightbox-close:hover {
        transform: none;
    }
    
    .lightbox-prev:hover,
    .lightbox-next:hover {
        transform: translateY(-50%);
    }
}

/* ============================================
   پرینت
   ============================================ */
@media print {
    .patient-reviews-wrapper {
        padding: 0;
    }
    
    .patient-reviews-grid {
        display: block;
    }
    
    .patient-review-item {
        break-inside: avoid;
        page-break-inside: avoid;
        margin-bottom: 20px;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .video-play-button,
    .zoom-icon,
    .media-type-indicator,
    .pr-lightbox {
        display: none !important;
    }
    
    .review-media {
        aspect-ratio: auto;
        height: auto;
    }
    
    .review-media img {
        height: auto;
        max-height: 200px;
    }
}