/*
 * Sakeenah Platform — Frontend Theme
 * Design: matches sakeenah.world reference
 * Brand colours injected via PHP <style> in each page (--primary / --secondary from DB)
 */

/* ── Page chrome ── */
body {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4efe9 100%);
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ── Page container ── */
.sk-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem 3rem;
}

/* ── Hero section ── */
.sk-hero {
    background: linear-gradient(135deg, var(--secondary, #163b6d) 0%, var(--primary, #bd710d) 100%);
    color: #fff;
    padding: 4rem 1.5rem;
    text-align: center;
    margin-bottom: 2rem;
    border-radius: 0 0 1rem 1rem;
    position: relative;
    overflow: hidden;
}
.sk-hero::before {
    content: '';
    position: absolute; inset: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="p" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M20,20 L80,20 L80,80 L20,80 Z" fill="none" stroke="%23ffffff" stroke-width="2" stroke-opacity="0.08"/><circle cx="50" cy="50" r="10" fill="%23ffffff" fill-opacity="0.04"/></pattern></defs><rect width="100" height="100" fill="url(%23p)"/></svg>');
    opacity: .4;
    pointer-events: none;
}
.sk-hero__inner {
    position: relative; z-index: 1;
    max-width: 760px; margin: 0 auto;
}
.sk-hero__arabic {
    font-family: 'Scheherazade New','Amiri',serif;
    font-size: 2rem; color: var(--accent-light, #e8b96a);
    margin-bottom: .75rem; direction: rtl;
}
.sk-hero h1 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700; color: #fff;
    margin-bottom: .75rem; text-shadow: 1px 2px 6px rgba(0,0,0,.3);
}
.sk-hero p {
    font-size: 1.1rem; color: rgba(255,255,255,.9);
    margin-bottom: 1.5rem; line-height: 1.6;
}
.sk-hero__cta {
    display: inline-flex; align-items: center; gap: .5rem;
    background: #2e7d32; color: #fff;
    padding: .9rem 1.75rem; border-radius: .75rem;
    font-weight: 600; font-size: 1rem;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(0,0,0,.25);
    transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}
.sk-hero__cta:hover {
    background: #1b5e20; transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,.3); color: #fff;
}

/* ── Two-column layout ── */
.sk-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 2rem;
    align-items: start;
}
@media (max-width: 1024px) { .sk-layout { grid-template-columns: 1fr; } }

/* ── Filter bar ── */
.sk-filterbar {
    background: #fff;
    border: 1px solid #e8eaed;
    border-radius: .75rem;
    box-shadow: 0 2px 8px rgba(0,0,0,.07);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    display: flex; flex-wrap: wrap; gap: 1rem; align-items: center;
}
.sk-filterbar__group {
    display: flex; align-items: center; gap: .5rem;
}
.sk-filterbar__group label {
    font-weight: 600; font-size: .875rem; color: #5f6368; white-space: nowrap;
}
.sk-filterbar select,
.sk-filterbar input[type="text"] {
    padding: .45rem .75rem;
    border: 1px solid #dadce0; border-radius: .5rem;
    background: #fff; color: #3c4043;
    font-size: .875rem; font-family: inherit;
    transition: border-color .15s;
}
.sk-filterbar select:focus,
.sk-filterbar input[type="text"]:focus {
    outline: none; border-color: var(--primary,.bd710d);
    box-shadow: 0 0 0 3px rgba(189,113,13,.12);
}
.sk-filterbar__search { flex: 1; min-width: 180px; }
.sk-filterbar__search input { width: 100%; }

/* ── Cards (question/story/etc) ── */
.sk-card {
    background: #fff;
    border: 1px solid #e8eaed;
    border-radius: .75rem;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,.07);
    position: relative; overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
    cursor: pointer;
}
.sk-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,.12);
    border-color: var(--primary-light, #e89c3a);
}
.sk-card::before {
    content: '';
    position: absolute; top: 0; left: 0;
    width: 4px; height: 100%;
    background: linear-gradient(to bottom, var(--primary, #bd710d), var(--secondary, #163b6d));
    opacity: 0; transition: opacity .2s ease;
}
.sk-card:hover::before { opacity: 1; }

.sk-card__title {
    font-size: 1.0625rem; font-weight: 600;
    color: var(--secondary, #163b6d); line-height: 1.4;
    margin-bottom: .5rem;
}
.sk-card__title a { color: inherit; text-decoration: none; }
.sk-card__title a:hover { color: var(--primary, #bd710d); }

.sk-card__body {
    color: #5f6368; font-size: .9375rem; line-height: 1.6;
    margin-bottom: 1rem;
}

.sk-card__footer {
    display: flex; justify-content: space-between; align-items: center;
    padding-top: .75rem;
    border-top: 1px solid #f1f3f4;
    flex-wrap: wrap; gap: .5rem;
}

/* ── Meta row ── */
.sk-meta {
    display: flex; flex-wrap: wrap; gap: 1rem;
    font-size: .8125rem; color: #80868b;
}
.sk-meta__item { display: flex; align-items: center; gap: .3rem; }

/* ── User chip ── */
.sk-user {
    display: flex; align-items: center; gap: .5rem;
    font-size: .8125rem;
}
.sk-user__avatar {
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--primary, #bd710d);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 600; font-size: .8rem;
    overflow: hidden; flex-shrink: 0;
}
.sk-user__avatar img { width: 100%; height: 100%; object-fit: cover; }
.sk-user__name { font-weight: 500; color: #5f6368; }
.sk-user__date { color: #9aa0a6; }

/* ── Featured badge ── */
.sk-badge-featured {
    background: linear-gradient(135deg, #f9ab00, var(--primary, #bd710d));
    color: #fff; padding: .15rem .55rem;
    border-radius: .25rem; font-size: .75rem; font-weight: 600;
}
.sk-badge-cat {
    background: var(--primary, #bd710d); color: #fff;
    padding: .15rem .5rem; border-radius: .25rem;
    font-size: .75rem; font-weight: 600; white-space: nowrap;
}

/* ── Sidebar ── */
.sk-sidebar { display: flex; flex-direction: column; gap: 1.5rem; }

.sk-widget {
    background: #fff;
    border: 1px solid #e8eaed;
    border-radius: .75rem;
    box-shadow: 0 2px 8px rgba(0,0,0,.07);
    overflow: hidden;
}
.sk-widget__title {
    font-size: 1rem; font-weight: 600;
    color: var(--secondary, #163b6d);
    padding: .875rem 1.1rem;
    border-bottom: 1px solid #f1f3f4;
    display: flex; align-items: center; gap: .5rem;
    background: #fafafa;
}
.sk-widget__body { padding: .75rem 1.1rem; }

/* Category list in sidebar */
.sk-cat-list { display: flex; flex-direction: column; gap: .2rem; }
.sk-cat-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: .6rem .75rem; border-radius: .5rem;
    text-decoration: none; color: #3c4043; font-size: .875rem;
    border: 1px solid transparent;
    transition: background .15s, border-color .15s;
}
.sk-cat-item:hover  { background: #f8f9fa; border-color: var(--primary-light, #e89c3a); }
.sk-cat-item.active { background: var(--primary, #bd710d); color: #fff; }
.sk-cat-item.active .sk-cat-count { background: rgba(255,255,255,.2); color: #fff; }
.sk-cat-name { font-weight: 500; }
.sk-cat-count {
    background: #e8eaed; color: #5f6368;
    padding: .1rem .45rem; border-radius: .25rem;
    font-size: .75rem; font-weight: 600;
}

/* Popular list in sidebar */
.sk-popular-list { display: flex; flex-direction: column; gap: .6rem; }
.sk-popular-item {
    display: flex; align-items: flex-start; gap: .75rem;
    padding: .6rem .75rem; border-radius: .5rem;
    text-decoration: none; color: inherit;
    border: 1px solid transparent;
    transition: background .15s, border-color .15s;
}
.sk-popular-item:hover { background: #f8f9fa; border-color: var(--primary-light, #e89c3a); }
.sk-popular-num {
    background: var(--primary, #bd710d); color: #fff;
    width: 22px; height: 22px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .72rem; font-weight: 700; flex-shrink: 0; margin-top: 1px;
}
.sk-popular-title {
    font-size: .875rem; font-weight: 500;
    color: var(--secondary, #163b6d); line-height: 1.4;
    margin-bottom: .2rem;
}
.sk-popular-meta { font-size: .75rem; color: #9aa0a6; }

/* Daily reminder widget */
.sk-reminder {
    background: #f8f9fa; padding: 1rem;
    border-radius: .5rem;
    border-left: 4px solid var(--primary, #bd710d);
}
.sk-reminder p { font-style: italic; color: #5f6368; line-height: 1.7; margin-bottom: .5rem; }
.sk-reminder cite { font-size: .8rem; color: #80868b; display: block; text-align: right; }

/* CTA widget */
.sk-widget-cta {
    background: linear-gradient(135deg, var(--primary, #bd710d), var(--primary-dark, #9a5d0a));
    color: #fff; padding: 1.25rem 1.1rem; text-align: center;
}
.sk-widget-cta h4 { color: #fff; font-size: 1rem; margin-bottom: .5rem; }
.sk-widget-cta p { color: rgba(255,255,255,.88); font-size: .875rem; line-height: 1.6; margin-bottom: 1rem; }
.sk-widget-cta a {
    display: block; background: #fff; color: var(--primary, #bd710d);
    padding: .7rem; border-radius: .5rem;
    font-weight: 600; text-decoration: none;
    transition: opacity .15s;
}
.sk-widget-cta a:hover { opacity: .88; }

/* ── Filter tabs (category pills) ── */
.sk-tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.5rem; }
.sk-tab {
    padding: .4rem 1rem; border-radius: 999px;
    text-decoration: none; font-size: .875rem; font-weight: 500;
    color: #5f6368; background: #fff;
    border: 1px solid #dadce0;
    transition: all .15s;
}
.sk-tab:hover, .sk-tab.active {
    background: var(--primary, #bd710d); color: #fff; border-color: var(--primary, #bd710d);
}

/* ── Pagination ── */
.sk-pagination {
    display: flex; justify-content: center; align-items: center;
    flex-wrap: wrap; gap: .4rem; margin-top: 2rem;
}
.sk-page-btn {
    padding: .45rem 1rem; border: 1px solid #dadce0;
    border-radius: .5rem; text-decoration: none;
    color: #5f6368; background: #fff; font-size: .875rem; font-weight: 500;
    transition: all .15s;
}
.sk-page-btn:hover, .sk-page-btn.active {
    background: var(--primary, #bd710d); color: #fff; border-color: var(--primary, #bd710d);
    transform: translateY(-1px);
}
.sk-page-info { color: #80868b; font-size: .875rem; padding: .45rem .6rem; }

/* ── Empty state ── */
.sk-empty { text-align: center; padding: 4rem 1rem; color: #9aa0a6; }
.sk-empty i { font-size: 3.5rem; margin-bottom: 1rem; opacity: .45; display: block; }
.sk-empty h3 { color: #5f6368; margin-bottom: .5rem; }

/* ── Breadcrumbs ── */
.sk-breadcrumbs {
    display: flex; flex-wrap: wrap; align-items: center; gap: .4rem;
    padding: .75rem 0; font-size: .875rem; margin-bottom: .5rem;
}
.sk-breadcrumbs a { color: #80868b; text-decoration: none; }
.sk-breadcrumbs a:hover { color: var(--primary, #bd710d); }
.sk-breadcrumbs .sep { color: #bdc1c6; }
.sk-breadcrumbs .cur { color: var(--secondary, #163b6d); font-weight: 500; }

/* ── Image fallback hero (for show pages) ── */
.sk-img-hero {
    border-radius: .75rem; overflow: hidden;
    margin-bottom: 1.75rem;
}
.sk-img-hero img { width: 100%; max-height: 420px; object-fit: cover; display: block; }
.sk-img-fallback {
    background: linear-gradient(135deg, var(--secondary, #163b6d) 0%, var(--primary, #bd710d) 100%);
    min-height: 260px; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    text-align: center; color: #fff; padding: 3rem 1.5rem;
    border-radius: .75rem;
}
.sk-img-fallback i { font-size: 4rem; color: var(--accent-light, #e8b96a); margin-bottom: 1rem; }

/* ── Share bar ── */
.sk-share {
    display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
    background: #f8f9fa; padding: .875rem 1.25rem;
    border-radius: .75rem; margin: 1.75rem 0;
}
.sk-share strong { font-size: .875rem; color: #5f6368; }
.sk-share a, .sk-share button {
    width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    text-decoration: none; font-size: .95rem;
    border: none; cursor: pointer; background: #e8eaed; color: #5f6368;
    transition: background .15s, color .15s, transform .15s;
}
.sk-share a:hover, .sk-share button:hover { transform: translateY(-2px); }
.sk-share .tw:hover { background: #1DA1F2; color: #fff; }
.sk-share .fb:hover { background: #4267B2; color: #fff; }
.sk-share .wa:hover { background: #25D366; color: #fff; }
.sk-share .lk:hover { background: var(--primary, #bd710d); color: #fff; }

/* ── Audio player ── */
.sk-player {
    background: linear-gradient(135deg, var(--secondary, #163b6d) 0%, var(--primary, #bd710d) 100%);
    border-radius: .75rem; padding: 1.5rem; color: #fff; margin-bottom: 1.75rem;
}
.sk-player__cover {
    width: 130px; height: 130px; border-radius: .75rem;
    background: rgba(255,255,255,.15); overflow: hidden;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.sk-player__cover img { width: 100%; height: 100%; object-fit: cover; }
.sk-player__cover i { font-size: 3.5rem; color: var(--accent-light, #e8b96a); }
.sk-player__info h2 { color: #fff; margin-bottom: .25rem; }
.sk-player__info p { color: rgba(255,255,255,.85); font-size: .9375rem; }
.sk-player__controls { margin-top: 1.25rem; }
.sk-player__bar {
    width: 100%; height: 5px; background: rgba(255,255,255,.25);
    border-radius: 3px; cursor: pointer; margin: .75rem 0;
}
.sk-player__progress {
    height: 100%; background: var(--accent-light, #e8b96a);
    border-radius: 3px; width: 0; transition: width .1s;
}
.sk-player__btn {
    background: rgba(255,255,255,.15); border: none; cursor: pointer;
    color: #fff; width: 42px; height: 42px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1rem; transition: background .15s;
}
.sk-player__btn.play { width: 52px; height: 52px; font-size: 1.2rem; background: var(--accent-light, #e8b96a); color: #1b1b1b; }
.sk-player__btn:hover { background: rgba(255,255,255,.25); }
.sk-player__btn.play:hover { filter: brightness(1.1); }
.sk-player__time { font-size: .8rem; color: rgba(255,255,255,.75); }

/* ── Responsive ── */
@media (max-width: 768px) {
    .sk-hero { padding: 2.5rem 1rem; border-radius: 0 0 .75rem .75rem; }
    .sk-hero h1 { font-size: 1.75rem; }
    .sk-filterbar { flex-direction: column; }
    .sk-card__footer { flex-direction: column; align-items: flex-start; }
    .sk-meta { flex-direction: column; gap: .4rem; }
    .sk-player .sk-player__cover { width: 90px; height: 90px; }
}
@media (max-width: 480px) {
    .sk-page { padding: 0 .75rem 2rem; }
    .sk-card { padding: 1rem; }
    .sk-widget__body { padding: .5rem .75rem; }
}

/* ── Listening widget ── */
.sk-listen-widget {
    background: #f8f9fa;
    border: 1px solid #e8eaed;
    border-radius: .75rem;
    padding: 1rem 1.1rem;
    margin: 1.5rem 0;
}
.sk-listen-header {
    display: flex; align-items: center; justify-content: space-between;
}

/* ── World History Timeline ── */
.sk-timeline { position: relative; padding: 1rem 0; }
.sk-timeline::before {
    content: '';
    position: absolute;
    left: 50%; transform: translateX(-50%);
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, var(--primary), var(--secondary));
    border-radius: 2px;
}
.sk-tl-item {
    display: flex; align-items: center;
    position: relative; width: 100%;
    margin-bottom: 2rem;
}
.sk-tl-item:nth-child(odd) { justify-content: flex-start; }
.sk-tl-item:nth-child(even) { justify-content: flex-end; }
.sk-tl-content {
    background: #fff; border: 1px solid #e8eaed;
    border-radius: .75rem; padding: 1rem 1.25rem;
    width: 44%; box-shadow: 0 2px 8px rgba(0,0,0,.07);
    border-left: 4px solid var(--primary);
    transition: transform .2s ease, box-shadow .2s ease;
}
.sk-tl-content:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.12); }
.sk-tl-dot {
    position: absolute; left: 50%; transform: translateX(-50%);
    width: 18px; height: 18px;
    background: var(--primary); border: 3px solid #fff; border-radius: 50%; z-index: 2;
    box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.sk-tl-year {
    position: absolute; top: 50%;
    transform: translateY(-50%);
    background: var(--primary); color: #fff;
    padding: .2rem .55rem; border-radius: .35rem;
    font-size: .72rem; font-weight: 700;
    white-space: nowrap;
}
.sk-tl-item:nth-child(odd) .sk-tl-year { right: calc(56% - 4rem); }
.sk-tl-item:nth-child(even) .sk-tl-year { left: calc(56% - 4rem); }
.sk-tl-title { font-weight: 600; color: var(--secondary); margin-bottom: .25rem; font-size: .9375rem; }
.sk-tl-desc { font-size: .8125rem; color: #5f6368; line-height: 1.5; }

/* ── Era cards ── */
.sk-era-grid { display: grid; grid-template-columns: repeat(3,1fr); gap:1.25rem; }
@media(max-width:768px){ .sk-era-grid { grid-template-columns:1fr; } }
.sk-era-card {
    background: #fff; border: 1px solid #e8eaed;
    border-radius: .75rem; padding: 1.25rem;
    border-left: 5px solid var(--primary);
    transition: transform .2s, box-shadow .2s;
    text-decoration: none; color: inherit; display: block;
}
.sk-era-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,.12); }
.sk-era-card h4 { color: var(--secondary); font-weight: 700; margin-bottom: .35rem; }
.sk-era-card p { font-size: .875rem; color: #5f6368; }

/* Responsive timeline */
@media(max-width:768px){
    .sk-timeline::before { left: 18px; }
    .sk-tl-item { justify-content: flex-start !important; padding-left: 45px; }
    .sk-tl-content { width: 100%; }
    .sk-tl-dot { left: 18px; }
    .sk-tl-year { left: -42px !important; right: auto !important; font-size: .68rem; }
}
