/* ============================================================
   MediaCore Gallery v3.1 — Frontend Styles
   Author: شركة الجيوشي | elgyoshy.com
   Custom colors are injected via PHP inline styles
   ============================================================ */

/* ---- Reset & Wrap ---- */
.mcg-slider-wrap {
    max-width: 900px;
    margin: 0 auto 36px auto;
    direction: rtl;
    font-family: inherit;
}

/* ============================================================
   SLIDER CORE
   ============================================================ */
.mcg-slider {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    background: #0a0a0a;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    user-select: none;
    -webkit-user-select: none;
}

.mcg-slides-track {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.mcg-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(60px);
    will-change: opacity, transform;
}

.mcg-slide--active {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
    z-index: 2;
}

.mcg-slide--exit-left {
    opacity: 0;
    transform: translateX(-60px);
    z-index: 1;
    pointer-events: none;
}

.mcg-slide--exit-right {
    opacity: 0;
    transform: translateX(60px);
    z-index: 1;
    pointer-events: none;
}

/* Fade transition override */
.mcg-slider--fade .mcg-slide {
    transform: none !important;
}

/* ---- Slide Media ---- */
.mcg-slide-media {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.mcg-slide-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ============================================================
   CAPTION ANIMATION
   ============================================================ */
.mcg-caption {
    position: absolute;
    bottom: 0;
    right: 0;
    left: 0;
    padding: 40px 20px 16px;
    background: linear-gradient(to top, rgba(0,0,0,0.72) 0%, transparent 100%);
    z-index: 4;
    pointer-events: none;
}

.mcg-caption-text {
    display: block;
    color: #fff;
    font-size: clamp(14px, 2.2vw, 18px);
    font-weight: 600;
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
    line-height: 1.4;
    opacity: 0;
    transform: translateY(16px);
    transition: none;
}

.mcg-slide--active .mcg-caption-text {
    animation: mcgCaption 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.25s forwards;
}

@keyframes mcgCaption {
    0%   { opacity: 0; transform: translateY(16px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   ARROWS
   ============================================================ */
.mcg-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: #3d3d3d;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease, background 0.25s ease, transform 0.25s ease;
    outline: none;
    box-shadow: none;
    text-shadow: none;
}

.mcg-arrow:focus,
.mcg-arrow:focus-visible,
.mcg-arrow:active {
    outline: none;
    box-shadow: none;
    border: none;
    background: #3d3d3d;
}

.mcg-slider:hover .mcg-arrow {
    opacity: 1;
}

.mcg-arrow:hover,
.mcg-arrow:hover:focus {
    background: #000000;
    box-shadow: none;
    outline: none;
    border: none;
}

.mcg-arrow--prev {
    right: 14px;
}
.mcg-arrow--next {
    left: 14px;
}

.mcg-arrow--prev:hover { transform: translateY(-50%); }
.mcg-arrow--next:hover { transform: translateY(-50%); }

/* ============================================================
   COUNTER
   ============================================================ */
.mcg-counter {
    position: absolute;
    top: 14px;
    left: 16px;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 20px;
    z-index: 8;
    font-variant-numeric: tabular-nums;
}

/* ============================================================
   DOT INDICATORS
   ============================================================ */
.mcg-dots {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 8;
}

.mcg-dot {
    width: 8px;
    height: 8px;
    border-radius: 4px;
    border: none;
    background: rgba(255,255,255,0.45);
    cursor: pointer;
    padding: 0;
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                background 0.3s ease;
    flex-shrink: 0;
    outline: none;
}

.mcg-dot--active {
    width: 26px;
    background: #fff;
}

/* ============================================================
   VIDEO SLIDES
   ============================================================ */
.mcg-slide-video,
.mcg-slide-youtube {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mcg-video-player {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    border-radius: 0;
}

/* YouTube Thumb Wrapper */
.mcg-yt-thumb-wrap {
    position: relative;
    width: 100%;
    height: 100%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    overflow: hidden;
}

.mcg-yt-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: brightness(0.75);
    transition: filter 0.3s ease;
}

.mcg-yt-thumb-wrap:hover .mcg-yt-thumb-img {
    filter: brightness(0.9);
}

.mcg-yt-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: transform 0.2s ease;
    z-index: 3;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
    outline: none;
}

.mcg-yt-thumb-wrap:hover .mcg-yt-play-btn {
    transform: translate(-50%, -50%);
}

/* Iframe after click */
.mcg-yt-iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
    z-index: 10;
}

/* ============================================================
   THUMBNAILS
   ============================================================ */
.mcg-thumbs-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    direction: rtl;
}

.mcg-thumbs-track-wrap {
    flex: 1;
    overflow: hidden;
    border-radius: 8px;
}

.mcg-thumbs-track {
    display: flex;
    gap: 6px;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.mcg-thumb {
    flex: 0 0 auto;
    width: 80px;
    height: 58px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    position: relative;
    background: #1a1a1a;
    opacity: 0.65;
    transition: opacity 0.25s ease,
                border-color 0.25s ease,
                transform 0.25s ease;
    outline: none;
}

.mcg-thumb:hover {
    opacity: 0.9;
    border-color: rgba(255, 255, 255, 0.4);
}

.mcg-thumb--active {
    opacity: 1;
    border-color: #2271b1;
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.mcg-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mcg-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.4);
    background: #111;
}

.mcg-thumb-badge {
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    padding: 1px 6px;
    font-size: 9px;
    color: #fff;
    pointer-events: none;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 2px;
}

.mcg-thumb-badge--yt {
    color: #ff4444;
}

.mcg-thumbs-nav {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    outline: none;
    box-shadow: none;
    flex-shrink: 0;
}

.mcg-thumbs-nav:hover,
.mcg-thumbs-nav:focus,
.mcg-thumbs-nav:active {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
    outline: none;
    box-shadow: none;
}



/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .mcg-slider-wrap {
        margin: 0 -16px 28px -16px;
        max-width: none;
    }

    .mcg-slider { border-radius: 0; }

    .mcg-thumbs-wrap { padding: 0 10px; }

    .mcg-thumb { width: 64px; height: 46px; }

    .mcg-arrow { width: 40px; height: 40px; opacity: 1; }


}

@media (max-width: 480px) {
    .mcg-thumb { width: 54px; height: 40px; }
    .mcg-caption-text { font-size: 13px; }
}

/* ============================================================
   ADMIN SETTINGS PAGE
   ============================================================ */
.mcg-settings-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

/* ============================================================
   ADMIN META BOX
   ============================================================ */
.mcg-admin-wrap { display:flex; flex-direction:column; gap:12px; }
.mcg-media-preview { display:flex; flex-wrap:wrap; gap:8px; min-height:70px; padding:8px; background:#f9f9f9; border:1px dashed #ccc; border-radius:6px; }
.mcg-media-item { position:relative; width:80px; height:70px; border:2px solid #ddd; border-radius:6px; overflow:hidden; cursor:grab; background:#eee; }
.mcg-media-item img { width:100%; height:100%; object-fit:cover; display:block; }
.mcg-media-type-badge { position:absolute; bottom:2px; right:2px; background:rgba(0,122,200,0.85); color:#fff; font-size:9px; padding:1px 4px; border-radius:3px; pointer-events:none; }
.mcg-badge-video { background:rgba(30,150,30,0.85); }
.mcg-badge-yt { background:rgba(200,0,0,0.85); }
.mcg-video-placeholder { width:100%; height:100%; display:flex; align-items:center; justify-content:center; background:#222; color:#ccc; }
.mcg-yt-placeholder { background:#1a1a1a; }
.mcg-remove-item { position:absolute; top:2px; left:2px; background:rgba(0,0,0,0.65); color:#fff; border-radius:50%; width:18px; height:18px; text-align:center; line-height:17px; cursor:pointer; font-size:13px; }
.mcg-remove-item:hover { background:#dc3232; }
.mcg-admin-actions { display:flex; gap:8px; flex-wrap:wrap; }

/* Color picker */
.mcg-color-input { width: 50px; height: 34px; padding: 2px; border: 1px solid #ddd; border-radius: 4px; cursor: pointer; vertical-align: middle; margin-left: 8px; }
