/**
 * Frontend CSS for BD Location Filter
 * v2.0 — Filter Form (separate page) + Results Page
 */

/* ===== Base Wrapper & Container ===== */
.bdlf-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans Bengali", sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

.bdlf-container {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}


/* ============================================================
 *  FILTER ONLY PAGE — [bd_location_filter] shortcode
 * ============================================================ */

.bdlf-filter-only .bdlf-container {
    border-radius: 16px;
}

/* Header */
.bdlf-header {
    background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
    padding: 24px 30px;
    text-align: center;
}

.bdlf-title {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* Filter Section */
.bdlf-filter-section {
    padding: 24px 30px 16px;
    background: #f8fafc;
    border-bottom: 2px solid #e8edf2;
}

.bdlf-form {
    margin: 0;
}

.bdlf-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}

.bdlf-field {
    flex: 1;
    min-width: 200px;
}

.bdlf-field label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

/* Dropdown */
.bdlf-dropdown {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #d1d5db;
    border-radius: 10px;
    font-size: 15px;
    color: #1f2937;
    background-color: #ffffff;
    cursor: pointer;
    transition: all 0.25s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
    box-sizing: border-box;
    line-height: 1.4;
}

.bdlf-dropdown:focus {
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
    outline: none;
}

.bdlf-dropdown:disabled {
    background-color: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
    border-color: #e5e7eb;
}

/* Buttons */
.bdlf-field-btn {
    min-width: 160px;
}

/* 🔍 খুঁজুন Button */
.bdlf-btn-search {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 28px;
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.3px;
    box-shadow: 0 3px 12px rgba(22, 163, 74, 0.35);
}

.bdlf-btn-search:hover {
    background: linear-gradient(135deg, #15803d 0%, #166534 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(22, 163, 74, 0.45);
}

.bdlf-btn-search:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.3);
}

/* Reset Button */
.bdlf-filter-actions {
    margin-top: 12px;
    text-align: right;
}

.bdlf-btn-reset {
    display: inline-block;
    padding: 8px 20px;
    background: transparent;
    color: #6b7280;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bdlf-btn-reset:hover {
    color: #ef4444;
    border-color: #ef4444;
    background: #fef2f2;
}


/* ============================================================
 *  RESULTS PAGE — [bd_location_results] shortcode
 * ============================================================ */

/* Results Header */
.bdlf-results-header {
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
    padding: 24px 30px;
}

.bdlf-results-title {
    margin: 0 0 12px 0;
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.3px;
}

/* Search Breadcrumb */
.bdlf-search-breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 10px;
}

.bdlf-breadcrumb-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.bdlf-breadcrumb-value {
    font-size: 14px;
    color: #ffffff;
    font-weight: 600;
}

.bdlf-breadcrumb-clear {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    transition: all 0.2s ease;
    margin-left: auto;
}

.bdlf-breadcrumb-clear:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.25);
    text-decoration: none;
}

/* Mini Filter Bar (results page এ থাকবে) */
.bdlf-mini-filter {
    padding: 16px 30px;
    background: #f0f4f8;
    border-bottom: 1px solid #e2e8f0;
}

.bdlf-mini-filter-form {
    margin: 0;
}

.bdlf-mini-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.bdlf-mini-dropdown {
    min-width: 180px;
    max-width: 220px;
    padding: 10px 14px !important;
    font-size: 14px !important;
    border-radius: 8px !important;
}

.bdlf-btn-mini-search {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    background: linear-gradient(135deg, #1a73e8 0%, #1557b0 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(26, 115, 232, 0.3);
}

.bdlf-btn-mini-search:hover {
    background: linear-gradient(135deg, #1557b0 0%, #0d47a1 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(26, 115, 232, 0.4);
}

/* Results Info */
.bdlf-results-info {
    padding: 14px 30px;
    background: #f0f9ff;
    border-bottom: 1px solid #e0f2fe;
    font-size: 14px;
    color: #0369a1;
}

.bdlf-results-info strong {
    color: #0c4a6e;
}


/* ============================================================
 *  POSTS GRID & CARDS
 * ============================================================ */

.bdlf-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
    padding: 30px;
}

.bdlf-post-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.bdlf-post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
    border-color: #1a73e8;
}

.bdlf-post-thumb {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
    background: #f3f4f6;
}

.bdlf-post-thumb a {
    display: block;
    width: 100%;
    height: 100%;
}

.bdlf-post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.bdlf-post-card:hover .bdlf-post-thumb img {
    transform: scale(1.05);
}

.bdlf-no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    color: #9ca3af;
    font-size: 14px;
}

.bdlf-post-content {
    padding: 20px;
}

.bdlf-post-title {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
}

.bdlf-post-title a {
    color: #1f2937;
    text-decoration: none;
    transition: color 0.2s;
}

.bdlf-post-title a:hover {
    color: #1a73e8;
}

.bdlf-post-excerpt {
    margin: 0 0 14px 0;
    font-size: 14px;
    color: #6b7280;
    line-height: 1.6;
}

.bdlf-post-location {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #f0f9ff;
    border-radius: 8px;
    margin-bottom: 12px;
}

.bdlf-location-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.bdlf-location-text {
    font-size: 13px;
    color: #0369a1;
    font-weight: 500;
}

.bdlf-post-meta {
    font-size: 12px;
    color: #9ca3af;
}


/* ============================================================
 *  NO POSTS
 * ============================================================ */

.bdlf-no-posts {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 30px;
    color: #9ca3af;
}

.bdlf-no-posts p {
    margin: 0;
    font-size: 16px;
}

.bdlf-no-posts-icon {
    font-size: 52px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.bdlf-btn-back {
    display: inline-block;
    margin-top: 18px;
    padding: 10px 24px;
    background: linear-gradient(135deg, #1a73e8 0%, #1557b0 100%);
    color: #ffffff;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(26, 115, 232, 0.3);
}

.bdlf-btn-back:hover {
    background: linear-gradient(135deg, #1557b0 0%, #0d47a1 100%);
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-1px);
}


/* ============================================================
 *  LOADING
 * ============================================================ */

.bdlf-loading {
    text-align: center;
    padding: 50px 30px;
}

.bdlf-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #1a73e8;
    border-radius: 50%;
    animation: bdlf-spin 0.8s linear infinite;
    margin-bottom: 14px;
}

@keyframes bdlf-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.bdlf-loading p {
    color: #6b7280;
    font-size: 14px;
    margin: 0;
}


/* ============================================================
 *  PAGINATION
 * ============================================================ */

.bdlf-pagination {
    padding: 20px 30px 30px;
    text-align: center;
}

.bdlf-pagination-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.bdlf-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 14px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.bdlf-page-btn:hover {
    border-color: #1a73e8;
    color: #1a73e8;
    background: #eff6ff;
    text-decoration: none;
}

.bdlf-page-active {
    background: linear-gradient(135deg, #1a73e8 0%, #1557b0 100%);
    color: #ffffff !important;
    border-color: #1a73e8 !important;
    box-shadow: 0 2px 8px rgba(26, 115, 232, 0.3);
    text-decoration: none !important;
}

.bdlf-page-active:hover {
    background: linear-gradient(135deg, #1557b0 0%, #0d47a1 100%);
}

.bdlf-page-dots {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: #9ca3af;
    font-size: 14px;
}


/* ============================================================
 *  RESPONSIVE
 * ============================================================ */

@media (max-width: 768px) {
    .bdlf-wrapper {
        padding: 10px 0;
    }

    .bdlf-header,
    .bdlf-results-header {
        padding: 18px 20px;
    }

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

    .bdlf-results-title {
        font-size: 18px;
    }

    .bdlf-filter-section {
        padding: 18px 20px 12px;
    }

    .bdlf-filter-row {
        flex-direction: column;
        gap: 12px;
    }

    .bdlf-field {
        min-width: 100%;
    }

    .bdlf-field-btn {
        min-width: 100%;
    }

    .bdlf-mini-filter {
        padding: 14px 20px;
    }

    .bdlf-mini-filter-row {
        flex-direction: column;
        gap: 10px;
    }

    .bdlf-mini-dropdown {
        min-width: 100% !important;
        max-width: 100% !important;
    }

    .bdlf-btn-mini-search {
        width: 100%;
        justify-content: center;
    }

    .bdlf-search-breadcrumb {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .bdlf-breadcrumb-clear {
        margin-left: 0;
    }

    .bdlf-posts-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 20px;
    }

    .bdlf-results-info {
        padding: 12px 20px;
    }

    .bdlf-pagination {
        padding: 16px 20px 24px;
    }

    .bdlf-dropdown {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

@media (max-width: 480px) {
    .bdlf-title {
        font-size: 18px;
    }

    .bdlf-results-title {
        font-size: 16px;
    }

    .bdlf-post-card {
        border-radius: 10px;
    }

    .bdlf-post-thumb {
        height: 170px;
    }

    .bdlf-post-content {
        padding: 16px;
    }

    .bdlf-post-title {
        font-size: 16px;
    }

    .bdlf-btn-search {
        font-size: 15px;
        padding: 11px 20px;
    }
}
