/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* Base Styles */
.modern-stats-container,
.modern-stats-tables {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.modern-stats-wrapper {
    margin: 20px 0;
    padding: 15px;
    background: linear-gradient(135deg, rgba(16, 82, 137, 0.95) 0%, rgba(26, 124, 182, 0.95) 100%);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.modern-stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    max-width: 100%;
    margin: 30px 0;
    padding: 0 15px;
}

.modern-stats-item {
    position: relative;
    padding: 25px;
    border-radius: 16px;
    background: linear-gradient(145deg, #ffffff, #f5f7fa);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    transform-origin: center;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.modern-stats-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(145deg, var(--item-color, #4CAF50), var(--item-color-dark, #388E3C));
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 0;
}

.modern-stats-item[data-color="#4CAF50"] { 
    --item-color: #4CAF50; 
    --item-color-dark: #388E3C;
}
.modern-stats-item[data-color="#2196F3"] { 
    --item-color: #2196F3; 
    --item-color-dark: #1976D2;
}
.modern-stats-item[data-color="#9C27B0"] { 
    --item-color: #9C27B0; 
    --item-color-dark: #7B1FA2;
}
.modern-stats-item[data-color="#FF9800"] { 
    --item-color: #FF9800; 
    --item-color-dark: #F57C00;
}
.modern-stats-item[data-color="#E91E63"] { 
    --item-color: #E91E63; 
    --item-color-dark: #C2185B;
}
.modern-stats-item[data-color="#00BCD4"] { 
    --item-color: #00BCD4; 
    --item-color-dark: #0097A7;
}
.modern-stats-item[data-color="#FF5722"] { 
    --item-color: #FF5722; 
    --item-color-dark: #E64A19;
}
.modern-stats-item[data-color="#8BC34A"] { 
    --item-color: #8BC34A; 
    --item-color-dark: #689F38;
}

.modern-stats-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.12);
}

.modern-stats-item:hover::before {
    opacity: 1;
}

.modern-stats-item i {
    position: relative;
    font-size: 32px;
    margin-bottom: 20px;
    color: var(--item-color);
    display: block;
    z-index: 1;
    transition: all 0.4s ease;
    padding-bottom: 20px;
}

.modern-stats-item i::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--item-color);
    transition: all 0.4s ease;
}

.modern-stats-item:hover i {
    color: #ffffff;
    transform: scale(1.1) translateY(-2px);
}

.modern-stats-item:hover i::after {
    width: 60px;
    background: #ffffff;
}

.stats-info {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 1;
    transition: all 0.4s ease;
}

.stats-number {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    letter-spacing: 0.5px;
    transition: color 0.4s ease;
}

.modern-stats-item:hover .stats-number {
    color: #ffffff;
}

.stats-label {
    font-size: 15px;
    color: #5f6c7b;
    font-weight: 500;
    margin-top: 5px;
    transition: color 0.4s ease;
    letter-spacing: 0.3px;
}

.modern-stats-item:hover .stats-label {
    color: rgba(255, 255, 255, 0.95);
}

.stats-sublabel {
    font-size: 13px;
    color: #8395a7;
    margin-top: 2px;
    transition: color 0.4s ease;
    letter-spacing: 0.2px;
}

.modern-stats-item:hover .stats-sublabel {
    color: rgba(255, 255, 255, 0.85);
}

/* Tables Styling */
.modern-stats-tables {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 25px;
    margin: 30px 15px;
}

.modern-stats-table-wrapper {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.table-title {
    font-size: 1.5em;
    color: #2c3e50;
    margin-bottom: 20px;
    padding: 15px 20px;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 10px;
}

.table-title i {
    color: #3498db;
    font-size: 1.2em;
}

.modern-stats-table {
    padding: 15px;
}

.modern-stats-table .table-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 15px;
    padding: 15px;
    margin: 10px 0;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
    text-decoration: none;
}

.modern-stats-table .table-row:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.modern-stats-table .user-avatar {
    width: 45px !important;
    height: 45px !important;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.modern-stats-table .post-content {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.modern-stats-table .post-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    margin-bottom: 5px;
}

.modern-stats-table .post-title a {
    color: #2c3e50;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}

.modern-stats-table .post-title a:hover {
    color: #3498db;
}

.modern-stats-table .post-title span {
    color: #2c3e50;
    font-weight: 600;
    transition: color 0.2s ease;
}

.modern-stats-table .table-row:hover .post-title span {
    color: #3498db;
}

.topic-locked {
    color: #e74c3c;
    font-size: 0.9em;
}

.modern-stats-table .post-meta {
    display: flex;
    gap: 15px;
    font-size: 10px;
    color: #666;
}

.modern-stats-table .post-meta i {
    color: #3498db;
    margin-right: 4px;
}

.modern-stats-table .post-author {
    font-size: 0.95em;
    color: #2c3e50;
    font-weight: 500;
    padding: 5px 15px;
    background: #f8f9fa;
    border-radius: 20px;
    white-space: nowrap;
}

/* Remove ripple effect */
.table-row::after {
    display: none;
}

@keyframes ripple {
    display: none;
}

/* Avatar styling */
.user-avatar {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50%;
    margin-right: 12px;
    border: 2px solid #e1e8ed;
    transition: all 0.3s ease;
    flex-shrink: 0;
    object-fit: cover;
}

.table-row:hover .user-avatar {
    border-color: #3498db;
    transform: scale(1.05);
    box-shadow: 0 3px 10px rgba(52, 152, 219, 0.2);
}

.modernstats-post-title, .modernstats-username {
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.2px;
}

.post-info, .user-info {
    flex: 1;
    display: flex;
    align-items: center;
}

.post-meta, .user-meta {
    display: flex;
    gap: 20px;
    color: #8395a7;
    font-size: 13px;
    letter-spacing: 0.2px;
}

.post-meta span, .user-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.post-meta i, .user-meta i {
    font-size: 14px;
    color: #3498db;
}

.post-author {
    color: #34495e;
    font-size: 14px;
    font-weight: 500;
    padding-left: 20px;
    border-left: 2px solid #e1e8ed;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.2px;
}

.post-author i {
    font-size: 15px;
    color: #3498db;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .modern-stats-container {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 768px) {
    .modern-stats-container {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 15px;
        padding: 0 10px;
    }

    .modern-stats-tables {
        grid-template-columns: 1fr;
        gap: 20px;
        margin: 20px 10px;
    }

    .modern-stats-item {
        padding: 20px;
    }

    .modern-stats-item i {
        font-size: 28px;
    }

    .stats-number {
        font-size: 24px;
    }

    .stats-label {
        font-size: 14px;
    }

    .modern-stats-table .table-row {
        grid-template-columns: auto 1fr;
    }
    
    .modern-stats-table .post-author {
        grid-column: 2;
        justify-self: start;
    }
    
    .modern-stats-table .post-meta {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .modern-stats-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .modern-stats-item {
        margin-bottom: 0;
    }

    .modern-stats-tables {
        margin: 15px 10px;
    }

    .table-title {
        padding: 15px 20px;
    }

    .post-meta, .user-meta {
        flex-direction: column;
        gap: 8px;
    }
}
