/* Categories Page Specific Styles */
.categories-hero {
    background: linear-gradient(135deg, #4361ee 0%, #3a56d4 100%);
    color: white;
    padding: 80px 0;
    text-align: center;
}

.categories-hero h1 {
    font-size: 2.8rem;
    margin-bottom: 15px;
    color: white;
}

.categories-hero p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 30px;
    opacity: 0.9;
}

.search-box {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 15px 25px;
    border-radius: 50px;
    border: none;
    font-size: 1rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.search-button {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 1.2rem;
    cursor: pointer;
}

/* Main Categories Section */
.main-categories {
    padding: 80px 0;
    background-color: white;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.view-options {
    display: flex;
    align-items: center;
    gap: 20px;
}

.sort-options {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
}

.sort-options select {
    padding: 8px 15px;
    border-radius: 5px;
    border: 1px solid var(--light-gray);
    background-color: white;
    cursor: pointer;
}

.view-toggle {
    display: flex;
    background-color: #f5f7fa;
    border-radius: 5px;
    overflow: hidden;
}

.view-toggle button {
    background: none;
    border: none;
    padding: 8px 15px;
    cursor: pointer;
    color: var(--gray-color);
    transition: var(--transition);
}

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

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.category-card {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    position: relative;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-hover);
}

.category-card.grid-view {
    display: block;
}

.category-card.list-view {
    display: flex;
    grid-column: span 2;
}

.category-card.list-view .category-image {
    width: 200px;
    height: auto;
    flex-shrink: 0;
}

.category-card.list-view .category-content {
    padding: 25px;
}

.category-image {
    height: 180px;
    overflow: hidden;
}

.category-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.category-card:hover .category-image img {
    transform: scale(1.05);
}

.category-content {
    padding: 20px;
}

.category-title {
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.category-description {
    color: var(--gray-color);
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.category-stats {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.category-stats span {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--gray-color);
}

.category-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.follow-btn {
    padding: 6px 15px;
    font-size: 0.9rem;
    border-radius: 5px;
    background-color: #f5f7fa;
    color: var(--primary-color);
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.follow-btn:hover {
    background-color: var(--primary-color);
    color: white;
}

.follow-btn.following {
    background-color: var(--primary-color);
    color: white;
}

.category-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: var(--danger-color);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: 500;
}

.load-more {
    text-align: center;
    margin-top: 40px;
}

/* Trending in Categories */
.trending-in-categories {
    padding: 80px 0;
    background-color: #f9fafc;
}

.trending-tabs {
    background-color: white;
    border-radius: 10px;
    box-shadow: var(--box-shadow);
    overflow: hidden;
    margin-top: 30px;
}

.tab-header {
    border-bottom: 1px solid var(--light-gray);
}

.tab-buttons {
    display: flex;
    flex-wrap: wrap;
}

.tab-button {
    padding: 15px 25px;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 500;
    color: var(--gray-color);
    position: relative;
    transition: var(--transition);
}

.tab-button::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

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

.tab-button.active::after {
    transform: scaleX(1);
}

.tab-content {
    padding: 20px;
}

.tab-pane {
    display: none;
}

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

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

.trending-article {
    display: flex;
    gap: 15px;
    align-items: center;
}

.trending-article img {
    width: 80px;
    height: 60px;
    border-radius: 5px;
    object-fit: cover;
    flex-shrink: 0;
}

.trending-content h4 {
    font-size: 0.95rem;
    margin-bottom: 5px;
}

.trending-content .article-meta {
    display: flex;
    gap: 10px;
    font-size: 0.8rem;
    color: var(--gray-color);
}

/* Category Spotlight */
.category-spotlight {
    padding: 80px 0;
    background-color: white;
}

.spotlight-card {
    display: flex;
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--box-shadow-hover);
    margin-top: 30px;
}

.spotlight-image {
    flex: 1;
    position: relative;
}

.spotlight-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.spotlight-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    background-color: var(--primary-color);
    color: white;
    padding: 5px 15px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
}

.spotlight-content {
    flex: 1;
    padding: 40px;
}

.spotlight-content h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.spotlight-content p {
    margin-bottom: 25px;
    color: var(--gray-color);
    line-height: 1.7;
}

.spotlight-stats {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
}

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

.stat-item i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.stat-number {
    font-size: 1.3rem;
    font-weight: 600;
    display: block;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--gray-color);
}

.spotlight-actions {
    display: flex;
    gap: 15px;
}

/* Newsletter */
.newsletter {
    padding: 80px 0;
    background-color: var(--primary-color);
    color: white;
}

.newsletter .container {
    display: flex;
    align-items: center;
    gap: 50px;
}

.newsletter-content {
    flex: 1;
}

.newsletter h2 {
    font-size: 2.2rem;
    margin-bottom: 15px;
    color: white;
}

.newsletter p {
    margin-bottom: 25px;
    font-size: 1.1rem;
    opacity: 0.9;
}

.newsletter-form {
    display: flex;
    max-width: 500px;
}

.newsletter-form input {
    flex: 1;
    padding: 15px 20px;
    border-radius: 5px 0 0 5px;
    font-size: 1rem;
    border: none;
}

.newsletter-form button {
    border-radius: 0 5px 5px 0;
}

.small-text {
    font-size: 0.8rem;
    opacity: 0.7;
    margin-top: 10px;
}

.newsletter-image {
    flex: 1;
}

.newsletter-image img {
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Responsive Styles */
@media (max-width: 1200px) {
    .category-card.list-view {
        grid-column: span 1;
        flex-direction: column;
    }
    
    .category-card.list-view .category-image {
        width: 100%;
        height: 180px;
    }
}

@media (max-width: 992px) {
    .spotlight-card {
        flex-direction: column;
    }
    
    .spotlight-content {
        padding: 30px;
    }
    
    .newsletter .container {
        flex-direction: column;
        text-align: center;
    }
    
    .newsletter-form {
        margin: 0 auto;
    }
    
    .newsletter-image {
        display: none;
    }
}

@media (max-width: 768px) {
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .view-options {
        width: 100%;
        justify-content: space-between;
    }
    
    .trending-articles {
        grid-template-columns: 1fr;
    }
    
    .spotlight-stats {
        flex-direction: column;
        gap: 20px;
    }
}

@media (max-width: 576px) {
    .categories-hero h1 {
        font-size: 2rem;
    }
    
    .categories-hero p {
        font-size: 1rem;
    }
    
    .tab-buttons {
        overflow-x: auto;
        padding-bottom: 10px;
        flex-wrap: nowrap;
        scrollbar-width: none;
    }
    
    .tab-buttons::-webkit-scrollbar {
        display: none;
    }
    
    .tab-button {
        padding: 10px 15px;
        font-size: 0.9rem;
        white-space: nowrap;
    }
    
    .spotlight-actions {
        flex-direction: column;
    }
    
    .spotlight-actions .btn {
        width: 100%;
    }
}