/* --- Top Authors Section --- */
.top-authors-section {
    padding: 80px 20px;
    background-color: #f0f2f5; /* Giữ nền nhẹ nhàng */
    text-align: center;
}

.top-authors-section h2 {
    font-size: 38px;
    color: #333;
    margin-bottom: 50px;
    font-weight: 700;
}

.authors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Tự động điều chỉnh cột, tối thiểu 280px */
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto 50px auto;
}

.author-card {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #eee;
}

.author-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

.author-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 25px;
}

.author-card .author-avatar {
    width: 90px; /* Avatar lớn hơn */
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid #673ab7; /* Viền tím nổi bật */
    box-shadow: 0 0 0 4px rgba(103, 58, 183, 0.3); /* Vòng ngoài sáng */
    margin-bottom: 15px;
}

.author-info {
    display: flex;
    flex-direction: column;
    align-items: center; /* Căn giữa tên và tiêu đề */
}

.author-name {
    font-size: 24px;
    color: #333;
    margin: 0;
    font-weight: 700;
}

.author-title {
    font-size: 15px;
    color: #666;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
    background-color: #e0e0e0;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 500;
}

.author-title i {
    color: #3f51b5; /* Icon màu xanh tím */
}

.author-stats {
    display: flex;
    justify-content: space-around;
    width: 100%;
    margin-bottom: 25px;
    border-top: 1px solid #eee; /* Đường phân cách */
    padding-top: 25px;
    gap: 15px; /* Khoảng cách giữa các mục thống kê */
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    color: #3f51b5;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    color: #777;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary-author {
    background-color: #3f51b5;
    color: white;
    padding: 12px 25px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.3s ease, transform 0.2s ease;
    width: 80%; /* Giới hạn chiều rộng nút */
    max-width: 200px;
}

.btn-primary-author:hover {
    background-color: #303f9f;
    transform: translateY(-1px);
}

/* --- Dark Mode adjustments --- */
body.dark-mode .top-authors-section {
    background-color: #1a1a1a;
}

body.dark-mode .top-authors-section h2 {
    color: #e0e0e0;
}

body.dark-mode .author-card {
    background-color: #2b2b2b;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    border-color: #3a3a3a;
}

body.dark-mode .author-card:hover {
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.3);
}

body.dark-mode .author-card .author-avatar {
    border-color: #8c72cf;
    box-shadow: 0 0 0 4px rgba(140, 114, 207, 0.3);
}

body.dark-mode .author-name {
    color: #eee;
}

body.dark-mode .author-title {
    background-color: #444;
    color: #ccc;
}

body.dark-mode .author-title i {
    color: #9fa8da;
}

body.dark-mode .author-stats {
    border-top-color: #3a3a3a;
}

body.dark-mode .stat-value {
    color: #9fa8da;
}

body.dark-mode .stat-label {
    color: #aaa;
}

body.dark-mode .btn-primary-author {
    background-color: #5c6bc0;
}

body.dark-mode .btn-primary-author:hover {
    background-color: #4a5aa3;
}

/* --- Responsive Adjustments --- */
@media (max-width: 992px) {
    .authors-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 25px;
    }
}

@media (max-width: 768px) {
    .top-authors-section h2 {
        font-size: 32px;
    }
    .authors-grid {
        grid-template-columns: 1fr; /* Một cột trên màn hình nhỏ */
        gap: 20px;
    }
    .author-card {
        padding: 25px;
    }
    .author-header {
        flex-direction: row;
        gap: 20px;
        align-items: center;
    }
    .author-card .author-avatar {
        margin-bottom: 0;
    }
    .author-info {
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .top-authors-section {
        padding: 60px 15px;
    }
    .author-card .author-avatar {
        width: 70px;
        height: 70px;
    }
    .author-name {
        font-size: 20px;
    }
    .stat-value {
        font-size: 20px;
    }
    .btn-primary-author {
        padding: 10px 20px;
    }
}