/**
 * Discussion Forum Management page styles for Rajasthan Virtual Shiksha PWA
 */

/* Forum Stats */
.forum-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 80px;
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Forum Tabs */
.forum-tabs {
    margin-bottom: 20px;
}

.tab-buttons {
    display: flex;
    gap: 5px;
    background-color: var(--bg-light);
    padding: 5px;
    border-radius: 8px;
    overflow-x: auto;
}

.tab-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.tab-button:hover {
    background-color: rgba(var(--primary-color-rgb), 0.1);
    color: var(--primary-color);
}

.tab-button.active {
    background-color: var(--primary-color);
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Moderation Tab */
.moderation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.moderation-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.moderation-actions {
    display: flex;
    gap: 10px;
}

.moderation-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.moderation-item {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-left: 4px solid var(--border-color);
}

.moderation-item.urgent {
    border-left-color: #F44336;
    background-color: #FFEBEE;
}

.moderation-item.flagged {
    border-left-color: #FF9800;
    background-color: #FFF8E1;
}

.moderation-item.normal {
    border-left-color: #4CAF50;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.urgency-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.urgency-badge.urgent {
    background-color: #F44336;
    color: white;
}

.urgency-badge.flagged {
    background-color: #FF9800;
    color: white;
}

.urgency-badge.normal {
    background-color: #4CAF50;
    color: white;
}

.post-type {
    background-color: var(--bg-light);
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

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

.item-content {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.student-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 150px;
}

.student-avatar {
    font-size: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-light);
    border-radius: 50%;
}

.student-details {
    display: flex;
    flex-direction: column;
}

.student-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-color);
}

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

.post-content {
    flex: 1;
}

.post-content h4 {
    margin: 0 0 8px;
    font-size: 1rem;
    color: var(--text-color);
}

.post-content p {
    margin: 0 0 10px;
    color: var(--text-muted);
    line-height: 1.5;
}

.flagged-content {
    background-color: #FFF3E0;
    padding: 10px;
    border-radius: 4px;
    border-left: 3px solid #FF9800;
    font-style: italic;
}

.post-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tag {
    background-color: rgba(var(--primary-color-rgb), 0.1);
    color: var(--primary-color);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 500;
}

.flag-details {
    display: flex;
    gap: 15px;
    font-size: 0.8rem;
    color: #E65100;
    margin-top: 8px;
}

.flag-count {
    font-weight: 500;
}

.engagement-stats {
    display: flex;
    gap: 15px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.stat {
    display: flex;
    align-items: center;
    gap: 3px;
}

.item-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Topics Tab */
.topics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.topic-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.search-container {
    position: relative;
}

#search-topics {
    padding: 8px 35px 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.9rem;
    min-width: 200px;
}

.search-button {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
}

.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.topic-card {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.topic-card.pinned {
    border: 2px solid var(--primary-color);
    background-color: rgba(var(--primary-color-rgb), 0.02);
}

.topic-card.needs-attention {
    border-left: 4px solid #F44336;
}

.topic-card.popular {
    border-left: 4px solid #FF9800;
}

.topic-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.topic-badges {
    display: flex;
    gap: 8px;
}

.badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
}

.topic-stats {
    display: flex;
    gap: 10px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.topic-content h4 {
    margin: 0 0 8px;
    font-size: 1.1rem;
}

.topic-content p {
    margin: 0 0 15px;
    color: var(--text-muted);
    line-height: 1.5;
}

.topic-author {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.author-avatar {
    font-size: 18px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.author-name {
    font-size: 0.85rem;
    font-weight: 500;
}

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

.topic-actions {
    display: flex;
    gap: 10px;
}

/* Analytics Tab */
.analytics-overview h3 {
    margin: 0 0 20px;
    font-size: 1.2rem;
}

.analytics-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.analytics-card {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 15px;
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-content {
    flex: 1;
}

.card-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    display: block;
    margin-bottom: 5px;
}

.card-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 5px;
}

.card-trend {
    font-size: 0.75rem;
    font-weight: 500;
}

.card-trend.positive {
    color: #4CAF50;
}

.card-trend.negative {
    color: #F44336;
}

/* Student Participation */
.student-participation h4 {
    margin: 0 0 15px;
    font-size: 1.1rem;
}

.participation-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.participation-item {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.participation-stats {
    display: flex;
    gap: 20px;
}

.participation-stats .stat-item {
    min-width: 60px;
}

.participation-badge {
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.participation-badge.top-contributor {
    background-color: #FFD700;
    color: #B8860B;
}

.participation-badge.active {
    background-color: #4CAF50;
    color: white;
}

.participation-badge.new {
    background-color: #2196F3;
    color: white;
}

/* All Topics Tab */
.all-topics-container {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.topics-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.topics-filters select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: white;
    font-size: 0.9rem;
}

.topic-summary-card {
    background-color: var(--bg-light);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.topic-info h4 {
    margin: 0 0 5px;
    font-size: 1rem;
}

.topic-info p {
    margin: 0 0 10px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.topic-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.author-info {
    display: flex;
    align-items: center;
    gap: 5px;
}

.author-avatar {
    font-size: 16px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.topic-engagement {
    display: flex;
    gap: 20px;
}

.engagement-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.engagement-number {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
}

.engagement-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.topic-status {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
}

.topic-status.solved {
    background-color: #E8F5E8;
    color: #2E7D32;
}

/* Analytics Tab */
.detailed-analytics {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.analytics-dashboard {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

.chart-container h4 {
    margin: 0 0 15px;
    font-size: 1.1rem;
}

.chart-placeholder {
    background-color: var(--bg-light);
    border-radius: 6px;
    padding: 20px;
    height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.chart-bars {
    display: flex;
    align-items: end;
    justify-content: space-between;
    height: 120px;
    gap: 8px;
}

.bar {
    background-color: var(--primary-color);
    border-radius: 2px 2px 0 0;
    flex: 1;
    min-height: 10px;
    transition: all 0.2s;
    cursor: pointer;
}

.bar:hover {
    background-color: var(--secondary-color);
}

.chart-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 10px;
}

.subject-breakdown h4 {
    margin: 0 0 15px;
    font-size: 1.1rem;
}

.subject-stats {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.subject-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.subject-name {
    font-size: 0.85rem;
    color: var(--text-color);
    min-width: 120px;
}

.subject-bar {
    flex: 1;
    height: 8px;
    background-color: var(--bg-light);
    border-radius: 4px;
    overflow: hidden;
}

.subject-fill {
    height: 100%;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.subject-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    min-width: 60px;
    text-align: right;
}

/* Settings Tab */
.forum-settings {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.forum-settings h3 {
    margin: 0 0 20px;
    font-size: 1.2rem;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.settings-section h4 {
    margin: 0 0 15px;
    font-size: 1rem;
    color: var(--text-color);
}

.setting-item {
    margin-bottom: 12px;
}

.settings-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .forum-stats {
        justify-content: space-around;
    }
    
    .moderation-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .item-content {
        flex-direction: column;
        gap: 10px;
    }
    
    .student-info {
        min-width: auto;
    }
    
    .item-actions {
        justify-content: flex-start;
    }
    
    .participation-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .participation-stats {
        align-self: stretch;
        justify-content: space-around;
    }
    
    .topic-summary-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .topic-engagement {
        align-self: stretch;
        justify-content: space-around;
    }
    
    .analytics-dashboard {
        grid-template-columns: 1fr;
    }
    
    .topics-filters {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 480px) {
    .tab-buttons {
        flex-direction: column;
    }
    
    .tab-button {
        justify-content: center;
    }
    
    .moderation-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .participation-stats {
        flex-direction: column;
        gap: 10px;
    }
    
    .chart-bars {
        gap: 4px;
    }
}
