/* Enhanced Filter Section Styles */
.filter-section {
    padding: 0px;
    margin-bottom: 30px;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.filter-header {
    display: flex;
    align-items: start;
    gap: 0;
    margin-bottom: 15px;
}

.filter-header i {
    font-size: 2rem;
    color: #6366f1;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.filter-header h3 {
    margin: 0;
    color: #1f2937;
    font-weight: 700;
    font-size: 1.5rem;
}

#oldResultsContainer .current-date {
    background: #646464;
    color: #fff;
}

/* Filter Tabs */
.filter-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    margin-bottom: 25px;
}

.filter-tab:first-child {
    grid-column: 1 / -1;
}

.filter-tab {
    flex: 1;
    min-width: 150px;
    padding: 18px 20px;
    background: white;
    border: 2px solid transparent;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    font-weight: 600;
    color: #1f2937;
    position: relative;
    overflow: hidden;
}

.filter-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

div#resultCount {
    font-size: 12px;
    margin-bottom: 8px;
}

.filter-tab:hover::before {
    left: 100%;
}

.filter-tab:hover {
    background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.filter-tab.active {
    background: linear-gradient(135deg, #0057b6, #0078f9);
    color: white;
}

.filter-tab i {
    display: block;
    margin-bottom: 10px;
    transition: transform 0.3s ease;
}

.filter-tab:hover i {
    transform: scale(1.2) rotate(5deg);
}

.filter-tab.active i {
    animation: bounce 0.6s ease;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.filter-tab span {
    display: block;
    font-size: 0.95rem;
}

/* Filter Options Container */
.filter-options {
    display: none;
    padding: 0;
}

.filter-options.active {
    display: block;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Month and Week Grids */
.month-grid,
.week-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 5px;
    margin-top: 20px;
}

.month-btn,
.week-btn {
    padding: 8px;
    font-size: 12px;
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    font-weight: 600;
    color: #374151;
    position: relative;
    overflow: hidden;
}

.month-btn:hover::after,
.week-btn:hover::after {
    width: 300px;
    height: 300px;
}

.month-btn:hover,
.week-btn:hover {
    background: linear-gradient(135deg, #cf2939, #5e0009);
    color: white;
}

.month-btn.selected,
.week-btn.selected {
    background: linear-gradient(135deg, #cf2939, #5e0009);
    color: white;
}

/* Custom Date Range */
.date-range-selector {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 20px;
    align-items: end;
}

.date-input-group {
    display: flex;
    flex-direction: column;
    position: relative;
}

.date-input-group label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 10px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-input-group label i {
    color: #6366f1;
}

.date-input-group input {
    padding: 14px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
    font-weight: 500;
}

.date-input-group input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}

.apply-filter-btn {
    padding: 14px 35px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.apply-filter-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.apply-filter-btn:active {
    transform: translateY(-1px);
}

.apply-filter-btn i {
    font-size: 1.1rem;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.stat-card .stat-label {
    color: #6b7280;
    font-size: 12px;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {

    .filter-tab {
        min-width: 100%;
    }

    .date-range-selector {
        grid-template-columns: 1fr;
    }

    .apply-filter-btn {
        width: 100%;
        justify-content: center;
    }

    .month-grid,
    .week-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .stat-card {
        padding: 8px;
    }

    .stat-card .stat-number {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {

    .filter-header h3 {
        font-size: 1.2rem;
    }

    .filter-tab {
        padding: 8px;
    }

    .filter-tab i {
        font-size: 1.5rem;
    }

    .month-grid,
    .week-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

/* Loading Animation */
.loading-pulse {
    animation: loadingPulse 1.5s infinite;
}

@keyframes loadingPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}


.year-btn, .month-btn, .week-btn {
    cursor: pointer;
    padding: 6px 10px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
    transition: all 0.3s;
}

.year-btn:hover, .month-btn:hover, .week-btn:hover {
    background: linear-gradient(135deg, #0057b6, #0078f9);
    transform: translateY(-2px);
    color: white;
}

.year-btn.selected, .month-btn.selected, .week-btn.selected {
    background: linear-gradient(135deg, #cf2939, #5e0009);
    color: white;
}

.comparison-view {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.comparison-title {
    text-align: center;
    color: #0072ed;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 2px solid #dee2e6;
}

@media (max-width: 768px) {
    .comparison-view {
        grid-template-columns: 1fr;
    }
}