/**
 * Mobile Phone Specifications - Video Display CSS
 * ملف تنسيق عرض الفيديوهات للهواتف المحمولة
 * 
 * @package Mobile Phone Specifications
 * @version 1.0.3
 */

/* ===== Video Gallery Container ===== */
.phone-videos-gallery {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%) !important;
    border-radius: 16px !important;
    padding: 35px !important;
    margin: 30px auto !important;
    max-width: 1200px !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.08) !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
}

.phone-videos-title {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 30px;
    text-align: center;
    position: relative;
    padding-bottom: 15px;
}

.phone-videos-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #1976d2, #42a5f5);
    border-radius: 2px;
}

/* ===== Video Grid Layout ===== */
.phone-videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 25px;
    width: 100%;
    max-width: 100%;
}

/* ===== Individual Video Item ===== */
.phone-video-item {
    background: #ffffff !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    box-shadow: 0 6px 24px rgba(0,0,0,0.08) !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border: 1px solid rgba(0,0,0,0.04) !important;
    position: relative !important;
}

.phone-video-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(25,118,210,0.02) 0%, rgba(66,165,245,0.02) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    border-radius: 16px;
}

.phone-video-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 48px rgba(0,0,0,0.12);
}

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

/* ===== Video Container ===== */
.phone-video-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border-radius: 12px 12px 0 0;
    overflow: hidden;
    max-width: 100%;
}

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

/* ===== Video Content Info ===== */
.phone-video-content {
    padding: 24px;
    background: #ffffff;
}

.phone-video-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 50px;
}

.phone-video-description {
    font-size: 15px;
    color: #5a5a5a;
    line-height: 1.6;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 72px;
}

/* ===== Video Type Badge ===== */
.phone-video-type {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    position: relative;
    overflow: hidden;
}

.phone-video-type::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.5s ease;
}

.phone-video-item:hover .phone-video-type::before {
    left: 100%;
}

.phone-video-type.youtube {
    background: linear-gradient(135deg, #ff0000 0%, #cc0000 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(255,0,0,0.2);
}

.phone-video-type.uploaded {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(40,167,69,0.2);
}

/* ===== Responsive Design ===== */

/* Large screens (desktops) */
@media (min-width: 1200px) {
    .phone-videos-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
        max-width: 1000px;
        margin: 0 auto;
    }
    
    .phone-videos-gallery {
        padding: 30px;
        max-width: 1100px;
    }
    
    .phone-video-container {
        padding-bottom: 50%; /* تقليل الارتفاع للشاشات الكبيرة */
    }
}

/* Medium screens (tablets) */
@media (max-width: 768px) {
    .phone-videos-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 10px;
    }
    
    .phone-videos-gallery {
        padding: 20px 15px;
        margin: 15px 5px;
        border-radius: 12px;
    }
    
    .phone-videos-title {
        font-size: 22px;
        margin-bottom: 18px;
    }
    
    .phone-video-container {
        padding-bottom: 56.25%; /* الحفاظ على نسبة 16:9 للتابلت */
    }
    
    .phone-video-content {
        padding: 18px;
    }
    
    .phone-video-title {
        font-size: 16px;
        min-height: 44px;
    }
    
    .phone-video-description {
        font-size: 14px;
        min-height: 60px;
    }
}

/* Small screens (mobile phones) */
@media (max-width: 480px) {
    .phone-videos-gallery {
        padding: 15px 10px;
        margin: 10px 5px;
        border-radius: 10px;
    }
    
    .phone-videos-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 0;
    }
    
    .phone-videos-title {
        font-size: 20px;
        margin-bottom: 15px;
    }
    
    .phone-video-container {
        border-radius: 8px 8px 0 0;
        padding-bottom: 60%; /* زيادة طفيفة للموبايل لتحسين المشاهدة */
    }
    
    .phone-video-content {
        padding: 15px;
    }
    
    .phone-video-title {
        font-size: 15px;
        margin-bottom: 8px;
        min-height: 36px;
    }
    
    .phone-video-description {
        font-size: 13px;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        min-height: 36px;
        margin-bottom: 12px;
    }
    
    .phone-video-type {
        font-size: 11px;
        padding: 5px 10px;
    }
}

/* ===== Loading State ===== */
.phone-video-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    background: #f0f0f0;
    border-radius: 8px;
    color: #666;
    font-size: 14px;
}

.phone-video-loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-top: 2px solid #1976d2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

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

/* ===== Error State ===== */
.phone-video-error {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    background: #fff5f5;
    border: 1px solid #fed7d7;
    border-radius: 8px;
    color: #c53030;
    font-size: 14px;
    text-align: center;
}

/* ===== Empty State ===== */
.phone-videos-empty {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.phone-videos-empty h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #333;
}

.phone-videos-empty p {
    font-size: 14px;
    line-height: 1.5;
}

/* ===== Accessibility ===== */
.phone-video-item:focus-within {
    outline: 2px solid #1976d2;
    outline-offset: 2px;
}

.phone-video-container:focus-within {
    outline: 2px solid #1976d2;
    outline-offset: -2px;
}

/* ===== Print Styles ===== */
@media print {
    .phone-videos-gallery {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .phone-video-container {
        height: 200px;
        padding-bottom: 0;
        background: #f0f0f0;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .phone-video-container::after {
        content: 'فيديو - غير متاح في الطباعة';
        color: #666;
        font-size: 14px;
    }
    
    .phone-video-container iframe,
    .phone-video-container video {
        display: none;
    }
}

/* ===== RTL Support ===== */
[dir="rtl"] .phone-video-content {
    text-align: right;
}

[dir="rtl"] .phone-video-type {
    float: left;
}

/* ===== Dark Mode Support ===== */
@media (prefers-color-scheme: dark) {
    .phone-videos-gallery {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .phone-videos-title {
        color: #e2e8f0;
        border-bottom-color: #4299e1;
    }
    
    .phone-video-item {
        background: #4a5568;
    }
    
    .phone-video-title {
        color: #e2e8f0;
    }
    
    .phone-video-description {
        color: #a0aec0;
    }
    
    .phone-video-loading {
        background: #4a5568;
        color: #a0aec0;
    }
    
    .phone-videos-empty {
        color: #a0aec0;
    }
    
    .phone-videos-empty h3 {
        color: #e2e8f0;
    }
}
