/*
Theme Name: پوسته فرزند کلاکت فیلم
Author: UniqueTheme
Author URI: https://uniquetheme.ir
Theme URI: https://www.rtl-theme.com/kelaketfilm-wordpress-theme/
Description: A Movie Theme for wordpress
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: kelaketfilm
Template: KelaketFilm
*/



/* ==========================================================================
   Download Box — Season → Version → Quality → Episode
   NOTE: this theme uses `html.dark` for the LIGHT theme.
   ========================================================================== */

.kdb {
    /* Dark theme (default — no `html.dark` on <html>) */
    --kdb-line:          #3a3a46;
    --kdb-line-soft:     #2e2e3a;
    --kdb-surface:       #23232b;
    --kdb-surface-soft:  #2a2a33;
    --kdb-surface-ep:    #1c1c23;
    --kdb-muted:         #9aa3ad;
    --kdb-price:         #8bdc73;
    --kdb-price-free:    #8bdc73;
    --kdb-price-locked:  #e7b4b4;
    --kdb-accent:        var(--primaryColor);
    --kdb-accent-ink:    #18130f;
    --kdb-radius:        10px;
    --kdb-radius-sm:     7px;
    --kdb-ease:          cubic-bezier(.2, .8, .2, 1);

    direction: rtl;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
}

/* Light theme (html.dark class in this theme = LIGHT) */
html.dark .kdb {
    --kdb-line:          #e1e6ed;
    --kdb-line-soft:     #edf1f6;
    --kdb-surface:       #ffffff;
    --kdb-surface-soft:  #f8fafc;
    --kdb-surface-ep:    #f3f5f8;
    --kdb-muted:         #5a6473;
    --kdb-price:         #1f8f4e;
    --kdb-price-free:    #1f8f4e;
    --kdb-price-locked:  #b23c3c;
}

.kdb *,
.kdb *::before,
.kdb *::after { box-sizing: border-box; }

/* ------------------------------------------------------------------ */
/* Headers                                                            */
/* ------------------------------------------------------------------ */
.kdb_head {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    text-align: right;
    color: var(--text);
    border: 0;
    background: var(--kdb-surface-soft);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    padding: 13px 16px;
    transition: background-color .15s ease;
}
.kdb_head:hover { background: color-mix(in srgb, var(--kdb-surface-soft) 85%, var(--text) 15%); }

.kdb_head_right,
.kdb_head_left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.kdb_head_title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kdb_head_icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex: none;
    color: var(--kdb-accent);
    font-size: 15px;
}
.kdb_head_icon > i { display: block; line-height: 1; }

.kdb_tag {
    font-size: 11px;
    color: var(--kdb-muted);
    border: 1px solid var(--kdb-line);
    padding: 3px 9px;
    border-radius: 20px;
    white-space: nowrap;
    font-weight: 400;
}

/* Chevron — fixed-size + centre origin prevents the rotate-shift bug */
.kdb_chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex: none;
    color: var(--kdb-muted);
    transition: transform .22s ease;
    transform-origin: center center;
    will-change: transform;
}
.kdb_chevron > i {
    display: block;
    line-height: 1;
    font-size: 13px;
}
.kdb_head[aria-expanded="true"] .kdb_chevron { transform: rotate(180deg); }

.kdb_body {
    display: none;
    overflow: hidden;
    padding: 9px;
    background: var(--kdb-surface);
}

.kdb_version.is-open > .kdb_body,
.kdb_season.is-open  > .kdb_body,
.kdb_quality.is-open > .kdb_body { display: block; }


/* ------------------------------------------------------------------ */
/* Season / Version wrappers                                          */
/* ------------------------------------------------------------------ */
.kdb_season {
    margin-bottom: 12px;
    border: 1px solid var(--kdb-line);
    border-radius: var(--kdb-radius);
    overflow: hidden;
    background: var(--kdb-surface);
}

.kdb_version {
    margin-bottom: 9px;
    border: 1px solid var(--kdb-line);
    border-radius: var(--kdb-radius-sm);
    overflow: hidden;
    background: var(--kdb-surface);
}
.kdb_version:last-child { margin-bottom: 0; }

.kdb_version_head {
    padding: 11px 13px;
    font-size: 14px;
    background: var(--kdb-surface-soft);
}

/* Version dot — always yellow (primaryColor) */
.kdb_version_dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--kdb-accent);
    flex: none;
}

.kdb_version > .kdb_body {
    padding: 9px;
    background: var(--kdb-surface);
}

/* Version-level film_info notice (movies) — sits between head and body */
.kdb_version_notice {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin: 8px 12px 10px;
    padding: 10px 14px;
    background: var(--kdb-surface-soft);
    border: 1px solid var(--kdb-line-soft);
    border-right: 2px solid var(--kdb-accent);
    border-radius: var(--kdb-radius-sm);
    color: var(--text);
    font-size: 12px;
    line-height: 1.9;
    direction: rtl;
    text-align: right;
}
.kdb_version_notice > i {
    flex-shrink: 0;
    margin-top: 4px;
    color: var(--kdb-accent);
    font-size: 13px;
    line-height: 1;
}
.kdb_version_notice p:last-child { margin-bottom: 0; }


/* ------------------------------------------------------------------ */
/* Quality header — 5-column grid                                     */
/* ------------------------------------------------------------------ */
.kdb_quality { border-bottom: 1px solid var(--kdb-line); }
.kdb_quality:last-child { border-bottom: 0; }

.kdb_quality_head {
    display: grid;
    grid-template-columns: minmax(150px, 1.2fr) minmax(90px, 1fr) minmax(90px, 1fr) minmax(70px, .8fr) 22px;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    text-align: right;
    background: var(--kdb-surface-soft);
}

.kdb_qh_name {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.kdb_qh_label {
    font-size: 10px;
    color: var(--kdb-muted);
    font-weight: 400;
}
.kdb_qh_value {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    overflow-wrap: anywhere;
    text-align: right;
}

.kdb_qh_stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.kdb_qh_stat_label {
    font-size: 10px;
    color: var(--kdb-muted);
    font-weight: 400;
}
.kdb_qh_stat_value {
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
    overflow-wrap: anywhere;
    text-align: right;
}

.kdb_quality_body {
    padding: 10px 12px 12px;
    background: var(--kdb-surface-ep);
}


/* ------------------------------------------------------------------ */
/* Episode rows                                                       */
/* ------------------------------------------------------------------ */
.kdb_episodes { display: grid; gap: 6px; }

.kdb_ep {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) minmax(220px, 1.4fr) minmax(240px, 1.4fr);
    gap: 14px;
    align-items: center;
    padding: 10px 12px;
    background: var(--kdb-surface-soft);
    border: 1px solid var(--kdb-line-soft);
    border-radius: var(--kdb-radius-sm);
}

/* Movie rows — vertical breathing room between adjacent rows */
.kdb_ep.kdb_movie_row {
    margin-bottom: 8px;
}
.kdb_ep.kdb_movie_row:last-child {
    margin-bottom: 0;
}

.kdb_ep_title {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.kdb_ep_title_main {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.kdb_ep_title_sub {
    font-size: 10px;
    color: var(--kdb-muted);
    font-weight: 400;
    direction: ltr;
    text-align: right;
}
.kdb_ep_title_label {
    font-size: 10px;
    color: var(--kdb-muted);
    font-weight: 400;
    line-height: 1.4;
}

/* Movie rows — allow the long quality name to wrap */
.kdb_movie_row .kdb_ep_title_main {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    word-break: break-word;
    line-height: 1.45;
    text-align: right;
}

.kdb_ep_fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: 12px;
    min-width: 0;
}

.kdb_ep_field {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.kdb_ep_field_label {
    font-size: 10px;
    color: var(--kdb-muted);
    font-weight: 400;
}
.kdb_ep_field_value {
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
    overflow-wrap: anywhere;
    text-align: right;
}

.kdb_price        { color: var(--kdb-price); }
.kdb_price_free   { color: var(--kdb-price-free); }
.kdb_price_locked { color: var(--kdb-price-locked); font-weight: 400; }

/* Actions — anchor buttons to far LEFT in the RTL row */
.kdb_ep_actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    flex-wrap: wrap;
}

/* Episode / per-quality description — spans full row */
.kdb_ep_desc {
    grid-column: 1 / -1;
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px dashed var(--kdb-line-soft);
    color: var(--kdb-muted);
    font-size: 12px;
    line-height: 1.9;
    direction: rtl;
    text-align: right;
}
.kdb_ep_desc > i {
    flex-shrink: 0;
    margin-top: 4px;
    color: var(--kdb-accent);
    font-size: 13px;
    line-height: 1;
}
.kdb_ep_desc p:last-child { margin-bottom: 0; }


/* ------------------------------------------------------------------ */
/* Buttons                                                            */
/* ------------------------------------------------------------------ */
.kdb_btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    line-height: 1.5;
    text-decoration: none;
    white-space: nowrap;
    color: var(--text);
    background: transparent;
    border: 1px solid var(--kdb-line);
    border-radius: var(--kdb-radius-sm);
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.kdb_btn:hover { background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--text); }
.kdb_btn > i {
    font-size: 13px;
    line-height: 1;
    flex-shrink: 0;
}

.kdb_btn_primary {
    background: var(--kdb-accent);
    color: var(--kdb-accent-ink);
    border-color: var(--kdb-accent);
    font-weight: 700;
}
.kdb_btn_primary:hover {
    background: color-mix(in srgb, var(--kdb-accent) 82%, #000 18%);
    color: var(--kdb-accent-ink);
    border-color: color-mix(in srgb, var(--kdb-accent) 82%, #000 18%);
}

.kdb_btn_sample {
    color: var(--kdb-accent);
    border-color: color-mix(in srgb, var(--kdb-accent) 55%, transparent);
}
.kdb_btn_sample:hover {
    background: color-mix(in srgb, var(--kdb-accent) 12%, transparent);
    color: var(--kdb-accent);
    border-color: var(--kdb-accent);
}

.kdb_btn_sub {
    color: #29b6f6;
    border-color: rgba(41, 182, 246, .45);
}
.kdb_btn_sub:hover {
    background: #29b6f6;
    border-color: #29b6f6;
    color: #04202c;
}
html.dark .kdb_btn_sub {
    color: #0167a6;
    border-color: rgba(1, 103, 166, .45);
}

.kdb_btn_audio {
    color: #8bdc73;
    border-color: rgba(139, 220, 115, .45);
}
.kdb_btn_audio:hover {
    background: #8bdc73;
    border-color: #8bdc73;
    color: #06251a;
}
html.dark .kdb_btn_audio {
    color: #1f8f4e;
    border-color: rgba(31, 143, 78, .45);
}

.kdb_btn_ghost {
    color: var(--kdb-muted);
    border-color: var(--kdb-line);
    font-weight: 500;
}
.kdb_btn_ghost:hover {
    color: var(--text);
    border-color: var(--kdb-muted);
    background: transparent;
}

.kdb_locked { opacity: .6; }


/* ------------------------------------------------------------------ */
/* Copy-all footer                                                    */
/* ------------------------------------------------------------------ */
.kdb_ep_foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--kdb-line);
    font-size: 11px;
    color: var(--kdb-muted);
    flex-wrap: wrap;
}
.kdb_ep_foot_count { font-weight: 400; }


/* ------------------------------------------------------------------ */
/* Movie extras                                                       */
/* ------------------------------------------------------------------ */
.kdb_extra_row {
    background: transparent;
    border-style: dashed;
}


/* ------------------------------------------------------------------ */
/* Generic notice block                                               */
/* ------------------------------------------------------------------ */
.kdb_notice {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-top: 10px;
    padding: 10px 14px;
    background: var(--kdb-surface-soft);
    border: 1px solid var(--kdb-line-soft);
    border-right: 2px solid var(--kdb-muted);
    border-radius: var(--kdb-radius-sm);
    color: var(--text);
    font-size: 12px;
    line-height: 1.9;
}
.kdb_notice > i {
    flex-shrink: 0;
    margin-top: 4px;
    color: var(--kdb-muted);
    font-size: 13px;
    line-height: 1;
}
.kdb_notice p:last-child { margin-bottom: 0; }

.kdb_empty {
    padding: 14px;
    text-align: center;
    color: var(--kdb-muted);
    font-size: 13px;
    background: var(--kdb-surface-soft);
    border-radius: var(--kdb-radius-sm);
}


/* ------------------------------------------------------------------ */
/* Responsive — tablet                                                */
/* ------------------------------------------------------------------ */
@media (max-width: 900px) {
    .kdb_quality_head {
        grid-template-columns: minmax(130px, 1.2fr) minmax(80px, 1fr) minmax(80px, 1fr) 22px;
        gap: 10px;
    }
    .kdb_qh_encoder { display: none; }

    .kdb_ep {
        grid-template-columns: minmax(110px, .7fr) minmax(180px, 1fr);
    }
    .kdb_ep_actions {
        grid-column: 1 / -1;
        padding-top: 8px;
        border-top: 1px solid var(--kdb-line-soft);
    }
    .kdb_ep_desc { margin-top: 6px; padding-top: 6px; }
}


/* ------------------------------------------------------------------ */
/* Responsive — mobile                                                */
/* ------------------------------------------------------------------ */
@media (max-width: 600px) {
    .kdb_head { padding: 11px 12px; }
    .kdb_head_title { font-size: 14px; }
    .kdb_body { padding: 6px; }

    /* Quality header — 4-col × 2-row grid */
    .kdb_quality_head {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr 22px;
        grid-template-rows: auto auto;
        gap: 6px 8px;
        padding: 11px;
        align-items: center;
    }
    .kdb_qh_name {
        grid-column: 1 / span 3;
        grid-row: 1;
        flex-direction: row;
        align-items: baseline;
        gap: 6px;
    }
    .kdb_qh_name .kdb_qh_label { font-size: 11px; }
    .kdb_qh_name .kdb_qh_value { font-size: 13px; }

    .kdb_qh_stat {
        grid-row: 2;
        flex-direction: column;
        align-items: flex-start;
        gap: 1px;
    }
    .kdb_qh_stat_label { font-size: 9px; }
    .kdb_qh_stat_value { font-size: 11px; }

    .kdb_qh_size    { grid-column: 1; }
    .kdb_qh_encoder { grid-column: 2; }
    .kdb_qh_count   { grid-column: 3; }

    .kdb_chevron {
        grid-column: 4;
        grid-row: 1 / span 2;
        align-self: center;
        justify-self: end;
    }

    /* Episode rows — vertical stack */
    .kdb_quality_body { padding: 6px; }
    .kdb_ep {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 10px;
    }
    .kdb_ep_title_main { white-space: normal; }
    .kdb_ep_fields {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        padding: 8px 0;
        border-top: 1px solid var(--kdb-line-soft);
        border-bottom: 1px solid var(--kdb-line-soft);
    }
    .kdb_ep_field_value { font-size: 11px; }
    .kdb_ep_actions {
        grid-column: auto;
        padding-top: 0;
        border-top: 0;
        justify-content: flex-end;
    }
    .kdb_btn { padding: 7px 9px; font-size: 11px; }
    .kdb_ep_foot { font-size: 10px; }
    .kdb_ep_desc { font-size: 11px; line-height: 1.8; padding-top: 6px; }
    .kdb_version_notice { margin: 6px 8px 8px; padding: 9px 12px; font-size: 11px; }
}


/* Very small screens */
@media (max-width: 380px) {
    .kdb_ep_fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .kdb_quality_head { grid-template-columns: 1fr 1fr 22px; }
    .kdb_qh_name      { grid-column: 1 / span 2; }
    .kdb_qh_encoder   { display: none; }
    .kdb_qh_size      { grid-column: 1; }
    .kdb_qh_count     { grid-column: 2; }
    .kdb_chevron      { grid-column: 3; }
}