/* Navbar search icon */
.nav-search-icon {
    color: rgba(255,255,255,0.75);
    font-size: 1.2rem;
    transition: color 0.15s;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}
.nav-search-icon:hover { color: #fff; }

/* Carousel */
.carousel-item img {
    height: 400px;
    object-fit: cover;
    cursor: pointer;
}
@media (max-width: 768px) {
    .carousel-item img { height: 220px; }
}

/* Article grid — 3 columns, aligned with carousel */
.masonry-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}
@media (max-width: 992px) {
    .masonry-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 576px) {
    .masonry-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Article card */
.article-card {
    transition: transform 0.2s, box-shadow 0.2s;
    border: none;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}
.article-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}
.article-card .card-img-top {
    width: 100%;
    height: 180px;
    object-fit: cover;
}
.article-card .card-img-placeholder {
    width: 100%;
    height: 180px;
    font-size: 2rem;
}

/* Premium badge - top right corner */
.premium-badge-corner {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 5;
}

/* Premium paywall card */
.premium-gate-card {
    background: #f8f9fa;
    border-color: #dee2e6;
}

/* Footer */
footer,
footer a,
footer p,
footer h5,
footer h6 { color: #eeeeee; }
footer a:hover { color: #ffffff; }

/* Comments — Douyin style */
.cmt-item {
    display: flex;
    gap: 10px;
    padding: 14px 0;
    border-bottom: 1px solid #f2f2f2;
}
.cmt-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    flex-shrink: 0;
    line-height: 1;
}
.cmt-main {
    flex: 1;
    min-width: 0;
}
.cmt-top {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 3px;
    flex-wrap: wrap;
}
.cmt-nick {
    font-weight: 600;
    font-size: 13px;
    color: #333;
}
.cmt-country {
    font-size: 11px;
    color: #999;
}
.cmt-time {
    font-size: 11px;
    color: #bbb;
    margin-left: auto;
}
.cmt-text {
    font-size: 14px;
    line-height: 1.55;
    color: #222;
    margin-bottom: 6px;
    word-break: break-word;
}
.cmt-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}
.cmt-act {
    font-size: 12px;
    color: #888;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    user-select: none;
    transition: color 0.15s;
}
.cmt-act:hover {
    color: #555;
}
.cmt-act.cmt-like .bi-heart {
    font-size: 13px;
}
.cmt-act.cmt-like:hover {
    color: #ff4d4f;
}
.cmt-pending {
    opacity: 0.6;
}
/* Replies */
.cmt-replies {
    margin-top: 10px;
    padding-left: 12px;
    border-left: 2px solid #f0f0f0;
}
.cmt-reply {
    display: flex;
    gap: 10px;
    padding: 10px 0;
}
.cmt-reply + .cmt-reply {
    border-top: 1px solid #f8f8f8;
}
.cmt-more-replies {
    font-size: 12px;
    color: #888;
    cursor: pointer;
    padding: 6px 0 0 12px;
}
.cmt-more-replies:hover {
    color: #555;
}
.cmt-reply-form {
    margin-top: 10px;
    padding: 10px 12px;
    background: #f9f9f9;
    border-radius: 8px;
}

#page-article .article-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

/* Loading spinner for infinite scroll */
.load-more-sentinel {
    text-align: center;
    padding: 2rem;
}

/* Plans */
.plan-card.featured {
    border: 2px solid #0d6efd;
    transform: scale(1.05);
}

/* Category page */
.category-tree { font-size: 0.9rem; }
.cat-tree-label { border-radius: 4px; transition: background 0.15s; }
.cat-tree-label:hover { background: #f0f0f0; }
.cat-toggle { color: #6c757d; transition: transform 0.2s; }
.cat-tree-list { list-style: none; padding-left: 0; margin-bottom: 0; }
.mobile-cat-panel { max-height: 60vh; overflow-y: auto; }

/* Search bar on category page */
.search-bar .input-group {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border-radius: 8px;
    overflow: hidden;
}
.search-bar .form-control {
    border-right: none;
    padding: 0.6rem 1rem;
    font-size: 1rem;
}
.search-bar .form-control:focus {
    box-shadow: none;
    border-color: #dee2e6;
}
.search-bar .btn {
    padding-left: 1.2rem;
    padding-right: 1.2rem;
}

/* Maintenance page */
.maintenance-page {
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .cmt-replies { padding-left: 8px; }
    .plan-card.featured { transform: none; }
}

/* Floating suggestion button */
.suggest-float-btn {
    position: fixed;
    bottom: 30px;
    right: 24px;
    z-index: 1050;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    background: #ffc107;
    color: #212529;
    font-size: 1.3rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}
.suggest-float-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 22px rgba(0,0,0,0.28);
    color: #212529;
}

/* Floating ask question button */
.ask-float-btn {
    position: fixed;
    bottom: 95px;
    right: 24px;
    z-index: 1050;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    background: #0d6efd;
    color: #fff;
    font-size: 1.3rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}
/* Article content responsive images */
.article-content img {
    max-width: 100%;
    height: auto;
    display: block;
}
.article-content * {
    max-width: 100%;
}

.ask-float-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 22px rgba(0,0,0,0.28);
    color: #fff;
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
}
.toast-item {
    margin-bottom: 10px;
    background: rgba(0,0,0,0.72);
    color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 28px;
    animation: toastIn 0.25s ease;
    font-size: 14px;
    min-width: 120px;
    max-width: 300px;
    text-align: center;
}
.toast-item .toast-icon { font-size: 28px; margin-bottom: 6px; }
.toast-item.toast-success .toast-icon { color: #4caf50; }
.toast-item.toast-error   .toast-icon { color: #f44336; }
.toast-item.toast-warning .toast-icon { color: #ff9800; }
.toast-item.toast-info    .toast-icon { color: #fff; }
@keyframes toastIn {
    from { opacity: 0; transform: scale(0.85); }
    to   { opacity: 1; transform: scale(1); }
}

/* Cookie consent banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1060;
    background: #fff;
    border-top: 1px solid #e0e0e0;
    box-shadow: 0 -2px 16px rgba(0,0,0,0.10);
    animation: cookieSlideUp 0.4s ease;
}
.cookie-banner-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.cookie-text {
    font-size: 0.875rem;
    color: #555;
    line-height: 1.5;
    flex: 1;
}
.cookie-text i { color: #0d6efd; margin-right: 4px; }
.cookie-link {
    color: #0d6efd;
    white-space: nowrap;
    margin-left: 4px;
}
.cookie-actions {
    flex-shrink: 0;
    display: flex;
    gap: 8px;
}
@keyframes cookieSlideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

/* Mobile cookie banner */
@media (max-width: 576px) {
    .cookie-banner-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 12px 16px;
    }
    .cookie-text { font-size: 0.8125rem; }
    .cookie-actions { width: 100%; }
    .cookie-actions .btn { width: 100%; }
}

/* ========== Prevent auth flash ========== */
html.js-has-token #authButtons { display: none !important; }

/* ========== Auth Modal ========== */
.auth-modal-dialog { max-width: 440px; }

.auth-modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.18);
}

.auth-modal-body { padding: 32px 28px 24px; position: relative; }

.auth-modal-close {
    position: absolute;
    top: 12px; right: 14px;
    background: none; border: none;
    font-size: 1.25rem; color: #999;
    cursor: pointer; padding: 4px 8px; line-height: 1;
}
.auth-modal-close:hover { color: #333; }

.auth-title {
    font-size: 1.35rem; font-weight: 700;
    text-align: center; margin-bottom: 20px;
}

.auth-step {
    opacity: 0; transform: translateY(8px);
    max-height: 0; overflow: hidden;
    transition: opacity 0.25s ease, transform 0.25s ease, max-height 0.35s ease;
    pointer-events: none;
}
.auth-step.active {
    opacity: 1; transform: translateY(0);
    max-height: 600px; overflow: visible;
    pointer-events: auto;
}

/* Google button */
.google-btn {
    display: flex; align-items: center; justify-content: center;
    gap: 10px; width: 100%;
    padding: 10px 16px;
    font-size: 0.9rem; font-weight: 500; color: #3c4043;
    background: #fff; border: 1px solid #dadce0; border-radius: 24px;
    cursor: pointer; transition: background 0.15s;
}
.google-btn:hover { background: #f8f9fa; }
.google-btn img { width: 18px; height: 18px; }

/* "or" divider */
.auth-divider {
    display: flex; align-items: center; gap: 14px;
    margin: 18px 0; color: #999; font-size: 0.8rem;
}
.auth-divider::before,
.auth-divider::after {
    content: ''; flex: 1; height: 1px; background: #e0e0e0;
}

/* Inputs */
.auth-form-group {
    position: relative; margin-bottom: 16px;
}
.auth-input {
    width: 100%; border: none; border-bottom: 1px solid #ddd;
    border-radius: 0; padding: 14px 0 6px;
    font-size: 0.95rem; background: transparent; outline: none;
    transition: border-color 0.15s;
}
.auth-input:focus { border-bottom-color: #0d6efd; }
.auth-label {
    position: absolute; left: 0; top: 14px;
    font-size: 0.9rem; color: #999;
    transition: all 0.15s ease; pointer-events: none;
}
.auth-input:focus ~ .auth-label,
.auth-input:not(:placeholder-shown) ~ .auth-label {
    top: -6px; font-size: 0.7rem; color: #0d6efd;
}

/* Country select */
.auth-select {
    width: 100%; border: none; border-bottom: 1px solid #ddd;
    border-radius: 0; padding: 14px 0 6px;
    font-size: 0.95rem; background: transparent; outline: none;
    color: #333;
}

/* Email display in step 2 */
.auth-email-display {
    text-align: center; font-size: 0.9rem; color: #6c757d;
    margin-bottom: 16px; word-break: break-all;
}

/* Submit button */
.auth-submit-btn {
    width: 100%; border-radius: 24px; padding: 10px 24px;
    font-size: 0.95rem; font-weight: 600; margin-top: 8px;
}

/* Stay signed in + forgot row */
.auth-checkbox-row {
    display: flex; justify-content: space-between;
    align-items: center; margin-top: 12px; font-size: 0.85rem;
}
.auth-checkbox-row label { margin: 0; color: #555; cursor: pointer; }
.auth-checkbox-row input[type="checkbox"] { margin-right: 6px; }
.auth-forgot { color: #6c757d; cursor: pointer; text-decoration: none; }
.auth-forgot:hover { color: #0d6efd; }

/* Error */
.auth-error {
    color: #d32f2f; font-size: 0.8rem; text-align: center;
    margin-top: 10px;
}

/* Back link */
.auth-back {
    display: block; text-align: center; margin-top: 14px;
    color: #999; font-size: 0.85rem; cursor: pointer;
    background: none; border: none; width: 100%;
}
.auth-back:hover { color: #333; }

/* Terms */
.auth-terms {
    font-size: 0.7rem; color: #aaa; text-align: center; margin-top: 20px;
}
.auth-terms a { color: #6c757d; text-decoration: underline; }
.auth-terms a:hover { color: #333; }
