/* UI/UX Pro Max — Studios Directory, Authors Directory, Author Profile & Episode/Series Author Embed */
.dg-dir-wrap {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #f8fafc;
}
body.lightmode .dg-dir-wrap { color: #0f172a; }

.dg-dir-crumb {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    font-size: 13px; color: #94a3b8; margin-bottom: 14px; padding: 10px 14px;
    background: #161a26; border: 1px solid #252b3b; border-radius: 8px;
}
.dg-dir-crumb a { color: #60a5fa; font-weight: 600; text-decoration: none; }
.dg-dir-crumb a:hover { text-decoration: underline; }
body.lightmode .dg-dir-crumb { background: #ffffff; border-color: #e2e8f0; color: #475569; }
body.lightmode .dg-dir-crumb a { color: #0c70de; }

.dg-dir-hero {
    display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    padding: 18px 20px; border-radius: 10px; margin-bottom: 16px;
    background: linear-gradient(135deg, #161a26 0%, #1d2436 100%);
    border: 1px solid #2a3247;
}
body.lightmode .dg-dir-hero {
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    border-color: #cbd5e1;
}
.dg-dir-hero h1 {
    margin: 0 0 6px !important; font-size: 22px !important; font-weight: 800 !important;
    color: #f8fafc !important; display: flex; align-items: center; gap: 10px;
}
.dg-dir-hero h1 i { color: #0c70de; }
.dg-dir-hero p { margin: 0; font-size: 13.5px; color: #cbd5e1; line-height: 1.5; }
body.lightmode .dg-dir-hero h1 { color: #0f172a !important; }
body.lightmode .dg-dir-hero p { color: #475569; }

.dg-dir-stats-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dg-dir-stat-pill {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
    font-size: 12.5px; font-weight: 700; background: rgba(12, 112, 222, 0.16); color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.35);
}
body.lightmode .dg-dir-stat-pill { background: #eff6ff; color: #0c70de; border-color: #bfdbfe; }

.dg-dir-controls {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
    margin-bottom: 16px;
}
.dg-dir-search-box {
    position: relative; flex: 1 1 260px; max-width: 380px;
}
.dg-dir-search-box i {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: 13px;
}
.dg-dir-search {
    width: 100%; min-height: 40px; padding: 0 12px 0 34px; border-radius: 8px; box-sizing: border-box;
    background: #12151f; border: 1px solid #2b3347; color: #f8fafc; font-size: 13.5px;
}
.dg-dir-search:focus { outline: 2px solid rgba(12, 112, 222, 0.4); border-color: #0c70de; }
body.lightmode .dg-dir-search { background: #ffffff; border-color: #cbd5e1; color: #0f172a; }

.dg-dir-sort-grp { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dg-dir-pill-btn {
    min-height: 36px; padding: 0 13px; border-radius: 8px; font-size: 12.5px; font-weight: 600;
    cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
    background: #181d2b; border: 1px solid #2b3347; color: #cbd5e1; transition: all .15s ease;
}
.dg-dir-pill-btn:hover { border-color: #60a5fa; color: #ffffff; }
.dg-dir-pill-btn.is-active { background: #0c70de; border-color: #0c70de; color: #ffffff; }
body.lightmode .dg-dir-pill-btn { background: #ffffff; border-color: #cbd5e1; color: #334155; }
body.lightmode .dg-dir-pill-btn:hover { border-color: #0c70de; color: #0c70de; }
body.lightmode .dg-dir-pill-btn.is-active { background: #0c70de; border-color: #0c70de; color: #ffffff; }

.dg-dir-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px;
}
.dg-dir-card {
    background: #161a26; border: 1px solid #262e42; border-radius: 10px; padding: 15px;
    display: flex; flex-direction: column; gap: 11px; transition: border-color .18s ease, transform .18s ease;
    min-width: 0;
}
.dg-dir-card:hover { border-color: #0c70de; transform: translateY(-2px); }
body.lightmode .dg-dir-card { background: #ffffff; border-color: #e2e8f0; box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05); }

.dg-studio-thumbs {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; height: 98px;
}
.dg-studio-thumb-slot {
    border-radius: 6px; overflow: hidden; background: #0f121b; border: 1px solid #252d40;
    display: flex; align-items: center; justify-content: center;
}
.dg-studio-thumb-slot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dg-studio-thumb-slot i { color: #475569; font-size: 18px; }
body.lightmode .dg-studio-thumb-slot { background: #f1f5f9; border-color: #e2e8f0; }

.dg-dir-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dg-dir-card-title {
    margin: 0; font-size: 16px; font-weight: 700; color: #f8fafc; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dg-dir-card-title a { color: inherit; text-decoration: none; }
.dg-dir-card-title a:hover { color: #60a5fa; }
body.lightmode .dg-dir-card-title { color: #0f172a; }
body.lightmode .dg-dir-card-title a:hover { color: #0c70de; }

.dg-dir-cnt {
    flex-shrink: 0; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700;
    background: rgba(16, 185, 129, 0.16); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.35);
}
body.lightmode .dg-dir-cnt { background: #d1fae5; color: #065f46; border-color: #6ee7b7; }

.dg-dir-desc {
    margin: 0; font-size: 12.5px; color: #94a3b8; line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
body.lightmode .dg-dir-desc { color: #475569; }

.dg-dir-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.dg-dir-tag {
    font-size: 11.5px; padding: 2px 8px; border-radius: 5px; text-decoration: none;
    background: #1d2333; border: 1px solid #2d364d; color: #cbd5e1;
    max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dg-dir-tag:hover { border-color: #60a5fa; color: #ffffff; }
body.lightmode .dg-dir-tag { background: #f8fafc; border-color: #cbd5e1; color: #334155; }

.dg-dir-cta {
    margin-top: auto; min-height: 36px; border-radius: 8px; font-size: 13px; font-weight: 600;
    text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    background: #0c70de; color: #ffffff !important; transition: background .15s ease;
}
.dg-dir-cta:hover { background: #095ab5; color: #ffffff !important; }

/* Author Directory & Author Profile Card */
.dg-auth-row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.dg-auth-av {
    width: 54px; height: 54px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
    border: 2px solid #0c70de; background: #0f121b;
}
.dg-auth-av.is-lg { width: 72px; height: 72px; }
.dg-auth-badge {
    display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700;
    padding: 2px 8px; border-radius: 999px;
}
.dg-auth-badge.is-admin { background: #10b981; color: #052e16; }
.dg-auth-badge.is-tg { background: rgba(56, 189, 248, 0.18); color: #7dd3fc; border: 1px solid rgba(56, 189, 248, 0.35); }
.dg-auth-badge.is-author { background: #1e293b; color: #cbd5e1; border: 1px solid #334155; }
body.lightmode .dg-auth-badge.is-tg { background: #e0f2fe; color: #0369a1; border-color: #bae6fd; }
body.lightmode .dg-auth-badge.is-author { background: #f1f5f9; color: #334155; border-color: #cbd5e1; }

.dg-auth-kpis { display: flex; gap: 8px; flex-wrap: wrap; }
.dg-auth-kpi {
    flex: 1 1 90px; background: #12151f; border: 1px solid #252b3b; border-radius: 8px; padding: 8px 10px;
}
.dg-auth-kpi strong { display: block; font-size: 16px; color: #f8fafc; }
.dg-auth-kpi span { font-size: 11.5px; color: #94a3b8; }
body.lightmode .dg-auth-kpi { background: #f8fafc; border-color: #e2e8f0; }
body.lightmode .dg-auth-kpi strong { color: #0f172a; }
body.lightmode .dg-auth-kpi span { color: #64748b; }

/* Embedded Author Card inside Episode & Series Pages */
.dg-ep-author-box {
    margin: 14px 0; padding: 14px 16px; border-radius: 10px;
    background: #161a26; border: 1px solid #262e42;
    display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}
body.lightmode .dg-ep-author-box { background: #f8fafc; border-color: #cbd5e1; }
.dg-ep-author-left { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1 1 260px; }
.dg-ep-author-info { min-width: 0; }
.dg-ep-author-lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #94a3b8; font-weight: 700; margin-bottom: 2px; }
.dg-ep-author-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 15px; font-weight: 700; }
.dg-ep-author-name a { color: #60a5fa; text-decoration: none; }
.dg-ep-author-name a:hover { text-decoration: underline; }
.dg-ep-author-sub { font-size: 12.5px; color: #cbd5e1; margin-top: 3px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dg-ep-author-sub a { color: #93c5fd; text-decoration: none; font-weight: 600; }
.dg-ep-author-sub a:hover { text-decoration: underline; }
body.lightmode .dg-ep-author-name a { color: #0c70de; }
body.lightmode .dg-ep-author-sub { color: #475569; }
body.lightmode .dg-ep-author-sub a { color: #0c70de; }

.dg-ep-author-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dg-ep-author-btn {
    min-height: 36px; padding: 0 13px; border-radius: 8px; font-size: 12.5px; font-weight: 600;
    text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
    background: #0c70de; color: #ffffff !important; border: 1px solid #0c70de; transition: background .15s ease;
}
.dg-ep-author-btn:hover { background: #095ab5; color: #ffffff !important; }
.dg-ep-author-btn.is-sec { background: #1d2333; border-color: #313b54; color: #e2e8f0 !important; }
.dg-ep-author-btn.is-sec:hover { border-color: #60a5fa; color: #ffffff !important; }
body.lightmode .dg-ep-author-btn.is-sec { background: #ffffff; border-color: #cbd5e1; color: #0f172a !important; }

/* Author Archive Type Badges inside Poster Cards */
.dg-arch-type-badge {
    position: absolute; top: 6px; right: 6px; z-index: 4; font-size: 10.5px; font-weight: 700;
    padding: 2px 7px; border-radius: 5px; background: rgba(12, 112, 222, 0.9); color: #ffffff;
}
.dg-arch-type-badge.is-series { background: rgba(16, 185, 129, 0.92); color: #052e16; }

@media (max-width: 640px) {
    .dg-dir-grid { grid-template-columns: 1fr; }
    .dg-ep-author-actions { width: 100%; }
    .dg-ep-author-btn { flex: 1 1 auto; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
    .dg-dir-card, .dg-dir-cta, .dg-dir-pill-btn { transition: none !important; transform: none !important; }
}
