/* ============================================
   T-Quiz Article Detail - Custom Styles
   Extends Bootstrap 5
   ============================================ */

/* ---------- Base Override ---------- */
:root {
    --color-primary: #1e293b;
    --color-accent: #6366f1;
    --color-accent-hover: #4f46e5;
    --color-text: #334155;
    --color-text-light: #64748b;
    --color-text-muted: #94a3b8;
    --color-category: #6366f1;
    --color-category-bg: rgba(99, 102, 241, 0.1);
    --color-bg-body: #fafafa;
    --font-heading: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.03);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Surface & Border System */
    --color-surface: #ffffff;
    --color-surface-soft: #f9fafb;
    --color-border-main: #e5e7eb;
    --color-border-soft: rgba(0, 0, 0, 0.03);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--color-text);
    background-color: var(--color-bg-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6,
.navbar,
.btn,
.badge,
.small,
.text-muted,
input,
button,
.article-meta__category,
.article-meta__date,
.article-meta__read-time,
.article-card__category,
.section-heading,
.nav-link,
.dropdown-item {
    font-family: var(--font-heading);
}

.card {
    background-color: var(--color-surface) !important;
    border: 1px solid var(--color-border-soft) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-soft);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.rounded-3 {
    border-radius: var(--radius-lg) !important;
}

.rounded-4 {
    border-radius: var(--radius-xl) !important;
}

.bg-light {
    background-color: #ffffff !important;
}

.transition-hover:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
}

/* ---------- Article Navbar ---------- */
.article-navbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: rgba(255, 255, 255, 0.85);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.article-navbar__brand {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--color-primary) !important;
    text-decoration: none;
    letter-spacing: -0.02em;
    transition: opacity var(--transition-fast);
}

.article-navbar__brand:hover {
    opacity: 0.7;
}

/* ---------- Article Meta ---------- */
.article-meta__category {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-category);
    background: var(--color-category-bg);
    padding: 4px 12px;
    border-radius: 100px;
    transition: all var(--transition-fast);
}

.article-meta__category:hover {
    background: var(--color-category);
    color: #fff;
}

.article-meta__date {
    font-size: 0.875rem;
    color: var(--color-text-light);
}

.article-meta__share-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #e5e7eb;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--color-text-light);
}

.article-meta__share-btn:hover {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
    transform: scale(1.05);
}

/* ---------- Article Title ---------- */
.article-title {
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1.25;
    color: var(--color-primary);
    letter-spacing: -0.03em;
}

@media (max-width: 768px) {
    .article-title {
        font-size: 1.6rem;
    }
}

/* ---------- Author Info ---------- */
.author-info__avatar {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-accent), #a78bfa);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
}

.author-info__name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-text);
}

.author-info__role {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

/* ---------- Hero Image ---------- */
.article-hero {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
}

.article-hero__img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease;
}

.article-hero:hover .article-hero__img {
    transform: scale(1.02);
}

.article-hero__caption {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-align: center;
    padding: 12px 16px;
    font-style: italic;
    background: #f9fafb;
}

/* ---------- Article Body / Content ---------- */
.article-body {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--color-text);
    max-width: 70ch;
    margin-left: auto;
    margin-right: auto;
    letter-spacing: -0.011em;
}

.article-body h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 40px;
    margin-bottom: 16px;
    color: var(--color-primary);
    letter-spacing: -0.01em;
}

.article-body h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 32px;
    margin-bottom: 12px;
    color: var(--color-primary);
}

.article-body p {
    margin-bottom: 20px;
}

.article-body ul,
.article-body ol {
    margin-bottom: 20px;
    padding-left: 24px;
}

.article-body li {
    margin-bottom: 8px;
}

.article-body blockquote {
    position: relative;
    border-left: 4px solid var(--color-accent);
    margin: 32px 0;
    padding: 24px 32px;
    background: #f3f4f6;
    border-radius: 0 12px 12px 0;
    font-style: italic;
    color: var(--color-text);
    font-size: 1.2rem;
    line-height: 1.6;
}

.article-body blockquote::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 10px;
    font-size: 4rem;
    color: rgba(108, 99, 255, 0.15);
    font-family: Georgia, serif;
}

.article-body strong {
    font-weight: 600;
    color: var(--color-primary);
}

.article-body img {
    border-radius: 12px;
    margin: 20px 0;
}

/* ---------- Section Headings ---------- */
.section-heading,
.section-heading-bordered {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: -0.01em;
}

/* ---------- Video Card (YouTube Style) ---------- */
.video-card {
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: transparent;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.video-card:hover {
    transform: translateY(-4px);
}

.video-card__iframe {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: #000;
    box-shadow: var(--shadow-soft);
}

.video-card__iframe iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-card__title {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text);
    padding: 16px 4px 4px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s ease;
}

.video-card__title:hover {
    color: #cc0000;
}

/* ---------- Comment Section ---------- */
.comment-guest-alert {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
}

.comment-form textarea {
    border-radius: 12px;
    resize: none;
}

.comment-form textarea:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.1);
}

.comment-item__avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
}

.replies {
    border-left: 2px solid #e9ecef !important;
}

@media (max-width: 768px) {
    .video-card__iframe {
        border-radius: 8px;
    }

    .video-card__title {
        font-size: 0.875rem;
    }
}

/* ---------- Subscribe Box ---------- */
.subscribe-box {
    background: #f3f4f6;
    border-radius: 24px;
    border: 1px solid #e5e7eb;
}

.subscribe-box__icon {
    color: var(--color-text-light);
}

.subscribe-box__title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--color-primary);
}

.subscribe-box__desc {
    font-size: 0.9rem;
    color: var(--color-text-light);
    max-width: 420px;
}

.subscribe-box__input {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 0.9rem;
    font-family: inherit;
    transition: all var(--transition-fast);
    outline: none;
}

.subscribe-box__input:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.1);
}

.subscribe-box__btn {
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.subscribe-box__btn:hover {
    background: var(--color-accent);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
}

/* ---------- Article Card (Baca Juga) ---------- */
.article-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: all var(--transition-normal);
}

.article-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.08);
    border-color: transparent;
}

.article-card__image {
    aspect-ratio: 16/10;
    overflow: hidden;
}

.article-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.article-card:hover .article-card__image img {
    transform: scale(1.08);
}

.article-card__category {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-category);
    font-size: 0.75rem;
}

.article-card__title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card__title a {
    color: inherit;
    text-decoration: none;
}

.article-card__title a:hover {
    color: var(--color-accent);
}

.article-card__excerpt {
    font-size: 0.85rem;
    color: var(--color-text-light);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card__link {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-accent);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.article-card__link:hover {
    color: var(--color-accent-hover);
}

.article-card__link svg {
    width: 14px;
    height: 14px;
    transition: transform var(--transition-fast);
}

.article-card__link:hover svg {
    transform: translateX(3px);
}

/* ---------- Load More Button ---------- */
.load-more-btn {
    background: transparent;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-light);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
}

.load-more-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: #f9fafb;
}

.load-more-btn svg {
    width: 16px;
    height: 16px;
    transition: transform var(--transition-fast);
}

.load-more-btn:hover svg {
    transform: translateY(3px);
}

/* ---------- Comment Section ---------- */
.comment-form__avatar {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f97316, #ef4444);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
}

.comment-form__textarea {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-family: inherit;
    resize: vertical;
    outline: none;
    transition: border-color var(--transition-fast);
    line-height: 1.6;
    color: var(--color-text);
}

.comment-form__textarea:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.08);
}

.btn-cancel {
    border: 1px solid #e5e7eb;
    background: transparent;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-light);
    transition: all var(--transition-fast);
    font-family: inherit;
}

.btn-cancel:hover {
    background: #f9fafb;
    color: var(--color-text);
}

.btn-submit-comment {
    background: var(--color-accent);
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    transition: all var(--transition-fast);
    font-family: inherit;
}

.btn-submit-comment:hover {
    background: var(--color-accent-hover);
    transform: translateY(-1px);
}

/* Comment item */
.comment-item__avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
}

.comment-item__name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-text);
}

.comment-item__time {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.comment-item__content {
    font-size: 0.9rem;
    color: var(--color-text);
    line-height: 1.6;
}

/* ---------- Article Footer ---------- */
.article-footer {
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.article-footer__title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-primary);
}

.article-footer__desc {
    font-size: 0.85rem;
    color: var(--color-text-light);
    line-height: 1.7;
}

.article-footer__links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.article-footer__links li {
    margin-bottom: 10px;
}

.article-footer__links a {
    font-size: 0.85rem;
    color: var(--color-text-light);
    transition: all var(--transition-fast);
    text-decoration: none;
}

.article-footer__links a:hover {
    color: var(--color-accent);
    padding-left: 4px;
}

.article-footer__copyright {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

/* ---------- Article Container ---------- */
.article-container-narrow {
    max-width: 760px;
    margin: 0 auto;
}

/* ---------- Scroll Progress Bar ---------- */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-accent), #a78bfa);
    z-index: 1050;
    transition: width 0.1s linear;
    border-radius: 0 2px 2px 0;
}

/* ---------- Animations ---------- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
}

.fade-in-up:nth-child(1) {
    animation-delay: 0.05s;
}

.fade-in-up:nth-child(2) {
    animation-delay: 0.1s;
}

.fade-in-up:nth-child(3) {
    animation-delay: 0.15s;
}

.fade-in-up:nth-child(4) {
    animation-delay: 0.2s;
}

.fade-in-up:nth-child(5) {
    animation-delay: 0.25s;
}

.fade-in-up:nth-child(6) {
    animation-delay: 0.3s;
}

/* ---------- Toast ---------- */
.toast-message {
    position: fixed;
    bottom: 32px;
    right: 32px;
    padding: 16px 28px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    font-family: inherit;
}

.toast-message.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-message--success {
    background: #10b981;
    color: #fff;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.toast-message--error {
    background: #ef4444;
    color: #fff;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

/* ---------- Home Page Custom Styles ---------- */
.section-heading-bordered {
    border-left: 4px solid var(--color-accent);
    padding-left: 12px;
    line-height: 1.2;
}

.transition-hover {
    transition: all var(--transition-fast);
}

.transition-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
    border-color: #e5e7eb !important;
}

@media (max-width: 767.98px) {
    .rekomendasi-card img {
        width: 100% !important;
        height: 200px !important;
        order: -1;
        /* Image on top in mobile */
    }
}

/* ---------- Dark Mode ---------- */
[data-theme="dark"] {
    --color-primary: #f8fafc;
    --color-text: #cbd5e1;
    --color-text-light: #94a3b8;
    --color-text-muted: #64748b;
    --color-bg-body: #0f172a;
    --color-category-bg: rgba(99, 102, 241, 0.2);

    /* Dark Mode Surface & Border */
    --color-surface: #1e293b;
    --color-surface-soft: #1e293b;
    --color-border-main: #334155;
    --color-border-soft: #334155;
}

[data-theme="dark"] body {
    background-color: var(--color-bg-body);
    color: var(--color-text);
}

[data-theme="dark"] .bg-light {
    background-color: #1e293b !important;
}

[data-theme="dark"] .bg-white {
    background-color: #1e293b !important;
}

[data-theme="dark"] .text-dark,
[data-theme="dark"] .fw-bold {
    color: #f8fafc !important;
}

[data-theme="dark"] .text-muted {
    color: var(--color-text-light) !important;
}

[data-theme="dark"] .card,
[data-theme="dark"] .ad-banner,
[data-theme="dark"] .subscribe-box,
[data-theme="dark"] .rekomendasi-card a,
[data-theme="dark"] .article-footer,
[data-theme="dark"] .comment-guest-alert {
    background-color: var(--color-surface) !important;
    border-color: var(--color-border-main) !important;
    color: var(--color-primary);
}

/* Article Card Dark Mode Fix */
[data-theme="dark"] .article-card {
    background-color: var(--color-surface);
    border-color: transparent !important;
}

[data-theme="dark"] .article-card:hover {
    border-color: var(--color-border-main) !important;
}

[data-theme="dark"] .subscribe-box__btn {
    color: #0f172a !important;
}

[data-theme="dark"] .article-navbar {
    background: rgba(15, 23, 42, 0.85) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
}

[data-theme="dark"] .dropdown-menu {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #cbd5e1;
}

[data-theme="dark"] .dropdown-item,
[data-theme="dark"] .dropdown-item-text {
    color: #cbd5e1;
}

[data-theme="dark"] .dropdown-item:hover {
    background-color: #334155;
    color: #fff;
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .comment-form__textarea {
    background-color: #334155 !important;
    color: #cbd5e1 !important;
    border-color: #475569 !important;
}

[data-theme="dark"] .btn-cancel {
    border-color: #475569;
    color: #cbd5e1;
}

[data-theme="dark"] .btn-cancel:hover {
    background-color: #334155;
    color: #f8fafc;
}

[data-theme="dark"] .border,
[data-theme="dark"] .border-top,
[data-theme="dark"] .border-bottom,
[data-theme="dark"] .border-start,
[data-theme="dark"] .border-end {
    border-color: #334155 !important;
}

[data-theme="dark"] .theme-icon-moon {
    display: none;
}

[data-theme="dark"] .theme-icon-sun {
    display: inline-block !important;
}

/* ---------- Micro-Animations & Utils ---------- */
.img-hover-zoom {
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

a:hover .img-hover-zoom {
    transform: scale(1.05);
}

.animated-arrow svg {
    transition: transform 0.3s ease;
}

a:hover .animated-arrow svg {
    transform: translateX(4px);
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

.skeleton-bg {
    background: #f3f4f6;
    background-image: linear-gradient(to right, #f3f4f6 0%, #e5e7eb 20%, #f3f4f6 40%, #f3f4f6 100%);
    background-repeat: no-repeat;
    background-size: 1000px 100%;
    animation: shimmer 2s infinite linear forwards;
}

[data-theme="dark"] .skeleton-bg {
    background: #1e293b;
    background-image: linear-gradient(to right, #1e293b 0%, #334155 20%, #1e293b 40%, #1e293b 100%);
}

[data-theme="dark"] .article-body blockquote {
    background: rgba(108, 99, 255, 0.05);
    color: #e5e7eb;
}

/* ---------- Back to Top Button ---------- */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    border: none;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--color-accent);
    transform: translateY(-4px);
    color: #fff;
}

[data-theme="dark"] .back-to-top {
    background: var(--color-accent);
}