/* NICS AI TUTOR - Global Styles */
:root {
    --primary: #10b981;
    --secondary: #eab308;
    --bg-gradient: linear-gradient(135deg, #eaf4e5 0%, #fdfce5 100%);
    --glass-bg: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(255, 255, 255, 0.4);
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-gradient);
    color: #2d3748;
    min-height: 100-vh;
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px rgba(100, 150, 100, 0.1);
}

.gradient-text {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Chat Bubbles */
.chat-bubble-user {
    background: var(--primary);
    color: white;
    border-radius: 20px 20px 0 20px;
    box-shadow: 0 4px 6px rgba(16, 185, 129, 0.2);
}

.chat-bubble-ai {
    background: white;
    color: #4b5563;
    border: 1px solid #e5e7eb;
    border-radius: 20px 20px 20px 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* Scrollbar Hide */
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Transitions */
.transition-all {
    transition: all 0.3s ease;
}

/* Cards */
.doc-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.doc-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

/* ========== Forum / Webboard Styles ========== */

/* Stats Bar */
.forum-stats-bar {
    display: flex;
    gap: 1.5rem;
    padding: 0.75rem 1.25rem;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 1rem;
    box-shadow: 0 2px 12px rgba(100, 150, 100, 0.08);
}

.forum-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #6b7280;
}

.forum-stat strong {
    font-size: 1.1rem;
    font-weight: 700;
}

/* Filter Pills */
.forum-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem 0;
}

.forum-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.9rem;
    border-radius: 9999px;
    border: 1px solid #d1d5db;
    background: white;
    font-size: 0.75rem;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

.forum-pill:hover {
    border-color: #10b981;
    color: #059669;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
    transform: translateY(-1px);
}

.forum-pill.active {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.3);
}

/* Thread Table */
.forum-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.forum-table-header {
    display: grid;
    grid-template-columns: 3fr 1fr 1fr;
    padding: 0.6rem 1.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
    border-bottom: 2px solid #e5e7eb;
    background: rgba(249, 250, 251, 0.7);
    border-radius: 0.75rem 0.75rem 0 0;
}

/* Thread Row */
.forum-thread {
    display: grid;
    grid-template-columns: 3fr 1fr 1fr;
    align-items: center;
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: all 0.2s ease;
    animation: threadSlideIn 0.3s ease backwards;
}

.forum-thread:hover {
    background: rgba(16, 185, 129, 0.04);
    transform: translateX(3px);
}

.forum-thread:last-child {
    border-bottom: none;
}

/* Thread Main Cell */
.forum-thread-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

/* Avatar */
.forum-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.7rem;
    flex-shrink: 0;
    color: white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.forum-avatar-student {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

/* Thread Info */
.forum-thread-info {
    min-width: 0;
    flex: 1;
}

.forum-thread-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.2rem;
    transition: color 0.2s;
}

.forum-thread:hover .forum-thread-title {
    color: #059669;
}

.forum-thread-preview {
    font-size: 0.72rem;
    color: #9ca3af;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Badge */
.forum-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.65rem;
    border-radius: 0.5rem;
    font-size: 0.68rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.forum-badge-doc {
    background: #ede9fe;
    color: #7c3aed;
    border: 1px solid #ddd6fe;
}

.forum-badge-time {
    font-size: 0.72rem;
    color: #9ca3af;
}

/* Expanded Thread Detail */
.forum-expand {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease, opacity 0.25s ease;
    opacity: 0;
    background: rgba(249, 250, 251, 0.5);
    border-bottom: 1px solid #f3f4f6;
}

.forum-expand.open {
    max-height: 800px;
    opacity: 1;
    padding: 1rem 1.25rem 1.25rem;
}

.forum-expand-inner {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.forum-msg-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.2rem;
}

.forum-msg-bubble {
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.82rem;
    line-height: 1.6;
}

.forum-msg-question {
    background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
    border: 1px solid #bbf7d0;
    color: #166534;
}

.forum-msg-answer {
    background: white;
    border: 1px solid #e5e7eb;
    color: #374151;
}

/* Empty State */
.forum-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: #9ca3af;
}

.forum-empty-icon {
    font-size: 3.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.4;
}

.forum-empty-text {
    font-size: 0.95rem;
    font-weight: 500;
}

/* Animations */
@keyframes threadSlideIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.forum-thread:nth-child(1) {
    animation-delay: 0.02s;
}

.forum-thread:nth-child(2) {
    animation-delay: 0.04s;
}

.forum-thread:nth-child(3) {
    animation-delay: 0.06s;
}

.forum-thread:nth-child(4) {
    animation-delay: 0.08s;
}

.forum-thread:nth-child(5) {
    animation-delay: 0.10s;
}

.forum-thread:nth-child(6) {
    animation-delay: 0.12s;
}

.forum-thread:nth-child(7) {
    animation-delay: 0.14s;
}

.forum-thread:nth-child(8) {
    animation-delay: 0.16s;
}

.forum-thread:nth-child(9) {
    animation-delay: 0.18s;
}

.forum-thread:nth-child(10) {
    animation-delay: 0.20s;
}

/* Responsive */
@media (max-width: 768px) {
    .forum-stats-bar {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .forum-table-header {
        display: none;
    }

    .forum-thread {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
    }

    .forum-badge {
        max-width: none;
    }
}