@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');

/* Font + reset */
.svc-wrapper {
    --svc-cols: 4;
    --svc-cols-tablet: 2;
    --svc-cols-mobile: 2;
    --svc-gap: 18px;
    --svc-single-width: 380px;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    font-family: 'Vazirmatn', sans-serif !important;
    direction: rtl !important;
}

.svc-wrapper *,
.svc-wrapper *:before,
.svc-wrapper *:after {
    box-sizing: border-box !important;
}

/* Grid */
.svc-grid {
    display: grid;
    grid-template-columns: repeat(var(--svc-cols), minmax(0, 1fr));
    gap: var(--svc-gap);
    width: 100%;
    align-items: start;
}

.svc-count-1 .svc-grid {
    grid-template-columns: minmax(0, var(--svc-single-width));
    justify-content: center;
}

.svc-count-2 .svc-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 820px;
    margin-inline: auto;
}

.svc-count-3 .svc-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: 1180px;
    margin-inline: auto;
}

/* Card */
.svc-wrapper .svc-card {
    background: #ffffff !important;
    border-radius: 20px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
    cursor: pointer !important;
    display: flex !important;
    flex-direction: column !important;
    border: 1px solid #eee !important;
    margin: 0 !important;
    min-width: 0 !important;
    position: relative !important;
    font-family: 'Vazirmatn', sans-serif !important;
}

.svc-wrapper .svc-card:hover {
    transform: none !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
}

.svc-wrapper .svc-card-media {
    position: relative !important;
    width: 100% !important;
    aspect-ratio: 3/4 !important;
    background-color: #f8f9fa !important;
    overflow: hidden !important;
}

.svc-wrapper .svc-card-media img,
.svc-wrapper .svc-card-media img.svc-thumb,
.svc-wrapper .svc-thumb {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
}

.svc-wrapper .svc-card-media .svc-thumb {
    position: absolute !important;
    inset: 0 !important;
}

.svc-wrapper .svc-play-btn {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 50px !important;
    height: 50px !important;
    background: rgba(255, 255, 255, 0.9) !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 2 !important;
    pointer-events: none !important;
}

.svc-wrapper .svc-play-btn svg {
    width: 20px !important;
    height: 20px !important;
    fill: #212529 !important;
    display: block !important;
    margin-right: -2px !important;
}

.svc-wrapper .svc-badge {
    position: absolute !important;
    bottom: 12px !important;
    right: 12px !important;
    background: rgba(0, 0, 0, 0.6) !important;
    color: #fff !important;
    padding: 4px 10px !important;
    border-radius: 8px !important;
    font-size: 11px !important;
    line-height: 1.4 !important;
    white-space: nowrap !important;
}

.svc-wrapper .svc-card-content {
    padding: 15px !important;
    text-align: right !important;
    background: #fff !important;
}

.svc-wrapper .svc-card-title {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #212529 !important;
    margin: 0 0 5px 0 !important;
    line-height: 1.5 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.svc-wrapper .svc-card-meta {
    font-size: 12px !important;
    color: #6c757d !important;
    margin: 0 !important;
    line-height: 1.7 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.svc-empty {
    padding: 24px;
    border: 1px dashed #d8dde2;
    border-radius: 18px;
    text-align: center;
    color: #777;
}

/* Elementor template cards */
.svc-template-card {
    position: relative;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    border-radius: inherit;
}

.svc-template-card > .elementor {
    width: 100%;
}

.svc-template-hit {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    margin: 0;
    padding: 0;
    background: transparent;
    z-index: 30;
    cursor: pointer;
    border-radius: inherit;
}

body.elementor-editor-active .svc-template-hit {
    display: none;
}

/* Popup — fully isolated from Elementor/theme styles. Card CSS above is intentionally untouched. */
.svc-modal-overlay[data-svc-viewer="1"] {
    all: initial !important;
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 2147483000 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 24px !important;
    margin: 0 !important;
    background: rgba(8, 10, 14, .72) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    direction: rtl !important;
    font-family: 'Vazirmatn', Tahoma, Arial, sans-serif !important;
    color: #f8fafc !important;
    line-height: 1.5 !important;
    box-sizing: border-box !important;
}

.svc-modal-overlay[data-svc-viewer="1"].active {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

.svc-modal-overlay[data-svc-viewer="1"] *,
.svc-modal-overlay[data-svc-viewer="1"] *::before,
.svc-modal-overlay[data-svc-viewer="1"] *::after {
    box-sizing: border-box !important;
    font-family: 'Vazirmatn', Tahoma, Arial, sans-serif !important;
}

.svc-modal-overlay[data-svc-viewer="1"] button,
.svc-modal-overlay[data-svc-viewer="1"] h3,
.svc-modal-overlay[data-svc-viewer="1"] h4,
.svc-modal-overlay[data-svc-viewer="1"] p {
    all: unset;
    box-sizing: border-box !important;
}

.svc-modal-container {
    all: initial !important;
    position: relative !important;
    width: min(920px, 100%) !important;
    max-height: calc(100vh - 48px) !important;
    overflow: hidden !important;
    border-radius: 24px !important;
    background: #111318 !important;
    color: #f8fafc !important;
    box-shadow: 0 32px 100px rgba(0, 0, 0, .48) !important;
    border: 1px solid rgba(255,255,255,.08) !important;
    direction: rtl !important;
}

.svc-modal-header {
    all: initial !important;
    min-height: 64px !important;
    padding: 14px 18px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 16px !important;
    background: #111318 !important;
    border-bottom: 1px solid rgba(255,255,255,.07) !important;
    direction: rtl !important;
}

.svc-modal-header h3,
.svc-modal-info-title {
    all: unset !important;
    display: block !important;
    color: #f8fafc !important;
    font-family: 'Vazirmatn', Tahoma, Arial, sans-serif !important;
}

.svc-modal-header h3 {
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 15px !important;
    font-weight: 700 !important;
}

.svc-close-btn {
    all: unset !important;
    flex: 0 0 auto !important;
    width: 36px !important;
    height: 36px !important;
    display: grid !important;
    place-items: center !important;
    border-radius: 50% !important;
    background: #1d2027 !important;
    color: #e5e7eb !important;
    font-size: 25px !important;
    line-height: 1 !important;
    cursor: pointer !important;
    user-select: none !important;
}

.svc-close-btn:hover,
.svc-close-btn:focus-visible {
    background: #272b33 !important;
    color: #fff !important;
}

.svc-modal-body {
    all: initial !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1.15fr) minmax(250px, .85fr) !important;
    gap: 22px !important;
    padding: 22px !important;
    background: #111318 !important;
    color: #f8fafc !important;
    direction: rtl !important;
}

.svc-modal-player {
    all: initial !important;
    position: relative !important;
    display: block !important;
    width: 100% !important;
    aspect-ratio: 16 / 9 !important;
    min-height: 0 !important;
    overflow: hidden !important;
    border-radius: 18px !important;
    background: #000 !important;
    isolation: isolate !important;
}

.svc-modal-player video.svc-modal-video {
    all: initial !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    object-fit: contain !important;
    background: #000 !important;
    color: #fff !important;
    cursor: default !important;
}

.svc-modal-big-play {
    all: unset !important;
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 58px !important;
    height: 58px !important;
    display: none !important;
    place-items: center !important;
    border-radius: 50% !important;
    background: rgba(255,255,255,.94) !important;
    color: #111318 !important;
    box-shadow: 0 12px 35px rgba(0,0,0,.25) !important;
    cursor: pointer !important;
    z-index: 7 !important;
}

.svc-modal-big-play.is-visible {
    display: grid !important;
}

.svc-modal-big-play span {
    all: unset !important;
    display: block !important;
    margin-right: -3px !important;
    font-size: 22px !important;
    line-height: 1 !important;
}

.svc-modal-loader {
    all: initial !important;
    display: none !important;
    position: absolute !important;
    inset: 0 !important;
    z-index: 8 !important;
    align-items: center !important;
    justify-content: center !important;
    pointer-events: none !important;
}

.svc-modal-loader.is-visible {
    display: flex !important;
}

.svc-modal-loader::after {
    content: '' !important;
    display: block !important;
    width: 34px !important;
    height: 34px !important;
    border: 2px solid rgba(255,255,255,.28) !important;
    border-top-color: #fff !important;
    border-radius: 50% !important;
    animation: svc-spin .7s linear infinite !important;
}

.svc-modal-error {
    all: unset !important;
    display: none !important;
    position: absolute !important;
    left: 18px !important;
    right: 18px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 9 !important;
    padding: 13px 15px !important;
    border-radius: 14px !important;
    background: rgba(10,12,16,.92) !important;
    color: #fff !important;
    text-align: center !important;
    font-size: 13px !important;
    line-height: 1.8 !important;
}

.svc-modal-error.is-visible {
    display: block !important;
}

.svc-modal-progress {
    position: absolute !important;
    left: 12px !important;
    right: 12px !important;
    bottom: 9px !important;
    height: 3px !important;
    overflow: hidden !important;
    border-radius: 999px !important;
    background: rgba(255,255,255,.25) !important;
    z-index: 10 !important;
    pointer-events: none !important;
}

.svc-modal-progress span {
    display: block !important;
    width: 0 !important;
    height: 100% !important;
    background: #fff !important;
}

.svc-modal-info {
    all: initial !important;
    min-width: 0 !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    padding: 8px 2px !important;
    color: #f8fafc !important;
    direction: rtl !important;
}

.svc-modal-info-title {
    font-size: 21px !important;
    font-weight: 750 !important;
    line-height: 1.6 !important;
    margin-bottom: 6px !important;
}

.svc-modal-subtitle {
    all: unset !important;
    display: block !important;
    color: #a1a7b3 !important;
    font-size: 13px !important;
    line-height: 1.8 !important;
}

.svc-modal-actions {
    all: initial !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding-top: 18px !important;
    border-top: 1px solid rgba(255,255,255,.07) !important;
    direction: rtl !important;
}

.svc-action-icon-btn {
    all: unset !important;
    min-height: 36px !important;
    padding: 0 12px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 10px !important;
    background: #1d2027 !important;
    color: #d7dae0 !important;
    font-size: 12px !important;
    line-height: 1 !important;
    cursor: pointer !important;
    white-space: nowrap !important;
}

.svc-action-icon-btn:hover,
.svc-action-icon-btn:focus-visible {
    background: #272b33 !important;
    color: #fff !important;
}

.svc-modal-counter {
    margin-inline-start: auto !important;
    color: #747b88 !important;
    font-size: 11px !important;
    direction: ltr !important;
}

html.svc-no-scroll,
html.svc-no-scroll body {
    overflow: hidden !important;
}

body.svc-modal-open {
    cursor: auto !important;
}

@keyframes svc-spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 1024px) {
    .svc-grid {
        grid-template-columns: repeat(var(--svc-cols-tablet), minmax(0, 1fr));
    }

    .svc-count-3 .svc-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-width: 820px;
    }
}

@media (max-width: 768px) {
    .svc-modal-body {
        grid-template-columns: 1fr !important;
    }

    .svc-modal-container {
        width: calc(100% - 24px) !important;
        max-height: calc(100vh - 24px);
        border-radius: 22px !important;
    }
}

@media (max-width: 640px) {
    .svc-grid {
        grid-template-columns: repeat(var(--svc-cols-mobile), minmax(0, 1fr));
        gap: max(10px, var(--svc-gap));
    }

    .svc-count-1 .svc-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .svc-count-2 .svc-grid,
    .svc-count-3 .svc-grid {
        grid-template-columns: repeat(var(--svc-cols-mobile), minmax(0, 1fr));
        max-width: none;
    }

    .svc-count-1 .svc-card {
        width: 100%;
        max-width: var(--svc-single-width);
        justify-self: center;
    }

    .svc-modal-overlay {
        align-items: flex-end !important;
    }

    .svc-modal-container {
        width: 100% !important;
        max-height: 94vh;
        border-radius: 24px 24px 0 0 !important;
    }

    .svc-modal-body {
        padding: 14px !important;
    }

    .svc-modal-player {
        aspect-ratio: 9/16 !important;
        max-height: 58vh;
    }

    .svc-modal-info-title {
        font-size: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .svc-modal-loader:after {
        animation: none;
    }
}

/* Popup responsive overrides — cards are intentionally untouched. */
@media (max-width: 768px) {
    .svc-modal-overlay[data-svc-viewer="1"] { padding: 12px !important; }
    .svc-modal-container { width: min(680px, 100%) !important; max-height: calc(100vh - 24px) !important; border-radius: 20px !important; }
    .svc-modal-body { grid-template-columns: 1fr !important; gap: 16px !important; padding: 14px !important; }
    .svc-modal-player { aspect-ratio: 9 / 16 !important; max-height: 62vh !important; }
    .svc-modal-info { padding: 2px !important; }
}

@media (max-width: 480px) {
    .svc-modal-overlay[data-svc-viewer="1"] { padding: 0 !important; align-items: stretch !important; }
    .svc-modal-container { width: 100% !important; max-height: 100vh !important; min-height: 100vh !important; border-radius: 0 !important; display: flex !important; flex-direction: column !important; }
    .svc-modal-header { min-height: 58px !important; }
    .svc-modal-body { flex: 1 1 auto !important; overflow-y: auto !important; }
    .svc-modal-player { max-height: 66vh !important; border-radius: 14px !important; }
}
