/* Cairo font - self-hosted - 400, 500, 600, 700 only */
@font-face {
    font-family: 'Cairo';
    font-style: normal;
    font-weight: 400;
    src: url('static/fonts/cairo/Cairo-Regular.ttf') format('truetype');
}

@font-face {
    font-family: 'Cairo';
    font-style: normal;
    font-weight: 500;
    src: url('static/fonts/cairo/Cairo-Medium.ttf') format('truetype');
}

@font-face {
    font-family: 'Cairo';
    font-style: normal;
    font-weight: 600;
    src: url('static/fonts/cairo/Cairo-SemiBold.ttf') format('truetype');
}

@font-face {
    font-family: 'Cairo';
    font-style: normal;
    font-weight: 700;
    src: url('static/fonts/cairo/Cairo-Bold.ttf') format('truetype');
}

/* style */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Cairo', sans-serif;
}
:root {
    --primary: #FF9000;
    --primary-light: #FFAA40;
    --primary-dark: #E58100;
    --secondary: #252525;
    --light: #FFFFFF;
    --text-light: #F5F5F5;
    --text-dark: #333333;
    --bg-light: #F8F8F8;
    --bg-dark: #1A1A1A;
    --card-light: #FFFFFF;
    --card-dark: #252525;
    --header-light: #FFFFFF;
    --header-dark: #252525;
    --search-bg-light: #F0F0F0;
    --search-bg-dark: #333333;
    --search-text-light: #333333;
    --search-text-dark: #FFFFFF;
    --search-border-light: #DDDDDD;
    --search-border-dark: #555555;
    --pagination-bg-light: #FFFFFF;
    --pagination-bg-dark: #252525;
    --pagination-border-light: #E0E0E0;
    --pagination-border-dark: #444444;
}

body {
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    text-align: right;
    transition: all 0.3s ease;
}

body.dark-mode {
    background-color: var(--bg-dark);
    color: var(--text-light);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background: var(--header-light);
    color: var(--text-dark);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

body.dark-mode header {
    background: var(--header-dark);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.8rem;
    font-weight: 700;
}

.logo i {
    color: var(--primary);
}

.website-name-half-1 {
    color: var(--text-dark);
}

body.dark-mode .website-name-half-1 {
    color: var(--text-light);
}

.website-name-half-2 {
    color: var(--primary);
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-container {
    display: flex;
    align-items: center;
    background: var(--search-bg-light);
    border-radius: 50px;
    overflow: hidden;
    border: 1px solid var(--search-border-light);
    transition: all 0.3s ease;
}

body.dark-mode .search-container {
    background: var(--search-bg-dark);
    border: 1px solid var(--search-border-dark);
}

.search-box {
    padding: 0 16px;
    height: 44px;
    display: flex;
    align-items: center;
    width: 300px;
    box-sizing: border-box;
}

.search-box input {
    border: none;
    outline: none;
    background: transparent;
    color: var(--search-text-light);
    font-size: 16px;
    width: 100%;
}

body.dark-mode .search-box input {
    color: var(--search-text-dark);
}

.search-box input::placeholder {
    color: #888;
}

.search-button {
    background: var(--primary);
    border: none;
    width: 50px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-button:hover {
    background: var(--primary-light);
}

.search-button i {
    color: #fff;
    font-size: 16px;
}

.theme-toggle {
    background: var(--primary);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 18px;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background: var(--primary-light);
    transform: rotate(30deg);
}

section {
    padding: 60px 0;
}

.section-title {
    font-size: 2rem;
    margin-bottom: 40px;
    color: var(--text-dark);
    position: relative;
    padding-bottom: 12px;
    text-align: right;
    font-weight: 700;
    transition: all 0.3s ease;
}

body.dark-mode .section-title {
    color: var(--text-light);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 80px;
    height: 4px;
    background: var(--primary);
    border-radius: 4px;
}

.section-title::before {
    content: '';
    position: absolute;
    bottom: 0;
    right: 90px;
    width: 20px;
    height: 4px;
    background: rgba(255, 144, 0, 0.6);
    border-radius: 4px;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    margin-bottom: 40px;
}

.video-card {
    background: var(--card-light);
    overflow: hidden;
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

body.dark-mode .video-card {
    background: var(--card-dark);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.video-thumb {
    position: relative;
    padding-top: 56.25%;
    background: linear-gradient(45deg, var(--secondary), #444);
    overflow: hidden;
}

.video-thumb::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.play-icon {
    position: absolute;
    top: 50%;
    right: 50%;
    transform: translate(50%, -50%);
    color: white;
    font-size: 3.2rem;
    z-index: 2;
    opacity: 0.9;
    transition: all 0.3s ease;
}

.video-card:hover .play-icon {
    transform: translate(50%, -50%) scale(1.15);
}

.video-duration {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    font-size: 0.85rem;
    z-index: 2;
    border-radius: 4px;
}

.video-info {
    padding: 18px;
}

.video-title {
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 1.15rem;
    color: var(--text-dark);
    transition: all 0.3s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 3.2em;
    line-height: 1.6;
}

body.dark-mode .video-title {
    color: var(--text-light);
}

/* PAGINATION - NO SHADOWS */
.pagination-container {
    display: flex;
    justify-content: center;
    margin-top: 50px;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--pagination-bg-light);
    border: 1px solid var(--pagination-border-light);
    border-radius: 12px;
    padding: 8px 12px;
    justify-content: center;
    width: 100%;
}

body.dark-mode .pagination {
    background: var(--pagination-bg-dark);
    border: 1px solid var(--pagination-border-dark);
}

.pagination button {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Remove underline from pagination links that wrap buttons */
.pagination a,
.pagination a button {
    text-decoration: none;
}

body.dark-mode .pagination button {
    color: var(--text-light);
}

.pagination button:hover:not(.active, .disabled) {
    background: rgba(255, 144, 0, 0.1);
    color: var(--primary);
}

.pagination button.active {
    background: var(--primary);
    color: white;
}

.pagination button.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination button.disabled:hover {
    background: transparent;
    color: var(--text-dark);
}

body.dark-mode .pagination button.disabled:hover {
    color: var(--text-light);
}

.pagination-numbers {
    display: flex;
    gap: 4px;
    margin: 0 8px;
}

.pagination-ellipsis {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    color: var(--text-dark);
    font-weight: 600;
}

body.dark-mode .pagination-ellipsis {
    color: var(--text-light);
}

/* Video page styles */
.video-page {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 28px;
    align-items: start;
    margin-top: 20px;
}

@media (max-width: 980px) {
    .video-page {
        grid-template-columns: 1fr;
    }
}



.video-player-wrap {
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}

.video-player { width: 100%; height: auto; display:block; }

.video-meta-card {
    margin-top: 14px;
    background: var(--card-light);
    border-radius: 12px;
    padding: 14px;
    border: 1px solid rgba(0,0,0,0.06);
}

.meta-top { display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; }

.counters-inline { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.counter-item { display:flex; align-items:center; gap:8px; color:var(--text-dark); }
.counter-item i { color:var(--primary); font-size:1rem; }
.counter-item .label { font-size:0.9rem; opacity:0.8; }
.counter-item strong { font-size:1.05rem; margin-left:6px; }

.btn-download { padding:8px 12px; border-radius:8px; font-weight:700; margin-left:6px; }
.btn-outline { border:1px solid rgba(0,0,0,0.08); background:transparent; color:var(--text-dark); }

.btn-like, .btn-share, .btn-flag { background:transparent; border:1px solid rgba(0,0,0,0.06); padding:8px 10px; border-radius:8px; cursor:pointer; font-weight:600; }
.btn-like i, .btn-share i, .btn-flag i { color:var(--primary); margin-inline-end:6px; }

.video-description { margin-top:12px; border-top:1px dashed rgba(0,0,0,0.04); padding-top:12px; }
.desc-text { line-height:1.6; color:var(--text-dark); }
.desc-text.muted { color:#888; }

/* (duplicate) scope related grid to sidebar */
.video-sidebar .related-grid { grid-template-columns: 1fr; gap: 12px; }

/* Default related grid for bottom placement */
.related-section.bottom-related .related-grid { grid-template-columns: repeat(3, 1fr); gap: 18px; }

.related-item .video-info { padding: 10px; }
.related-item .video-title { font-size:0.95rem; min-height:2.7em; }

/* Video page styles */
.video-page {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 28px;
    align-items: start;
    margin-top: 20px;
}

@media (max-width: 980px) {
    .video-page {
        grid-template-columns: 1fr;
    }
}


.video-player-wrap {
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}

.video-player { width: 100%; height: auto; display:block; }

.video-meta-card {
    margin-top: 14px;
    background: var(--card-light);
    border-radius: 12px;
    padding: 14px;
    border: 1px solid rgba(0,0,0,0.06);
}

.meta-top { display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; }

.counters-inline { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.counter-item { display:flex; align-items:center; gap:8px; color:var(--text-dark); }
.counter-item i { color:var(--primary); font-size:1rem; }
.counter-item .label { font-size:0.9rem; opacity:0.8; }
.counter-item strong { font-size:1.05rem; margin-left:6px; }

.btn-download { padding:8px 12px; border-radius:8px; font-weight:700; margin-left:6px; }
.btn-outline { border:1px solid rgba(0,0,0,0.08); background:transparent; color:var(--text-dark); }

.btn-like, .btn-share, .btn-flag { background:transparent; border:1px solid rgba(0,0,0,0.06); padding:8px 10px; border-radius:8px; cursor:pointer; font-weight:600; }
.btn-like i, .btn-share i, .btn-flag i { color:var(--primary); margin-inline-end:6px; }

.video-description { margin-top:12px; border-top:1px dashed rgba(0,0,0,0.04); padding-top:12px; }
.desc-text { line-height:1.6; color:var(--text-dark); }
.desc-text.muted { color:#888; }

/* Smaller related grid when inside sidebar */
.video-sidebar .related-grid { grid-template-columns: 1fr; gap: 12px; }

/* Default related grid for bottom placement */
.related-section.bottom-related .related-grid { grid-template-columns: repeat(3, 1fr); gap: 18px; }

.related-item .video-info { padding: 10px; }
.related-item .video-title { font-size:0.95rem; min-height:2.7em; }

/* Ensure bottom related section spans full width and has spacing */
.full-width-related { grid-column: 1 / -1; margin-top: 38px; display:block; clear:both; width:100%; }

/* Force video and details to use full width across content */
.video-main { grid-column: 1 / -1; }
.video-meta-card, .video-player-wrap, .video-player { width:100%; max-width:none; }

/* Footer */
footer {
    background: var(--secondary);
    color: var(--text-light);
    padding: 50px 0 28px;
    margin-top: 40px;
    transition: all 0.3s ease;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    margin-bottom: 30px;
}

.footer-links {
    display: flex;
    gap: 28px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.footer-links a {
    color: #ddd;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
    padding-bottom: 4px;
}

.footer-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s;
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-links a:hover::after {
    width: 100%;
}

.footer-text {
    color: #aaa;
    max-width: 500px;
    line-height: 1.8;
    text-align: right;
    font-size: 1.05rem;
}

.footer-bottom {
    /* display: flex; */
    /* justify-content: space-between; */
    /* align-items: center; */
    padding-top: 28px;
    border-top: 1px solid #444;
    flex-wrap: wrap;
    /* gap: 20px; */
    text-align: center;
}

.copyright {
    color: #888;
    font-size: 1rem;
}

/* RESPONSIVE DESIGN */
@media (max-width: 992px) {
    .video-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-links {
        justify-content: center;
    }

    .footer-text {
        text-align: center;
        margin: 0 auto;
    }

    .search-box {
        width: 200px;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 20px;
    }

    .search-box {
        width: 200px;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .section-title {
        font-size: 1.7rem;
    }

    .pagination {
        padding: 6px 10px;
    }

    .pagination button {
        min-width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .video-grid {
        grid-template-columns: 1fr;
    }

    .footer-links {
        flex-direction: column;
        gap: 18px;
        text-align: center;
    }

    .footer-text {
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    /* Make search + theme toggle share a single row and use 90% width */
    .search-container {
        width: 90%;
        max-width: 90%;
        margin: 0 auto;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .search-box { flex: 1; width: auto; }
    .search-button { width: 50px; flex: 0 0 50px; }

    .header-controls {
        display: flex;
        flex-direction: row;
        width: 100%;
        margin: 10px auto 0;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
    }

    .theme-toggle { flex: 0 0 auto; }

    /* Mobile: hide horizontal tag scroller and clip overflow (no scroll) */
    .tag-scroll { overflow: hidden !important; white-space: nowrap !important; max-width: calc(100% - var(--tag-more-width) - 12px) !important; }

    /* Related videos: stack one per row on mobile */
    .related-grid { grid-template-columns: 1fr !important; gap: 12px !important; }

    .pagination {
        padding: 6px 8px;
        gap: 4px;
    }

    .pagination button {
        min-width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }

    .pagination-numbers {
        margin: 0 4px;
        gap: 2px;
    }
}

/* Video page actions */
.video-actions {
    margin: 14px 0 18px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.06);
    text-decoration: none;
    color: var(--text-dark);
    background: transparent;
    font-weight: 600;
    transition: all 0.18s ease;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(0,0,0,0.06);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    border: none;
}

body.dark-mode .btn {
    color: var(--text-light);
}

/* Dark mode: video meta card and counters */
body.dark-mode .video-meta-card,
body.dark-mode .video-counters {
    background: var(--card-dark);
    border: 1px solid rgba(255,255,255,0.06);
    color: var(--text-light);
}

body.dark-mode .video-meta-card .desc-text,
body.dark-mode .video-meta-card .counter-item,
body.dark-mode .video-counters .counter-item {
    color: var(--text-light);
}

body.dark-mode .btn-outline {
    border-color: rgba(255,255,255,0.08);
    color: var(--text-light);
}

body.dark-mode .btn-like,
body.dark-mode .btn-share,
body.dark-mode .btn-flag {
    border-color: rgba(255,255,255,0.06);
    color: var(--text-light);
    background: transparent;
}

body.dark-mode .counter-item .label { opacity: 0.85; color: #d8d8d8; }
body.dark-mode .video-meta-card .btn-download { color: var(--text-light); }

/* Video page title spacing and responsive sizing */
.video-page-title {
    margin: 18px 0 12px;
    font-size: 1.6rem;
    font-weight: 700;
}

/* Force 16:9 player and limit height */
.video-player {
    width: 100%;
    aspect-ratio: 16/9;
    height: auto;
    max-height: 70vh;
    display: block;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.related-section {
    margin-top: 36px;
}

.related-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

/* Ensure related thumbnails are exactly 16:9 and cover */
.related-item .video-thumb {
    padding-top: 56.25%; /* 16:9 */
    background-size: cover;
    background-position: center;
}

/* Remove underline from related video titles and ensure anchors don't underline */
.video-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.video-title {
    text-decoration: none;
    margin-top: 8px;
}

/* Policy / legal content styling */
.policy-content {
    background: var(--card-light);
    padding: 22px;
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.04);
    color: var(--text-dark);
    line-height: 1.9;
}

/* Tags index styling */
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 12px;
    margin-top: 14px;
}

/* Tag badges - ensure no underlines on link text or count, across all states */
a.tag-badge, a.tag-badge:link, a.tag-badge:visited, a.tag-badge:hover, a.tag-badge:focus, a.tag-badge:active {
    text-decoration: none;
}

.tag-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 18px;
    background: rgba(0,0,0,0.04);
    color: var(--text-dark);
    text-decoration: none; /* defensive: remove underline */
    border: 1px solid rgba(0,0,0,0.03);
    font-weight: 600;
    transition: all 0.12s ease;
}

.tag-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.04);
}

.tag-badge .tag-count {
    background: rgba(255,144,0,0.12);
    color: var(--primary);
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.9rem;
}

body.dark-mode .tag-badge {
    background: rgba(255,255,255,0.02);
    color: var(--text-light);
    border-color: rgba(255,255,255,0.02);
}

/* Compact one-line tags bar for homepage */
:root {
    --tag-badge-height: 44px; /* visual reference for one/both rows */
    --tag-more-width: 140px; /* width reserved for Show More */
}

/* Accessibility helper: screen-reader friendly images that are still indexable */
.sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}


/* Default (desktop): flex row, tag-scroll takes remaining space but never overlaps the Show More */
.tags-inline {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 10px 0 18px;
    position: relative;
    flex-wrap: nowrap; /* keep tags on single line; overflow will be hidden */
}

/* ensure the 'more' control stays fixed width and vertically centered */
.tags-inline > .tag-more { flex: 0 0 var(--tag-more-width); align-self: center; margin-inline-start: 8px; }

.tag-scroll {
    display: flex;
    gap: 10px;
    overflow: hidden; /* hide overflowing tags and keep single-line appearance */
    white-space: nowrap;
    -webkit-overflow-scrolling: touch; /* smooth scrolling on iOS if needed */
    flex: 1 1 auto;
    min-width: 0;
    max-width: calc(100% - var(--tag-more-width) - 12px); /* reserve space for More */
    position: relative;
}


/* Remove fade overlays and custom scrollbars — keep layout clean and wrap content */


/* Dark mode: slightly different thumb colors */
body.dark-mode .tag-scroll { scrollbar-color: transparent transparent; }
body.dark-mode .tag-scroll::-webkit-scrollbar-track { background: rgba(255,255,255,0.02); }
body.dark-mode .tag-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); }
.tags-inline:hover body.dark-mode .tag-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.22); }

/* fading edges moved to .tag-scroll to avoid overlapping the 'more' control */

.tags-inline .tag-badge {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 8px 12px;
    border-radius: 18px;
    background: rgba(0,0,0,0.04);
    color: var(--text-dark);
    text-decoration: none;
    border: 1px solid rgba(0,0,0,0.03);
    font-weight: 600;
    height: var(--tag-badge-height);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.tags-inline .tag-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.04);
}

body.dark-mode .tags-inline .tag-badge {
    background: rgba(255,255,255,0.02);
    color: var(--text-light);
    border-color: rgba(255,255,255,0.02);
}

/* 'عرض المزيد' uses the same visual style as tags and a fixed width so it's never half-hidden */
.tag-more {
    flex: 0 0 var(--tag-more-width);
    width: var(--tag-more-width);
    height: var(--tag-badge-height);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    box-sizing: border-box;
    background: linear-gradient(90deg, rgba(0,0,0,0.02), rgba(0,0,0,0.04));
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.04);
    color: var(--text-dark);
    font-weight: 700;
    cursor: pointer;
    transition: background 0.14s ease, transform 0.14s ease;
}

.tag-more:hover {
    transform: translateY(-3px);
    background: rgba(0,0,0,0.06);
}

body.dark-mode .tag-more { background: linear-gradient(90deg, rgba(255,255,255,0.02), rgba(255,255,255,0.03)); color: var(--text-light); border-color: rgba(255,255,255,0.02); }

/* Mobile: keep same single-line behavior as desktop so Show More is always fully visible */
@media (max-width: 576px) {
    .tags-inline {
        display: flex;
        gap: 8px;
        align-items: center;
        margin: 10px 0 18px;
    }

    .tag-scroll {
        display: flex;
        gap: 8px;
        overflow-x: auto; /* allow horizontal scrolling on mobile too */
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        flex: 1 1 auto;
        min-width: 0;
        scrollbar-width: thin;
    }

    .tag-more {
        flex: 0 0 var(--tag-more-width);
        width: var(--tag-more-width);
        height: var(--tag-badge-height);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 8px 12px;
        box-sizing: border-box;
    }
}


body.dark-mode .policy-content {
    background: var(--card-dark);
    color: var(--text-light);
    box-shadow: 0 6px 18px rgba(0,0,0,0.2);
}

.policy-content p, .policy-content li {
    margin-bottom: 12px;
    font-size: 1rem;
    text-align: right;
}

.policy-content ol {
    padding-inline-start: 18px;
}

.policy-content a {
    color: var(--primary);
    text-decoration: underline;
}

/* Left-to-right wrapper for English sections inside policy-content */
.policy-content .policy-ltr {
    direction: ltr;
    text-align: left;
    unicode-bidi: embed;
}

.policy-content .policy-ltr h1,
.policy-content .policy-ltr p,
.policy-content .policy-ltr li {
    text-align: left;
    direction: ltr;
}

/* When a section title itself is LTR, move decorative bars to the left */
.policy-ltr.section-title {
    text-align: left;
}

.policy-ltr.section-title::after {
    left: 0;
    right: auto;
}

.policy-ltr.section-title::before {
    left: 90px;
    right: auto;
}

.disclaimer {
    text-align: center;
    color: #aaa;
    margin-bottom: 30px;
}