/**
 * Blog Search Styles
 * Custom styling for the blog search functionality
 */

/* Blog Search Wrapper */
.blog-search-wrapper {
    padding: 0;
}

.blog-search-form {
    margin: 0;
}

.blog-search-form .input-group {
    display: flex;
    align-items: stretch;
    border-radius: 36px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    background: #fff;
    transition: all 0.3s ease;
}

.blog-search-form .input-group:focus-within {
    box-shadow: 0 6px 30px rgba(127, 90, 240, 0.15);
}

.blog-search-form .form-control {
    border: 2px solid transparent;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 400;
    color: #666;
    border-radius: 36px 0 0 36px;
    transition: all 0.3s ease;
    flex: 1;
}

.blog-search-form .form-control:focus {
    border-color: #7f5af0;
    box-shadow: none;
    outline: none;
    background: #fff;
}

.blog-search-form .form-control::placeholder {
    color: #999;
    font-weight: 400;
}

.blog-search-form .btn {
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 0 36px 36px 0;
    white-space: nowrap;
    transition: all 0.3s ease;
    border: none;
}

.blog-search-form .btn:hover {
    transform: translateY(-1px);
}

/* Desktop - Original layout with slight adjustment */
#blog-page .row.align-items-center {
    align-items: center !important;
    margin-bottom: 40px;
    margin-top: -10px; /* Move up slightly on desktop */
}

.posts-category {
    margin-bottom: 0 !important;
}

.blog-search-wrapper {
    margin-bottom: 0;
    margin-top: 5px; /* Slightly lower on desktop */
}

/* No Results Message */
.no-results-message {
    text-align: center;
    padding: 60px 20px;
}

.no-results-message p {
    color: #666;
    font-size: 18px;
    margin: 0;
}

/* Blog Post Item Transitions */
.blog-post-item {
    transition: all 0.4s ease;
}

.blog-post-item[style*="display: none"] {
    opacity: 0;
    transform: scale(0.95);
}

/* Responsive Styles */
@media (max-width: 991px) {
    .blog-search-form .form-control {
        font-size: 14px;
        padding: 12px 18px;
    }
    
    .blog-search-form .btn {
        font-size: 14px;
        padding: 12px 20px;
    }
}

@media (max-width: 767px) {
    /* Mobile - Force search on the RIGHT side, not below */
    #blog-page .row.align-items-center {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        justify-content: space-between !important;
        align-items: center !important;
        margin-bottom: 30px;
        margin-top: -15px; /* Move up on mobile */
    }
    
    /* Force columns to stay in one row */
    #blog-page .row.align-items-center > .col,
    #blog-page .row.align-items-center > .col-md-6,
    #blog-page .row.align-items-center > [class*="col-"] {
        flex: 0 1 auto !important;
        width: auto !important;
        max-width: none !important;
    }
    
    .posts-category {
        margin-bottom: 0 !important;
        text-align: left;
        display: flex;
        align-items: center;
        flex-shrink: 0;
    }
    
    .posts-category h4 {
        margin-bottom: 0 !important;
        line-height: 1.2;
        white-space: nowrap;
        font-size: 20px !important; /* Increased from default */
    }
    
    .blog-search-wrapper {
        margin-bottom: 0 !important;
        margin-top: 0 !important;
        display: flex;
        align-items: center;
        flex-shrink: 1;
        margin-left: 10px;
    }
    
    /* Compact search bar on mobile with square button */
    .blog-search-form .input-group {
        max-width: 280px;
        border-radius: 10px;
    }
    
    .blog-search-form .form-control {
        font-size: 14px; /* Increased from 13px */
        padding: 10px 14px;
        border-radius: 10px 0 0 10px;
    }
    
    /* Square button on mobile */
    .blog-search-form .btn {
        font-size: 14px; /* Increased from 13px */
        padding: 10px 16px;
        border-radius: 0 10px 10px 0;
        white-space: nowrap;
    }
}

@media (max-width: 575px) {
    /* Smaller on very small screens - STILL ON THE RIGHT */
    #blog-page .row.align-items-center {
        flex-wrap: nowrap !important;
        margin-top: -15px;
    }
    
    .blog-search-form .input-group {
        max-width: 200px;
        min-width: 180px;
    }
    
    .blog-search-form .form-control {
        font-size: 13px; /* Increased from 11px */
        padding: 8px 10px;
        border-radius: 8px 0 0 8px;
    }
    
    .blog-search-form .btn {
        font-size: 13px; /* Increased from 11px */
        padding: 8px 10px;
        border-radius: 0 8px 8px 0;
    }
    
    /* Make heading smaller to fit */
    .posts-category h4 {
        font-size: 18px !important; /* Increased from 16px */
    }
    
    /* Add spacing between heading/search and posts */
    #blog-page .row.align-items-center {
        margin-bottom: 25px;
    }
    
    .blog-search-wrapper {
        margin-left: 8px;
    }
}

@media (max-width: 480px) {
    #blog-page .row.align-items-center {
        margin-top: -15px;
    }
    
    .blog-search-form .input-group {
        max-width: 170px;
        min-width: 150px;
    }
    
    .blog-search-form .form-control {
        font-size: 12px; /* Increased from 10px */
        padding: 7px 8px;
    }
    
    .blog-search-form .btn {
        font-size: 12px; /* Increased from 10px */
        padding: 7px 8px;
    }
    
    .posts-category h4 {
        font-size: 16px !important; /* Increased from 14px */
    }
    
    /* Add spacing between heading/search and posts */
    #blog-page .row.align-items-center {
        margin-bottom: 20px;
    }
    
    .blog-search-wrapper {
        margin-left: 5px;
    }
}

/* Clear Button (Optional Enhancement) */
.clear-search {
    position: absolute;
    right: 150px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0 10px;
    display: none;
    transition: color 0.3s ease;
    z-index: 10;
}

.clear-search:hover {
    color: #666;
}

/* Loading State (Optional Enhancement) */
.blog-search-form.loading .btn {
    position: relative;
    pointer-events: none;
}

.blog-search-form.loading .btn::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    right: 20px;
    margin-top: -8px;
    border: 2px solid #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
    to { transform: rotate(360deg); }
}

/* Search Results Counter (Optional Enhancement) */
.search-results-counter {
    text-align: center;
    padding: 20px 0;
    color: #666;
    font-size: 14px;
}

/* Highlight Search Terms (Optional Enhancement) */
.search-highlight {
    background-color: #fff3cd;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
}