/* Sidebar Module CSS */

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Sidebar Widget */
.sidebar-widget {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0;
    overflow: hidden;
}

.sidebar-widget-title {
    background: var(--primary-color);
    color: white;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.sidebar-widget-content {
    padding: 1.5rem;
}

/* Popular News Widget */
.popular-news-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.popular-news-item {
    display: flex;
    gap: 0.75rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.popular-news-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.popular-news-image {
    width: 80px;
    height: 60px;
    flex-shrink: 0;
    overflow: hidden;
}

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

.popular-news-content {
    flex: 1;
}

.popular-news-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.3;
    margin-bottom: 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.popular-news-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.popular-news-title a:hover {
    color: var(--primary-color);
}

.popular-news-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Sidebar News Widget */
.sidebar-news-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sidebar-news-item {
    display: flex;
    gap: 0.75rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
    cursor: pointer;
}

.sidebar-news-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.sidebar-news-item:hover {
    background-color: var(--light-gray);
    margin: 0 -1.5rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    padding-bottom: 1rem;
    border-radius: 8px;
}

.sidebar-news-item:last-child:hover {
    padding-bottom: 0;
}

.sidebar-news-image {
    width: 80px;
    height: 60px;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 6px;
    position: relative;
}

.sidebar-news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.sidebar-news-item:hover .sidebar-news-image img {
    transform: scale(1.05);
}

.sidebar-news-content {
    flex: 1;
    min-width: 0;
}

.sidebar-news-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.3;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sidebar-news-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.sidebar-news-title a:hover {
    color: var(--primary-color);
}

.sidebar-news-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.sidebar-news-date::before {
    content: "\f240";
    font-family: "bootstrap-icons";
    font-size: 0.7rem;
    color: var(--primary-color);
    margin-right: 0.25rem;
}

/* Widget News Item */
.widget-news-item {
    display: flex;
    gap: 0.75rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.widget-news-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.widget-news-item:hover {
    background-color: var(--light-gray);
    margin: 0 -1.5rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    border-radius: 4px;
}

.widget-news-image {
    width: 80px;
    height: 60px;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 4px;
}

.widget-news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.widget-news-item:hover .widget-news-image img {
    transform: scale(1.05);
}

.widget-news-content {
    flex: 1;
    min-width: 0;
}

.widget-news-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.3;
    margin-bottom: 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.widget-news-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.widget-news-title a:hover {
    color: var(--primary-color);
}

.widget-news-rank {
    width: 24px;
    height: 24px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    flex-shrink: 0;
    margin-right: 0.75rem;
}

.widget {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0;
    overflow: hidden;
    margin-bottom: 2rem;
}

.widget-title {
    background: var(--primary-color);
    color: white;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
}

.widget-content {
    padding: 1.5rem;
}

/* Categories Widget */
.categories-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.category-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    color: var(--text-color);
    text-decoration: none;
    border-bottom: 1px solid var(--border-color);
    transition: color 0.3s ease;
}

.category-link:last-child {
    border-bottom: none;
}

.category-link:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.category-link.active {
    color: var(--primary-color);
    font-weight: 600;
}

.category-name {
    font-weight: 500;
}

.category-count {
    background: var(--light-gray);
    color: var(--text-muted);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Tags Widget */
.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    background: var(--light-gray);
    color: var(--text-muted);
    padding: 0.4rem 0.8rem;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.tag:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    text-decoration: none;
}

/* Newsletter Widget */
.newsletter-widget p {
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.newsletter-widget .input-group {
    margin-bottom: 0.5rem;
}

.newsletter-widget .form-control {
    border: 2px solid var(--border-color);
    border-radius: 8px 0 0 8px;
    padding: 0.75rem;
    background: var(--card-bg);
    color: var(--text-color);
}

.newsletter-widget .form-control:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
    background: var(--card-bg);
    color: var(--text-color);
}

.newsletter-widget .btn {
    border-radius: 0 8px 8px 0;
    padding: 0.75rem 1rem;
    background: var(--primary-color);
    border: 2px solid var(--primary-color);
    color: white;
}

.newsletter-widget .btn:hover {
    background: #c82333;
    border-color: #c82333;
    color: white;
}

.newsletter-widget small {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Ad Space */
.ad-space {
    text-align: center;
    padding: 2rem 1rem;
}

.ad-placeholder {
    background: var(--light-gray);
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.ad-placeholder:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.ad-placeholder i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

.ad-placeholder p {
    margin: 0;
    font-weight: 500;
    font-size: 0.9rem;
}

/* Dark Mode */
body.dark-mode .sidebar-widget,
body.dark-mode .widget {
    background: var(--card-bg);
    border-color: #404040;
}

body.dark-mode .popular-news-item,
body.dark-mode .widget-news-item,
body.dark-mode .sidebar-news-item {
    border-bottom-color: #404040;
}

body.dark-mode .widget-news-item:hover,
body.dark-mode .sidebar-news-item:hover {
    background-color: #2d2d2d;
}

body.dark-mode .category-link {
    border-bottom-color: #404040;
}

body.dark-mode .category-count {
    background: #2d2d2d;
    color: #cccccc;
}

body.dark-mode .tag {
    background: #2d2d2d;
    border-color: #404040;
    color: #cccccc;
}

body.dark-mode .tag:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

body.dark-mode .newsletter-widget .form-control {
    background: #2d2d2d;
    border-color: #404040;
    color: #ffffff;
}

body.dark-mode .newsletter-widget .form-control:focus {
    background: #2d2d2d;
    border-color: var(--primary-color);
    color: #ffffff;
}

body.dark-mode .ad-placeholder {
    background: #2d2d2d;
    border-color: #404040;
}

body.dark-mode .ad-placeholder:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Quick Links Widget */
.quick-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.quick-link {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: var(--light-gray);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: all 0.3s ease;
    gap: 0.75rem;
}

.quick-link:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    text-decoration: none;
    transform: translateX(4px);
}

.quick-link i {
    font-size: 1.1rem;
    color: var(--primary-color);
    transition: color 0.3s ease;
}

.quick-link:hover i {
    color: white;
}

/* Dark Mode Quick Links */
body.dark-mode .quick-link {
    background: #2d2d2d;
    border-color: #404040;
    color: #ffffff;
}

body.dark-mode .quick-link:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Responsive Design */
@media (max-width: 991.98px) {
    .sidebar {
        order: -1;
        gap: 1.5rem;
    }
}

@media (max-width: 575.98px) {
    .sidebar-widget-content,
    .widget-content {
        padding: 1rem;
    }
    
    .popular-news-item,
    .widget-news-item,
    .sidebar-news-item {
        gap: 0.5rem;
    }
    
    .popular-news-image,
    .widget-news-image,
    .sidebar-news-image {
        width: 60px;
        height: 45px;
    }
    
    .popular-news-title,
    .widget-news-title,
    .sidebar-news-title {
        font-size: 0.85rem;
    }
    
    .popular-news-date,
    .sidebar-news-date {
        font-size: 0.7rem;
    }
    
    .sidebar-news-item:hover {
        margin: 0 -1rem;
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .widget-news-rank {
        width: 20px;
        height: 20px;
        font-size: 0.7rem;
        margin-right: 0.5rem;
    }
    
    .widget-title {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }
}