/* Community Settings Styles */

/* Container Styles */
.community-members-container,
.community-rules-container,
.community-analytics-container,
.community-filters-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
.members-header,
.rules-header,
.analytics-header,
.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.header-content h1 {
    margin: 0;
    color: #2c3e50;
    font-size: 2rem;
    font-weight: 700;
}

.header-content p {
    margin: 5px 0 0 0;
    color: #6c757d;
}

.header-actions {
    display: flex;
    gap: 10px;
}

/* Statistics Grid */
.stats-grid,
.metrics-grid,
.filter-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card,
.metric-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover,
.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.stat-icon,
.metric-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    background: linear-gradient(135deg, #007bff, #0056b3);
}

.stat-content,
.metric-content {
    flex: 1;
}

.stat-number,
.metric-number {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
}

.stat-label,
.metric-label {
    color: #6c757d;
    font-size: 0.9rem;
    margin: 5px 0;
}

.metric-change {
    font-size: 0.8rem;
    color: #28a745;
    display: flex;
    align-items: center;
    gap: 5px;
}

.metric-change.positive {
    color: #28a745;
}

.metric-change.negative {
    color: #dc3545;
}

/* Filters Section */
.filters-section {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
}

.search-box {
    position: relative;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

.search-box input {
    padding-left: 40px;
}

/* Members List */
.members-list {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
}

.member-card {
    display: flex;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #f8f9fa;
    transition: background-color 0.2s ease;
}

.member-card:hover {
    background-color: #f8f9fa;
}

.member-card:last-child {
    border-bottom: none;
}

.member-avatar {
    position: relative;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 15px;
    flex-shrink: 0;
}

.member-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-initials {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

.online-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: #28a745;
    border: 2px solid #fff;
    border-radius: 50%;
}

.member-info {
    flex: 1;
}

.member-name {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}

.member-name strong {
    font-size: 1.1rem;
    color: #2c3e50;
}

.member-details {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 8px;
}

.role-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 4px;
}

.role-badge.admin {
    background: #ffc107;
    color: #000;
}

.role-badge.moderator {
    background: #17a2b8;
    color: #fff;
}

.role-badge.member {
    background: #6c757d;
    color: #fff;
}

.join-date {
    color: #6c757d;
    font-size: 0.9rem;
}

.member-stats {
    display: flex;
    gap: 15px;
    color: #6c757d;
    font-size: 0.85rem;
}

.member-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.member-actions {
    display: flex;
    gap: 10px;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

/* Rules Styles */
.rules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.rule-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rule-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.rule-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.rule-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #007bff;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.rule-icon {
    font-size: 1.2rem;
    color: #007bff;
}

.rule-title {
    flex: 1;
    font-weight: 600;
    color: #2c3e50;
}

.rule-severity {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.rule-severity.critical {
    background: #dc3545;
    color: #fff;
}

.rule-severity.important {
    background: #ffc107;
    color: #000;
}

.rule-severity.general {
    background: #6c757d;
    color: #fff;
}

.rule-content {
    margin-bottom: 15px;
}

.rule-content p {
    color: #495057;
    line-height: 1.5;
    margin: 0;
}

.rule-meta {
    margin-bottom: 15px;
}

.rule-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.reorder-buttons {
    display: flex;
    gap: 4px;
}

/* Templates */
.templates-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #e9ecef;
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.template-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    transition: background-color 0.2s ease;
}

.template-card:hover {
    background: #e9ecef;
}

.template-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.template-icon {
    color: #007bff;
    font-size: 1.1rem;
}

.template-title {
    font-weight: 600;
    color: #2c3e50;
}

.template-category {
    background: #007bff;
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7rem;
    text-transform: uppercase;
}

.template-content p {
    color: #6c757d;
    font-size: 0.9rem;
    margin: 0 0 10px 0;
}

/* Analytics Charts */
.charts-section {
    margin: 30px 0;
}

.chart-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.chart-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.2rem;
}

.chart-controls {
    display: flex;
    gap: 8px;
}

.chart-container {
    height: 300px;
    position: relative;
}

/* Date Range Selector */
.date-range-selector {
    margin-bottom: 30px;
    text-align: center;
}

.date-range-selector .btn-group {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

/* Contributors */
.contributors-section {
    margin: 30px 0;
}

.contributors-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card-header {
    background: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
}

.card-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.1rem;
}

.contributors-list {
    padding: 0;
}

.contributor-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #f8f9fa;
    transition: background-color 0.2s ease;
}

.contributor-item:hover {
    background-color: #f8f9fa;
}

.contributor-item:last-child {
    border-bottom: none;
}

.contributor-rank {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #007bff;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    margin-right: 15px;
}

.contributor-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 15px;
    flex-shrink: 0;
}

.contributor-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.contributor-info {
    flex: 1;
}

.contributor-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.contributor-stats {
    display: flex;
    gap: 15px;
    color: #6c757d;
    font-size: 0.85rem;
}

.contributor-karma {
    font-weight: 700;
    color: #28a745;
    font-size: 1.1rem;
}

/* Filter Styles */
.filter-section {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.section-header {
    margin-bottom: 20px;
}

.section-header h3 {
    margin: 0 0 5px 0;
    color: #2c3e50;
    font-size: 1.3rem;
}

.banned-words-controls {
    margin-bottom: 20px;
}

.banned-words-list {
    max-height: 400px;
    overflow-y: auto;
}

.banned-word-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 10px;
    background: #f8f9fa;
}

.word-info {
    flex: 1;
}

.word-text {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.word-settings {
    display: flex;
    gap: 8px;
    margin-bottom: 5px;
}

.word-meta {
    font-size: 0.8rem;
    color: #6c757d;
}

.word-actions {
    display: flex;
    gap: 8px;
}

/* Settings Groups */
.setting-group {
    margin-bottom: 20px;
}

.setting-group label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

.range-value {
    text-align: center;
    font-weight: 600;
    color: #007bff;
    margin-top: 5px;
}

.approval-stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-label {
    font-weight: 600;
    color: #2c3e50;
}

.stat-value {
    font-weight: 700;
    color: #007bff;
}

/* Filter Logs */
.filter-logs {
    max-height: 400px;
    overflow-y: auto;
}

.log-item {
    display: flex;
    align-items: flex-start;
    padding: 15px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 10px;
    background: #f8f9fa;
}

.log-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    flex-shrink: 0;
}

.log-icon i {
    color: #fff;
}

.log-content {
    flex: 1;
}

.log-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}

.log-type {
    background: #007bff;
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7rem;
    text-transform: uppercase;
}

.log-action {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 600;
}

.log-action.removed {
    background: #dc3545;
    color: #fff;
}

.log-action.flagged {
    background: #ffc107;
    color: #000;
}

.log-action.approved {
    background: #28a745;
    color: #fff;
}

.log-time {
    color: #6c757d;
    font-size: 0.8rem;
}

.log-details {
    margin-bottom: 5px;
    color: #2c3e50;
}

.log-preview {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 8px;
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 5px;
}

.log-meta {
    font-size: 0.8rem;
    color: #6c757d;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state h3 {
    margin: 0 0 10px 0;
    color: #2c3e50;
}

.empty-state p {
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .members-header,
    .rules-header,
    .analytics-header,
    .filters-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .header-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .stats-grid,
    .metrics-grid,
    .filter-stats {
        grid-template-columns: 1fr;
    }
    
    .member-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .member-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .rules-grid {
        grid-template-columns: 1fr;
    }
    
    .templates-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-container {
        height: 250px;
    }
    
    .contributor-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .banned-word-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .word-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .stat-card,
    .metric-card,
    .member-card,
    .rule-card,
    .template-card,
    .chart-card,
    .contributors-card,
    .filter-section {
        background: #2c3e50;
        border-color: #34495e;
        color: #ecf0f1;
    }
    
    .header-content h1 {
        color: #ecf0f1;
    }
    
    .member-name strong,
    .rule-title,
    .template-title,
    .contributor-name {
        color: #ecf0f1;
    }
    
    .empty-state {
        color: #bdc3c7;
    }
    
    .empty-state h3 {
        color: #ecf0f1;
    }
}
