@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

:root {
    --bg-dark: #121826;
    --text-dark: #e2e8f0;
    --bg-card-dark: #1e293b;
    --primary-color: #0d6efd;
    --border-dark: rgba(255, 255, 255, 0.1);
}

body {
    font-family: "Poppins", sans-serif;
    background-attachment: fixed;
    color: #333;
    min-height: 100vh;
}

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

h1 {
    font-size: 1.75rem;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.25rem;
}

h4 {
    font-size: 1.1rem;
}

h5 {
    font-size: 1rem;
}

h6 {
    font-size: 0.9rem;
}


.card {
    border: none;
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    background: #ffffff;
    overflow: hidden;
}

[data-bs-theme="dark"] .card {
    background: var(--bg-card-dark, #1e293b);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1) !important;
}

.navbar-custom {
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(10px);
}

[data-bs-theme="dark"] .navbar-custom {
    background: rgba(18, 24, 38, 0.95) !important;
    border-bottom: 1px solid var(--border-dark);
}

.btn {
    font-weight: 600;
    letter-spacing: 0.3px;
    border-radius: 8px;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #0d6efd 0%, #0043a8 100%);
    border: none;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0b5ed7 0%, #003380 100%);
    box-shadow: 0 6px 16px rgba(13, 110, 253, 0.4);
    transform: translateY(-1px);
}

[data-bs-theme="dark"] .navbar-custom {
    background-color: rgba(18, 24, 38, 0.95) !important;
}

/* Custom Utilities */
.hover-primary:hover {
    color: var(--primary-color) !important;
}

.transition {
    transition: color 0.2s ease, background-color 0.2s ease;
}

.list-group-item {
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

[data-bs-theme="dark"] .list-group-item {
    border-bottom: 1px solid var(--border-dark);
    color: var(--text-dark);
}

.list-group-item:last-child {
    border-bottom: none;
}

[data-bs-theme="dark"] .bg-white,
[data-bs-theme="dark"] .bg-light {
    background-color: var(--bg-card-dark) !important;
}

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

.hover-bg-light:hover {
    background-color: rgba(0, 0, 0, 0.03) !important;
}

[data-bs-theme="dark"] .hover-bg-light:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.ai-tag {
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 4px;
    background-color: #6f42c1;
    color: white;
}

/* Custom Premium Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: var(--bs-body-bg);
}
::-webkit-scrollbar-thumb {
    background: #0d6efd;
    border-radius: 10px;
    border: 3px solid var(--bs-body-bg);
}
::-webkit-scrollbar-thumb:hover {
    background: #0043a8;
}

/* Search Highlight */
.search-highlight {
    background-color: #fff3cd;
    padding: 0 2px;
    border-radius: 2px;
    color: #000;
    font-weight: 500;
}
[data-bs-theme="dark"] .search-highlight {
    background-color: #ffd333;
    color: #000;
}

/* --- PHASE 3 ELITE ENHANCEMENTS --- */

/* Skeleton Loading Shimmer */
.skeleton {
    background: #eee;
    background: linear-gradient(110deg, #ececec 8%, #f5f5f5 18%, #ececec 33%);
    border-radius: 8px;
    background-size: 200% 100%;
    animation: 1.5s shine linear infinite;
}
[data-bs-theme="dark"] .skeleton {
    background: #2a2a2a;
    background: linear-gradient(110deg, #222 8%, #333 18%, #222 33%);
    background-size: 200% 100%;
}
@keyframes shine {
    to { background-position-x: -200%; }
}

/* User Hover Card */
#user-hover-card {
    position: absolute;
    z-index: 3000;
    width: 280px;
    display: none;
    pointer-events: auto;
    transition: opacity 0.2s ease;
}

/* Lightbox */
#lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 4000;
    cursor: zoom-out;
}
#lightbox-overlay img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}
#lightbox-overlay.show img {
    transform: scale(1);
}

/* Role Accents */
.post-admin-accent {
    border-left: 4px solid #dc3545 !important;
    background: linear-gradient(90deg, rgba(220, 53, 69, 0.03) 0%, transparent 100%);
}
.post-ai-accent {
    border-left: 4px solid #6f42c1 !important;
    background: linear-gradient(90deg, rgba(111, 66, 193, 0.03) 0%, transparent 100%);
}

/* AI Typing Animation */
.ai-typing::after {
    content: '|';
    animation: blink 1s infinite;
}
@keyframes blink {
    50% { opacity: 0; }
}

/* Anti-Gravity Canvas */
#ag-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    /* Let clicks pass through to underlying elements */
    z-index: 9999;
}

.ag-hidden {
    visibility: hidden !important;
}

/* --- NEW PREMIUM ENHANCEMENTS --- */

/* Reading Progress Bar */
#reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(to right, #0d6efd, #00d2ff);
    z-index: 2000;
    transition: width 0.1s ease-out;
}

/* Scroll to Top Button */
#scrollTopBtn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    background: #0d6efd;
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1060;
}

#scrollTopBtn.show {
    opacity: 1;
    visibility: visible;
}

#scrollTopBtn:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Prism Copy Button */
.prism-copy-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    padding: 2px 8px;
    font-size: 11px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s;
}
pre:hover .prism-copy-btn {
    opacity: 1;
}
.prism-copy-btn:hover {
    background: rgba(255,255,255,0.2);
}