/* Blog Search and Tag Cloud Styles */

/* Main blog layout with sidebar */
.blog-container {
    display: flex;
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Tag Cloud Sidebar */
.blog-sidebar {
    flex: 0 0 300px;
    position: sticky;
    top: 20px;
    height: fit-content;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

/* Main Content Area */
.blog-main {
    flex: 1;
    min-width: 0;
}

/* Search Section */
.blog-search-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.blog-search-form {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
}

.blog-search-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.blog-search-input:focus {
    outline: none;
    border-color: var(--primary-blue, #4c5fd5);
    box-shadow: 0 0 0 3px rgba(76, 95, 213, 0.1);
}

.blog-search-btn {
    padding: 12px 24px;
    background: var(--primary-blue, #4c5fd5);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.blog-search-btn:hover {
    background: var(--primary-dark, #1a1f71);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 31, 113, 0.3);
}

.clear-search-btn {
    padding: 12px 20px;
    background: #f5f5f5;
    color: #666;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-search-btn:hover {
    background: #ebebeb;
    border-color: #ccc;
}

/* Result Count */
#result-count {
    color: #666;
    font-size: 14px;
    margin-top: 10px;
}

.result-count-text {
    display: inline-block;
    padding: 6px 12px;
    background: #f8f8f8;
    border-radius: 20px;
}

/* Tag Cloud Styles */
#tag-cloud {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.tag-cloud-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.clear-tags-btn {
    width: 100%;
    padding: 10px 16px;
    background: var(--accent-gold, #f9c74f);
    color: #333;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-tags-btn:hover {
    background: var(--accent-orange, #f39c12);
    transform: translateY(-1px);
}

/* Tag Categories */
.tag-category {
    margin-bottom: 25px;
}

.tag-category:last-child {
    margin-bottom: 0;
}

.tag-category-title {
    font-size: 14px;
    font-weight: 700;
    color: #333;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tag-category-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e0e0e0;
}

/* Tag List */
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Tag Buttons */
.tag-btn {
    padding: 6px 12px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: 13px;
    color: #555;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.tag-btn:hover:not(.disabled) {
    background: #e8eaf6;
    border-color: var(--primary-blue, #4c5fd5);
    color: var(--primary-blue, #4c5fd5);
    transform: translateY(-1px);
}

.tag-btn.selected {
    background: var(--primary-blue, #4c5fd5);
    border-color: var(--primary-blue, #4c5fd5);
    color: white;
}

.tag-btn.selected:hover {
    background: var(--primary-dark, #1a1f71);
    border-color: var(--primary-dark, #1a1f71);
}

.tag-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.tag-btn.disabled:hover {
    transform: none;
}

.tag-count {
    font-size: 11px;
    opacity: 0.7;
    font-weight: 600;
}

/* Blog Cards Grid */
#blog-posts-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
}

/* Blog Card */
.blog-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.12);
}

.blog-card-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f8f9fa;
}

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

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

.blog-card-content {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Blog Meta */
.blog-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #666;
}

.blog-date {
    display: flex;
    align-items: center;
    gap: 5px;
}

.blog-reading-time {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Blog Title */
.blog-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.3;
}

.blog-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.blog-title a:hover {
    color: var(--primary-blue, #4c5fd5);
}

/* Blog Excerpt */
.blog-excerpt {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
    flex: 1;
}

/* Blog Tags in Cards */
.blog-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 15px;
}

.blog-tag {
    display: inline-block;
    padding: 4px 10px;
    background: #f0f4ff;
    color: var(--primary-blue, #4c5fd5);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Read More Link */
.read-more {
    color: var(--primary-blue, #4c5fd5);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.read-more:hover {
    color: var(--primary-dark, #1a1f71);
    gap: 8px;
}

/* No Results Message */
.no-results {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.no-results h3 {
    font-size: 24px;
    color: #333;
    margin-bottom: 12px;
}

.no-results p {
    color: #666;
    margin-bottom: 20px;
}

.no-results .btn {
    display: inline-block;
    padding: 10px 24px;
    background: var(--primary-blue, #4c5fd5);
    color: white;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.no-results .btn:hover {
    background: var(--primary-dark, #1a1f71);
    transform: translateY(-1px);
}

/* Responsive Design */
@media (max-width: 992px) {
    .blog-container {
        flex-direction: column;
    }

    .blog-sidebar {
        position: static;
        max-height: none;
        flex: none;
        width: 100%;
    }

    /* Collapsible Tag Cloud on Mobile */
    #tag-cloud {
        position: relative;
    }

    .tag-cloud-toggle {
        display: block;
        width: 100%;
        padding: 15px;
        background: var(--primary-blue, #4c5fd5);
        color: white;
        border: none;
        border-radius: 8px;
        font-size: 16px;
        font-weight: 600;
        cursor: pointer;
        margin-bottom: 15px;
    }

    .tag-cloud-inner {
        display: block;
    }

    .tag-cloud-inner.collapsed {
        display: none;
    }
}

@media (max-width: 768px) {
    .blog-search-form {
        flex-direction: column;
    }

    .blog-search-btn,
    .clear-search-btn {
        width: 100%;
    }

    .blog-card {
        flex-direction: column;
    }

    .blog-card-image {
        height: 180px;
    }

    .blog-title {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .blog-container {
        padding: 20px 15px;
    }

    .blog-search-section {
        padding: 20px 15px;
    }

    #tag-cloud {
        padding: 15px;
    }

    .blog-card-content {
        padding: 20px;
    }

    .tag-btn {
        font-size: 12px;
        padding: 5px 10px;
    }
}

/* Animation for filtered results */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.blog-card {
    animation: fadeIn 0.4s ease;
}

/* Disable animations when preference is set */
.no-animations .blog-card,
.no-animations .tag-btn,
.no-animations .blog-search-btn {
    animation: none !important;
    transition: none !important;
}