/* ==========================================================================
   عدسة الميدان - Media Center Stylesheet (Desktop-First Modern Design)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Hero Header Section
   -------------------------------------------------------------------------- */
.media-hero {
    position: relative;
    width: 100%;
    min-height: 380px;
    background: linear-gradient(180deg, rgba(8, 30, 52, 0.88) 0%, rgba(15, 52, 88, 0.92) 100%), 
                url('/static/images/media/photos/صورة الهيدر بدون كتابة.png') center center / cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #ffffff;
    padding: 60px 20px;
    margin-bottom: 40px;
    overflow: hidden;
}

.media-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(to top, #ffffff, transparent);
    pointer-events: none;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

/* Golden Camera Icon Frame */
.camera-badge-frame {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 52px;
    position: relative;
    margin-bottom: 20px;
}

.camera-badge-frame i {
    font-size: 2rem;
    color: #dfa835;
}

.camera-badge-frame::before,
.camera-badge-frame::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border-color: #dfa835;
    border-style: solid;
}

.camera-badge-frame::before {
    top: 0;
    right: 0;
    border-width: 2px 2px 0 0;
}

.camera-badge-frame::after {
    bottom: 0;
    left: 0;
    border-width: 0 0 2px 2px;
}

.media-hero h1 {
    font-size: 3.2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 16px;
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.media-hero p {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    font-weight: 400;
}

/* --------------------------------------------------------------------------
   2. Field Categories Grid ("استكشف أعمالنا حسب المجال")
   -------------------------------------------------------------------------- */
.section-divider-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 40px 0 30px;
    font-size: 1.5rem;
    font-weight: 800;
    color: #0b3a60;
    text-align: center;
}

.section-divider-title::before,
.section-divider-title::after {
    content: '';
    height: 2px;
    flex: 1;
    max-width: 120px;
    background: linear-gradient(90deg, transparent, #dfa835, transparent);
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
    margin-bottom: 40px;
}

.category-card {
    position: relative;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px 14px;
    text-align: center;
    text-decoration: none !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 170px;
    cursor: pointer;
}

.category-card:hover {
    transform: translateY(-4px);
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(11, 58, 96, 0.08);
    border-color: #0b3a60;
}

.category-card.active {
    background: #fffcf4;
    border: 2px solid #dfa835;
    box-shadow: 0 8px 24px rgba(223, 168, 53, 0.15);
}

.active-check-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 22px;
    height: 22px;
    background: #dfa835;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

.category-icon-wrapper {
    width: 52px;
    height: 52px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-icon-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.category-card h3 {
    font-size: 1.05rem;
    font-weight: 800;
    color: #0b3a60;
    margin-bottom: 6px;
}

.category-card p {
    font-size: 0.8rem;
    color: #64748b;
    margin: 0;
    line-height: 1.3;
}

/* --------------------------------------------------------------------------
   3. Media Controls Bar (Pill Switcher & Sorting)
   -------------------------------------------------------------------------- */
.media-controls-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    border-radius: 50px;
    padding: 8px 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
    margin-bottom: 40px;
}

.media-pill-toggle {
    display: inline-flex;
    background: #f1f5f9;
    border-radius: 50px;
    padding: 4px;
    gap: 4px;
}

.toggle-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 28px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 700;
    color: #475569;
    text-decoration: none !important;
    transition: all 0.3s ease;
    border: none;
    background: transparent;
    cursor: pointer;
}

.toggle-tab-btn:hover {
    color: #0b3a60;
}

.toggle-tab-btn.active {
    background: #0b3a60;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(11, 58, 96, 0.25);
}

.sort-filter-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sort-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #64748b;
    text-decoration: none !important;
    transition: all 0.2s ease;
}

.sort-btn:hover,
.sort-btn.active {
    color: #0b3a60;
    background: #f1f5f9;
}

/* --------------------------------------------------------------------------
   4. Hero & Main Layout Section
   -------------------------------------------------------------------------- */
.section-headline {
    text-align: center;
    margin-bottom: 30px;
}

.section-headline h2 {
    font-size: 1.8rem;
    font-weight: 800;
    color: #0b3a60;
    margin-bottom: 6px;
}

.section-headline p {
    font-size: 1rem;
    color: #64748b;
}

.media-featured-hero-row {
    display: grid;
    grid-template-columns: 7fr 5fr;
    gap: 24px;
    margin-bottom: 35px;
}

/* Large Featured Card */
.featured-card {
    position: relative;
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    box-shadow: 0 8px 30px rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
}

.featured-thumb {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    overflow: hidden;
    background: #0f172a;
    cursor: pointer;
}

.featured-thumb img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.featured-card:hover .featured-thumb img {
    transform: scale(1.04);
}

.featured-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #0b3a60;
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    z-index: 3;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.featured-badge i {
    color: #f59e0b;
}

.play-overlay-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 72px;
    height: 72px;
    background: rgba(11, 58, 96, 0.85);
    backdrop-filter: blur(8px);
    border: 3px solid #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.8rem;
    transition: all 0.3s ease;
    z-index: 2;
}

.featured-card:hover .play-overlay-btn {
    background: #dfa835;
    border-color: #dfa835;
    transform: translate(-50%, -50%) scale(1.1);
}

.duration-tag {
    position: absolute;
    bottom: 14px;
    left: 14px;
    background: rgba(15, 23, 42, 0.85);
    color: #ffffff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    z-index: 2;
}

.featured-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.featured-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: #0b3a60;
    margin-bottom: 14px;
    line-height: 1.4;
    text-decoration: none !important;
}

.media-meta-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.85rem;
    color: #64748b;
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Secondary 2x2 Grid */
.secondary-featured-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

/* --------------------------------------------------------------------------
   5. Regular Media Cards Grid (4 Columns)
   -------------------------------------------------------------------------- */
.media-grid-4col {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 50px;
}

.media-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 16px rgba(0,0,0,0.03);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.media-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 36px rgba(11, 58, 96, 0.09);
    border-color: #cbd5e1;
}

.card-thumb {
    position: relative;
    width: 100%;
    padding-top: 62.5%;
    overflow: hidden;
    background: #0f172a;
}

.card-thumb img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.media-card:hover .card-thumb img {
    transform: scale(1.06);
}

.card-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(4px);
    border: 2px solid #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.media-card:hover .card-play-icon {
    background: #0b3a60;
    border-color: #0b3a60;
}

.card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.5;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #64748b;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
}

.photo-count-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(11, 58, 96, 0.88);
    color: #ffffff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    z-index: 2;
}

/* Load More Container */
.load-more-wrapper {
    text-align: center;
    margin: 40px 0 60px;
}

.btn-load-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #0b3a60;
    padding: 12px 36px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.btn-load-more:hover {
    background: #0b3a60;
    color: #ffffff;
    border-color: #0b3a60;
    box-shadow: 0 8px 24px rgba(11, 58, 96, 0.2);
}

/* --------------------------------------------------------------------------
   6. Modal Lightbox (Popups for Video & Photos)
   -------------------------------------------------------------------------- */
.custom-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.82);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 30px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.custom-modal-backdrop.show {
    display: flex;
    opacity: 1;
}

.custom-modal-dialog {
    background: #ffffff;
    border-radius: 24px;
    width: 100%;
    max-width: 1100px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.modal-close-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 40px;
    height: 40px;
    background: #f1f5f9;
    color: #0f172a;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
}

.modal-close-btn:hover {
    background: #e2e8f0;
    color: #ef4444;
}

/* Video Modal Inner Layout */
.video-modal-content {
    display: grid;
    grid-template-columns: 7fr 5fr;
    min-height: 450px;
}

.video-player-box {
    background: #000000;
    border-radius: 24px 0 0 24px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.video-player-box iframe {
    width: 100%;
    height: 100%;
    min-height: 380px;
    border: none;
}

.video-info-box {
    padding: 32px;
    display: flex;
    flex-direction: column;
}

.video-info-box h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: #0b3a60;
    margin-bottom: 12px;
}

.video-info-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    font-size: 0.85rem;
    color: #64748b;
}

.modal-action-btns {
    display: flex;
    gap: 12px;
    margin-top: auto;
    padding-top: 20px;
}

.btn-modal-action {
    flex: 1;
    padding: 10px 18px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none !important;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.btn-primary-action {
    background: #0b3a60;
    color: #ffffff;
}

.btn-primary-action:hover {
    background: #082844;
}

.btn-secondary-action {
    background: #f1f5f9;
    color: #334155;
}

.btn-secondary-action:hover {
    background: #e2e8f0;
}

/* Photo Gallery Modal Inner Layout */
.photo-modal-stage {
    position: relative;
    background: #0f172a;
    border-radius: 24px 24px 0 0;
    min-height: 480px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-stage-img {
    max-width: 100%;
    max-height: 480px;
    object-fit: contain;
}

.counter-tag {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(15, 23, 42, 0.75);
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 700;
}

.gallery-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    color: #ffffff;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.gallery-nav-btn:hover {
    background: rgba(255, 255, 255, 0.4);
}

.gallery-nav-prev { right: 20px; }
.gallery-nav-next { left: 20px; }

.photo-modal-details {
    padding: 24px 32px;
}

.photo-modal-thumbnails {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 15px 0;
}

.thumb-item {
    width: 80px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.6;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.thumb-item.active,
.thumb-item:hover {
    opacity: 1;
    border-color: #dfa835;
}

.thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --------------------------------------------------------------------------
   7. Desktop Media Query Adjustments
   -------------------------------------------------------------------------- */
@media (max-width: 1200px) {
    .category-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .media-grid-4col {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 991px) {
    .media-featured-hero-row {
        grid-template-columns: 1fr;
    }
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .media-grid-4col {
        grid-template-columns: repeat(2, 1fr);
    }
    .video-modal-content {
        grid-template-columns: 1fr;
    }
}
