/* ============================================================================= */
/* FLOATING FILTER BUTTON - Always Visible on Mobile */
/* ============================================================================= */
.floating-filter-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    background: linear-gradient(135deg, #FF834A 0%, #ff6b2c 100%);
    color: white;
    border: none;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(255, 131, 74, 0.4);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    touch-action: manipulation;
}

.floating-filter-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(255, 131, 74, 0.5);
}

.floating-filter-btn:active {
    transform: translateY(-1px);
}

.floating-filter-btn .filter-count-badge {
    background: white;
    color: #FF834A;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    margin-left: -4px;
}

@media (max-width: 576px) {
    .floating-filter-btn {
        bottom: 15px;
        right: 15px;
        padding: 12px 16px;
        font-size: 0.9rem;
    }
    
    .floating-filter-btn .filter-count-badge {
        width: 20px;
        height: 20px;
        font-size: 0.7rem;
    }
}

/* ============================================================================= */
/* FILTER OVERLAY - Dark Background */
/* ============================================================================= */
.filter-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.filter-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ============================================================================= */
/* FILTER SIDE PANEL - Slides from Right */
/* ============================================================================= */
.filter-side-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 85%;
    max-width: 400px;
    background: white;
    z-index: 1050;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
}

.filter-side-panel.active {
    transform: translateX(0);
}

.filter-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: linear-gradient(135deg, #FF834A 0%, #ff6b2c 100%);
    color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.filter-panel-header h5 {
    display: flex;
    align-items: center;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.filter-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.filter-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.filter-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #fff9f5;
}

/* Smooth scrolling for mobile panel */
.filter-panel-body {
    -webkit-overflow-scrolling: touch;
}

/* Prevent body scroll when panel is open */
body.filter-panel-open {
    overflow: hidden;
}

@media (max-width: 576px) {
    .filter-side-panel {
        width: 90%;
        max-width: none;
    }
    
    .filter-panel-header {
        padding: 16px;
    }
    
    .filter-panel-header h5 {
        font-size: 1rem;
    }
    
    .filter-panel-body {
        padding: 16px;
    }
}

/* Active Filters Banner */
.active-filters-banner {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 12px 16px;
}

.filter-label {
    font-size: 0.85rem;
    color: #6c757d;
    font-weight: 500;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.3em 0.6em;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: normal;
    text-decoration: none;
    transition: all 0.2s ease;
    color: white;
}

.filter-tag-search { background: #343a40; }
.filter-tag-search:hover { background: #23272b; }
.filter-tag-newstype { background: #28a745; }
.filter-tag-newstype:hover { background: #218838; }
.filter-tag-company { background: #FF834A; }
.filter-tag-company:hover { background: #ff6b2c; }
.filter-tag-business { background: #6c757d; }
.filter-tag-business:hover { background: #5a6268; }
.filter-tag-country { background: #007bff; }
.filter-tag-country:hover { background: #0056b3; }
.filter-tag-technology { background: #6f42c1; }
.filter-tag-technology:hover { background: #5a32a3; }

.filter-tag .remove-x {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.filter-tag:hover .remove-x {
    opacity: 1;
}

.clear-all-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.25em 0.6em;
    background: transparent;
    color: #dc3545;
    border: 1px solid #dc3545;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: normal;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.clear-all-btn:hover {
    background: #dc3545;
    color: white;
}

/* Search Input with Magnifier */
.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    flex: 1;
    padding-right: 45px !important;
    border: 2px solid #dee2e6 !important;
    transition: all 0.3s ease;
}

.search-input:focus {
    border-color: #FF834A !important;
    box-shadow: 0 0 0 0.25rem rgba(255, 131, 74, 0.15) !important;
    padding-right: 45px !important;
}

.search-submit-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #FF834A 0%, #ff6b2c 100%);
    border: none;
    border-radius: 6px;
    width: 36px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    box-shadow: 0 2px 4px rgba(255, 131, 74, 0.2);
}

.search-submit-btn:hover {
    background: linear-gradient(135deg, #ff6b2c 0%, #ff5214 100%);
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 4px 8px rgba(255, 131, 74, 0.3);
}

.search-submit-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.search-submit-btn svg {
    width: 18px;
    height: 18px;
}

.filter-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, #dee2e6, transparent);
    margin: 16px 0;
}

/* News Items */
.news-item:last-child {
    border-bottom: none !important;
}

.news-item h3 a:hover {
    color: #FF834A !important;
}

.news-item img {
    border-radius: 8px;
}

/* Modern Pagination */
.pagination-wrapper {
    margin: 40px 0;
}

.pagination-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pagination-btn,
.pagination-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.pagination-btn {
    gap: 6px;
    background: linear-gradient(135deg, #FF834A 0%, #ff6b2c 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(255, 131, 74, 0.2);
}

.pagination-btn:hover {
    background: linear-gradient(135deg, #ff6b2c 0%, #ff5214 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 131, 74, 0.3);
    color: white;
}

.pagination-btn svg {
    width: 16px;
    height: 16px;
}

.pagination-numbers {
    display: flex;
    gap: 4px;
    align-items: center;
}

.pagination-number {
    background: white;
    color: #2c3e50;
    border: 2px solid #e9ecef;
}

.pagination-number:hover {
    border-color: #FF834A;
    color: #FF834A;
    background: #fff5f0;
}

.pagination-number.active {
    background: #FF834A;
    color: white;
    border-color: #FF834A;
    box-shadow: 0 2px 8px rgba(255, 131, 74, 0.3);
    cursor: default;
}

.pagination-dots {
    color: #999;
    padding: 0 8px;
    font-weight: 500;
}

/* Sticky Sidebar - Desktop only */
.sticky-sidebar {
    position: sticky;
    top: 20px;
}

.sticky-sidebar .card-body {
    overflow: visible;
}

.choices__list--dropdown {
    z-index: 100;
}

/* ============================================================================= */
/* MOBILE RESPONSIVE IMPROVEMENTS */
/* ============================================================================= */
@media (max-width: 576px) {
    /* Smaller pagination on mobile */
    .pagination-container {
        gap: 4px;
    }
    
    .pagination-btn,
    .pagination-number {
        min-width: 36px;
        height: 36px;
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .pagination-btn span {
        display: none;
    }
    
    /* Compact active filters on mobile */
    .active-filters-banner {
        padding: 10px 12px;
    }
    
    .filter-tag {
        font-size: 0.75rem;
        padding: 5px 8px;
    }
    
    .filter-label {
        font-size: 0.8rem;
        width: 100%;
        margin-bottom: 8px;
    }
    
    .clear-all-btn {
        font-size: 0.75rem;
        padding: 4px 8px;
    }
    
    /* Mobile-friendly dropdowns */
    .form-select-sm,
    .searchable-select {
        font-size: 0.9rem !important;
        padding: 10px 12px !important;
        height: auto !important;
        min-height: 44px;
        touch-action: manipulation;
    }
    
    /* Larger touch targets for mobile */
    .choices__inner {
        min-height: 44px !important;
        padding: 8px 12px !important;
    }
    
    .choices__list--dropdown .choices__item--selectable {
        padding: 14px 16px !important;
        font-size: 0.95rem !important;
        min-height: 48px;
        display: flex;
        align-items: center;
    }
    
    /* Mobile search input */
    .search-input {
        font-size: 16px !important; /* Prevents zoom on iOS */
        padding: 12px 50px 12px 12px !important;
        height: 46px;
    }
    
    .search-submit-btn {
        width: 42px;
        height: 40px;
        right: 3px;
    }
    
    /* Mobile heading */
    h1.display-4 {
        font-size: 1.75rem !important;
    }
    
    /* Card spacing on mobile */
    .card-body {
        padding: 1rem !important;
    }
    
    /* News items on mobile */
    .news-item img {
        height: 180px !important;
        margin-bottom: 12px;
    }
    
    .news-item .col-md-4,
    .news-item .col-md-8 {
        width: 100%;
    }
}

/* Tablet specific */
@media (min-width: 577px) and (max-width: 991px) {
    .choices__list--dropdown .choices__item--selectable {
        padding: 10px 14px;
    }
}

.form-select-sm:focus,
.form-control-sm:focus {
    border-color: #FF834A;
    box-shadow: 0 0 0 0.25rem rgba(255, 131, 74, 0.25);
}

.badge {
    font-size: 0.8rem;
    padding: 0.3em 0.5em;
}

/* Choices.js styling */
.choices {
    margin-bottom: 0;
}

.choices__inner {
    min-height: 31px;
    padding: 3px 7px;
    font-size: 0.875rem;
    border-color: #dee2e6;
}

.choices__input {
    font-size: 0.875rem;
}

.choices__list--dropdown .choices__item--selectable {
    padding: 8px 12px;
    font-size: 0.875rem;
}

.choices[data-type*=select-one] .choices__input {
    padding: 2px;
}

/* Subscription Banner */
.subscription-banner {
    background: linear-gradient(135deg, #ff834a 0%, #ff6b35 100%);
    color: white;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(255, 131, 74, 0.15);
}

.subscription-banner h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.subscription-banner p {
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
    opacity: 0.95;
    line-height: 1.4;
}

/* ============================================================================= */
/* IMPROVED MOBILE TOUCH INTERACTIONS */
/* ============================================================================= */
@media (max-width: 991px) {
    /* Prevent double-tap zoom on buttons */
    .btn, .pagination-btn, .pagination-number, .filter-tag, .search-submit-btn, .floating-filter-btn {
        touch-action: manipulation;
    }
}