/* Variables for consistency */
:root {
    --filter-primary: #ff6a00; /* Corridor Orange/Gold */
    --filter-accent-bg: rgba(255, 255, 255, 0.08);
    --filter-secondary-bg: rgba(0, 0, 0, 0.4);
    --filter-border: rgba(255, 255, 255, 0.12); /* Slightly brighter border */
}

.filter-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* New container for all controls to group them visually */
.filter-controls-container {
    padding: 30px; /* Increased padding */
    border-radius: 24px; /* More rounded */
    background: rgba(255, 255, 255, 0.03); /* Lighter base for controls area */
    backdrop-filter: blur(16px) saturate(150%); /* Stronger glass effect */
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.12); /* Brighter border */
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    margin-bottom: 30px;
}

.filter-controls-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px; /* Increased gap */
    margin-bottom: 30px;
}
@media (max-width: 1100px) {
    .filter-controls-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 768px) {
    .filter-controls-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

.filter-group {
    background: var(--filter-secondary-bg); /* Darker background inside controls container */
    border-radius: 16px; /* Slightly larger radius for inner cards */
    padding: 24px; /* Increased padding */
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 6px 15px rgba(0,0,0,0.4);
}

.genres-group {
    grid-column: 1 / -1; /* spans full width */
    margin-bottom: 0; 
}

.filter-title {
    font-size: 1.5rem; /* Slightly larger title */
    font-weight: 700;
    margin-bottom: 18px;
    color: var(--filter-primary);
    border-bottom: 2px solid rgba(255, 106, 0, 0.3); /* Brighter divider */
    padding-bottom: 10px;
    display: flex;
    align-items: center;
}

.muted-text {
    font-size: 0.95rem;
    font-weight: 400;
    color: #a0a0a0; /* More muted grey */
    margin-left: 10px;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 12px; /* Increased gap */
    align-items: center;
}
.genres-grid {
    gap: 10px; /* Increased gap */
    display: flex; /* Use flex to allow buttons to wrap naturally */
    flex-wrap: wrap;
    max-height: 350px; /* Limit height */
    overflow-y: auto;
}
.genres-grid::-webkit-scrollbar { width: 8px; }
.genres-grid::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); border-radius: 4px; }
.genres-grid::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 4px; }

.filter-btn {
    background: var(--filter-accent-bg); /* Use accent variable */
    color: #fff;
    border: 1px solid var(--filter-border);
    padding: 10px 18px; /* Larger padding */
    border-radius: 25px; /* More pill-like */
    cursor: pointer;
    transition: all 0.2s ease, box-shadow 0.2s ease;
    font-size: 1rem; /* Slightly larger font */
    font-weight: 500;
    white-space: nowrap;
    display: inline-block;
    margin-bottom: 0; /* Align perfectly */
    line-height: 1; /* Fix vertical alignment */
}
.filter-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--filter-primary);
    box-shadow: 0 0 10px rgba(255, 106, 0, 0.2);
}
.filter-btn.active {
    background: linear-gradient(135deg, #ff6a00, #d35400);
    border-color: #ff6a00;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 6px 15px rgba(255, 106, 0, 0.4);
    transform: translateY(-2px);
}

/* Date Range Inputs */
.date-range-inputs {
    display: flex;
    align-items: flex-end;
    gap: 15px;
    flex-wrap: wrap;
}

.date-label {
    color: #c9c9c9;
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-weight: 500;
    flex: 1 1 120px; 
}

.date-input {
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--filter-border);
    background: rgba(0,0,0,0.5); /* Deeper background for inputs */
    color: #fff;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    cursor: pointer;
    width: 100%;
}
.date-input:focus {
    outline: none;
    border-color: var(--filter-primary);
    box-shadow: 0 0 0 3px rgba(255, 106, 0, 0.2);
}

.date-range-inputs input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.8;
}

.apply-btn {
    padding: 12px 20px; /* Larger apply button */
    background: linear-gradient(135deg, #ff6a00, #d35400);
    color: white;
    border: none;
    font-weight: 700;
    border-radius: 10px; /* Slightly rounded corners */
    box-shadow: 0 4px 10px rgba(255, 106, 0, 0.4);
    line-height: 1;
    align-self: flex-end;
    flex: 0 1 auto;
    transition: all 0.2s ease;
}
.apply-btn:hover {
    background: linear-gradient(135deg, #d35400, #ff6a00);
    transform: translateY(-1px);
}

@media (max-width: 600px) {
    .date-range-inputs {
        flex-direction: column;
        align-items: flex-start;
    }
    .date-label {
        width: 100%;
        flex: 1 1 100%;
    }
    .apply-btn {
        align-self: flex-start;
        width: 100%;
        margin-top: 10px;
    }
}


/* Results */
.filter-results {
    margin-top: 30px;
    padding: 30px;
    background: rgba(255, 255, 255, 0.05); /* Same as outer container for visual flow */
    backdrop-filter: blur(8px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.6); 
}
.filter-results .filter-title {
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    margin-bottom: 20px;
    padding-bottom: 10px;
}
.filter-results .filter-title .muted-text {
    font-weight: 500;
    color: #bbb;
}

/* Card Grid Styling for Filter Results */
/* Note: Since the parent container uses `cards` class from style.css, some layout rules might inherit. */
.filter-cards {
    display: grid;
    /* Maintain aspect ratio of 2:3 posters, max 5 columns on desktop */
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 24px; /* Spacious gap */
    padding: 20px 0 0;
    
    /* Override inherited `cards` styles that force horizontal scroll */
    grid-auto-flow: initial !important;
    overflow-x: hidden !important;
    
    /* Apply hidden scrollbar for a clean look */
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.filter-cards::-webkit-scrollbar {
    display: none;
}
/* Ensure the .wrapper children adapt fully to the column grid */
.filter-cards .wrapper {
    /* override auto flow width */
    grid-auto-columns: initial !important; 
    width: auto !important;
}

@media (min-width: 1400px) {
    .filter-cards { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}
@media (max-width: 900px) {
    .filter-cards { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 20px; }
}
@media (max-width: 600px) {
    .filter-cards { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 15px; }
    .filter-page { padding: 1rem; }
    .filter-results { padding: 20px; border-radius: 16px; }
    .filter-group { padding: 18px; border-radius: 12px; }
    .filter-controls-container { padding: 20px; border-radius: 16px; }
}

.load-more-container {
    text-align: center;
    padding: 40px 0 10px; /* More vertical space */
}
/* Liquid Glass Load More Button (Refined) */
.load-more-btn {
    width: 100%; /* Make it span the full width of the container */
    max-width: 450px; /* Limit max width for a cleaner look on very wide screens */
    display: inline-block;
    padding: 16px 35px; /* Larger clickable area */
    border-radius: 16px; /* Increased rounding */
    
    /* Liquid Glass Aesthetic */
    background: rgba(255, 255, 255, 0.1); /* Slightly brighter background */
    color: white;
    font-weight: 700; /* Bolder text */
    border: 2px solid rgba(255, 255, 255, 0.4); /* Thicker, more prominent border */
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    
    cursor: pointer;
    transition: all 0.4s cubic-bezier(.2,.9,.2,1); /* Slower, smoother transition */
    font-size: 1.2rem;
    text-transform: uppercase; /* Make it stand out */
    letter-spacing: 0.5px;
}
.load-more-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: white;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transform: translateY(-4px); /* More dramatic lift */
}

.load-more-btn:disabled {
    opacity: 0.6;
    cursor: default;
    transform: none;
    box-shadow: none;
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

/* New Pagination Controls */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    max-width: 450px; /* Match old load more button max width */
    margin: 0 auto;
}

.pagination-btn {
    width: 60px; /* Fixed size arrow button */
    height: 60px;
    padding: 0;
    
    /* Liquid Glass Aesthetic */
    background: rgba(255, 255, 255, 0.1); 
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%; /* Circle shape */
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    
    cursor: pointer;
    transition: all 0.4s cubic-bezier(.2,.9,.2,1);
    display: inline-flex;
    justify-content: center;
    align-items: center;
}
.pagination-btn img {
    width: 24px;
    height: 24px;
    filter: invert(1);
    transition: all 0.2s ease;
}
.pagination-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: white;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: translateY(-3px);
}
.pagination-btn:disabled {
    opacity: 0.4;
    cursor: default;
    transform: none;
    box-shadow: none;
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.page-status {
    font-size: 1.5rem; /* Prominent status text */
    font-weight: 700;
    color: white;
    min-width: 120px;
    text-align: center;
}