/* Botó toggle per filtres en mòbil */
.filters-toggle-btn
{
    display: none !important;
    /* Ocult per defecte en desktop */
    width: 100%;
    padding: 15px 20px;
    background-color: #C30832;
    color: white;
    border: none;
    font-family: 'oswald', Helvetica, Arial, sans-serif;
    font-size: 18px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    margin-bottom: 20px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.filters-toggle-btn:hover
{
    background-color: #000;
}

.filters-toggle-icon
{
    transition: transform 0.3s;
}

.filters-toggle-icon.rotated
{
    transform: rotate(180deg);
}

/* Container dels filtres */
.portfolio-filters-container
{
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
}

/* Responsive - mostrar toggle button només en mòbil */
@media (max-width: 768px)
{
    .filters-toggle-btn
    {
        display: flex !important;
    }

    /* Quan els filtres estan amagats */
    .portfolio-filters-container.filters-hidden
    {
        max-height: 0;
        opacity: 0;
        margin-bottom: 0;
    }

    /* Quan els filtres estan visibles */
    .portfolio-filters-container.filters-visible
    {
        max-height: 1000px;
        /* Valor suficientment alt */
        opacity: 1;
    }
}

.portfolio-filters-app
{
    position: relative;
}

/* Loading Overlay */
.loading-overlay
{
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner
{
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #C30832;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin
{
    0%
    {
        transform: rotate(0deg);
    }

    100%
    {
        transform: rotate(360deg);
    }
}

/* First Row - Main Filters */
#top .filters-row-main
{
    display: flex;
    align-items: center;
    gap: 0;
    margin-left: -10px;
    margin-right: -10px;
    flex-wrap: wrap;
}

#top .filter-label
{
    font-weight: 700;
    color: #C30832;
    font-family: 'oswald', Helvetica, Arial, sans-serif;
    font-weight: 600;
    font-size: 28px;
    letter-spacing: 1px;
    margin-right: 10px;
}

/* Custom Dropdown Filters */
#top .filters-row-main .custom-dropdown
{
    flex: 1;
    min-width: 180px;
    max-width: 250px;
    position: relative;
    padding: 10px;
}

#top .filters-row-main .dropdown-button
{
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 15px;
    background-color: #DAD9D7;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    font-size: 15px;
    color: #000;
    text-align: left;
}

#top .filters-row-main .dropdown-button:hover
{
    background-color: #C30832;
    color: white;
}

#top .filters-row-main .dropdown-button:focus
{
    outline: none;
}

#top .filters-row-main .dropdown-arrow
{
    transition: transform 0.3s;
    flex-shrink: 0;
}

#top .filters-row-main .dropdown-arrow.rotated
{
    transform: rotate(180deg);
}

#top .filters-row-main .dropdown-menu
{
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #e5e4e2;
    border: 1px solid #ddd;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    overflow-y: auto;
}

#top .filters-row-main .dropdown-option
{
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 14px;
}

#top .filters-row-main .dropdown-option:hover
{
    background-color: #f5f5f5;
}

#top .filters-row-main .dropdown-option input[type="checkbox"]
{
    appearance: none;
    display: inline-block !important;
    background-color: #fff;
    border: none;
    width: 13px;
    height: 12px;
    cursor: pointer;
    position: relative;
}

#top .filters-row-main .dropdown-option input[type="checkbox"]:checked {
    background-color: #c30a32
}

#top .filters-row-main .dropdown-option span
{
    width: calc(100% - 26px);
}

/* Remove old select styles */
#top .filters-row-main .filter-select-wrapper
{
    display: none;
}

.reset-button
{
    padding: 5px 30px;
    background: #000;
    color: white;
    border: none;
    font-family: oswald;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 1px;
    cursor: pointer;
    text-transform: uppercase;
    margin-left: 10px;
    margin-right: 10px;
}

.reset-button:hover
{
    background: #C30832;
}

/* Second Row - Search and Sort */
#top .filters-row-search
{
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

#top .filters-row-search .search-label
{
    font-weight: 700;
    color: #C30832;
    font-family: oswald;
    font-weight: 600;
    font-size: 28px;
    letter-spacing: 1px;
}

#top .filters-row-search .search-wrapper
{
    flex: 1;
    max-width: 400px;
    position: relative;
}

#top .filters-row-search .search-input
{
    width: 100%;
    padding: 8px 45px 8px 15px;
    border: 0;
    transition: all 0.3s;
    margin: 0;
    font-weight: 500;
    font-size: 15px;
    color: #000 !important;
    background-color: #DAD9D7;
}

#top .filters-row-search .search-input:focus
{
    outline: none;
    border-color: #C30832;
    box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.1);
}

#top .filters-row-search .search-input::placeholder
{
    color: #999;
}

#top .filters-row-search .search-icon
{
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #000;
    pointer-events: none;
}

#top .filters-row-search .sort-label
{
    font-size: 15px;
    font-weight: 500;
    color: #000;
    line-height: 1;
    text-align: right;
}

#top .filters-row-search .sort-options
{
    display: flex;
    gap: 25px;
}

#top .filters-row-search .sort-radio
{
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

#top .filters-row-search .sort-radio input[type="radio"]
{
    appearance: none;
    display: inline-block !important;
    background-color: #fff;
    border: none;
    width: 13px;
    height: 12px;
    cursor: pointer;
    position: relative;
    margin: 0;
    padding: 0;
}

#top .filters-row-search .sort-radio input[type="radio"]:checked {
    background-color: #c30a32
}

#top .filters-row-search .sort-radio label
{
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    line-height: 1;
    color: #000;
}

/* View Toggle Buttons */
#top .view-toggle
{
    display: flex;
    gap: 5px;
    margin-left: auto;
}

#top .view-toggle-btn
{
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    background-color: #DAD9D7;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    color: #000;
}

#top .view-toggle-btn:hover
{
    background-color: #C30832;
    color: white;
}

#top .view-toggle-btn.active
{
    background-color: #C30832;
    color: white;
}

/* Active Filters Display */
.active-filters
{
    margin-top: 5;
    padding-top: 5;
    color: #000;
}

.active-filters strong
{
    font-size: 14px;
    color: #666;
    text-transform: uppercase;
}

.filter-tags
{
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.filter-tag
{
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px;
    border: 1px solid #000;
    border-radius: 0;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s;
}

.filter-tag:hover
{
    background: #fff;
    border-color: #C30832;
}

.filter-tag-remove
{
    cursor: pointer;
    color: #000;
    font-weight: 700;
    font-size: 14px;
    line-height: 1;
    transition: color 0.3s;
}

.filter-tag-remove:hover
{
    color: #C30832;
}

/* Results Section */
.films-grid-wrapper, 
.films-grid-wrapper strong {
    color: #000;
}

/* Grid View */
.grid-view .films-grid
{
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 5px;
}

.films-info
{
    display: none;
    margin-top: 20px;
    margin-bottom: 40px;
}

/* Film Item */
.film-item
{
    position: relative;
    background-color: #fff;
}

.film-image-wrapper
{
    position: relative;
}

.film-image-wrapper .film-related
{
    position: absolute;
    top: 5px;
    right: 5px;
    padding: 5px;
    font-size: 12px;
    background-color: #c30a32;
    color: #fff;
    z-index: 99;
}

.film-image-wrapper img
{
    display: block;
}

.film-item .film-date
{
    padding: 10px 15px;
    background-color: #000;
    color: #fff;
    font-family: oswald;
    text-transform: uppercase;
}

.film-item .film-info
{
    padding: 15px;
}

.film-item .film-title
{
    color: #000;
    font-size: 22px;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    margin-bottom: 5px;
}

.film-item .film-link:hover .film-title
{
    color: #c30a32;
}

.film-meta
{
    margin: 0 !important;
    font-size: 14px;
}

.film-meta.film-meta__icon
{
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: bold;
}

.film-meta__icon svg
{
    color: #c30a32;
    stroke: #c30a32;
}

.film-meta .seccio-span
{
    font-weight: bold;
    text-transform: uppercase;
}

.film-meta.film-meta__date
{
    font-family: "oswald", Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.3;
    font-weight: 200;
    text-transform: uppercase;
}

.film-meta.film-meta__date strong
{
    color: #fff;
    font-size: 16px;
    font-weight: 600;
}

.film-button
{
    position: absolute;
    bottom: 0;
    left: 0;
    background-color: #c30a32;
    color: #fff;
    text-align: center;
    width: calc(100% - 30px);
    margin: 15px;
    padding: 5px 20px;
    display: block;
    cursor: pointer;
    font-family: "oswald", Helvetica, Arial, sans-serif;
    font-size: 18px;
    text-transform: uppercase;
}

.film-button:hover
{
    background-color: #000;
    color: #fff !important;
}

/* Calendar View */
.calendar-view
{
    margin-top: 20px;
}

.calendar-days
{
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Calendar Day Section */
.calendar-day-section
{
    margin-top: 30px;
}

.calendar-day-section:last-child
{
    border-bottom: none;
}

.calendar-days .calendar-day-header
{
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 0;
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 2px solid #000 !important;
    margin-bottom: 1px;
}

.calendar-days .calendar-day-header h3
{
    margin: 0;
    font-family: 'oswald', Helvetica, Arial, sans-serif;
    font-size: 28px !important;
    font-weight: 600;
    letter-spacing: 1px;
    color: #000;
    text-transform: uppercase;
}

.calendar-chevron
{
    margin-right: 20px;
    transition: transform 0.3s;
    color: #000;
}

.calendar-day-header.expanded .calendar-chevron
{
    transform: rotate(180deg);
}

.calendar-day-content
{
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: flex-start;
}

/* Calendar Film Item */
.calendar-film-item
{
    width: 33.3333%;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0;
    padding: 20px 0;
    transition: background-color 0.3s;
}

/* Calendar Film Time */
.calendar-film-time
{
    width: 100%;
    margin-bottom: 10px;
}

.calendar-film-time span
{
    display: block;
    color: #C30832;
    font-family: 'oswald', Helvetica, Arial, sans-serif;
    font-size: 28px;
    font-weight: 600;
    text-transform: uppercase;
}

/* Calendar Film Image */
.calendar-film-image
{
    position: relative;
    aspect-ratio: 1/1;
    width: 132px;
}

.calendar-film-image img
{
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.calendar-film-bookmark
{
    position: absolute;
    top: 5px;
    right: 5px;
    z-index: 10;
}

.calendar-film-bookmark svg
{
    color: #C30832;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Calendar Film Details */
.calendar-film-details
{
    flex: 1;
    min-width: 0;
    background-color: #fff;
    padding: 10px 20px;
    min-height: 132px;
}

.calendar-film-link
{
    text-decoration: none;
    color: inherit;
}

.calendar-film-details .calendar-film-title
{
    margin: 0 0 8px 0;
    font-size: 20px;
    font-weight: 600;
    text-transform: uppercase;
    color: #000;
    transition: color 0.3s;
    line-height: 1.2;
}

.calendar-film-details .calendar-film-link:hover .calendar-film-title
{
    color: #C30832;
}

.calendar-film-details .calendar-film-meta
{
    margin: 4px 0;
    font-size: 13px;
    color: #000;
    line-height: 1.3;
}

.calendar-film-details .calendar-film-location
{
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #000;
}

.calendar-film-details .calendar-film-location svg
{
    color: #C30832;
    stroke: #C30832;
}

/* Responsive Design */
@media (max-width: 1100px)
{
    .calendar-film-item
    {
        width: calc(50% - 7.5px);
    }
}

@media (max-width: 768px)
{

    .filter-label,
    .search-label,
    .sort-label
    {
        font-size: 18px;
        margin-bottom: 10px;
    }

    .filter-select-wrapper
    {
        max-width: 100%;
    }

    #top .filters-row-search
    {
        gap: 15px;
    }

    #top .filters-row-search .search-wrapper
    {
        max-width: 100%;
        width: 100%;
        flex: unset;
    }

    #top .filters-row-main
    {
        margin-bottom: 20px;
    }

    #top .filters-row-main .custom-dropdown
    {
        width: 33.33333%;
        max-width: unset;
        min-width: unset;
        flex: unset;
    }

    .sort-label
    {
        margin-left: 0;
        margin-top: 15px;
    }

    .sort-options
    {
        justify-content: space-around;
    }

    .grid-view .films-grid
    {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }

    .reset-button
    {
        width: 100%;
        margin-top: 10px;
    }

    .view-toggle
    {
        margin-left: 0 !important;
        margin-top: 0;
        width: 100%;
        justify-content: flex-start;
    }

    /* Calendar responsive */
    .calendar-day-header h3
    {
        font-size: 24px;
    }

    .calendar-film-item
    {
        width: 100%;
    }

    .calendar-film-time
    {
        min-width: 60px;
    }

    .calendar-film-title
    {
        font-size: 16px;
    }

    .calendar-film-meta
    {
        font-size: 12px;
    }
}

@media (max-width: 480px)
{

    .filters-row-main,
    .filters-row-search
    {
        flex-direction: column;
        align-items: stretch;
    }

    .grid-view .films-grid
    {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    #top .filters-row-main
    {
        margin-left: 0;
        margin-right: 0;
    }

    #top .filters-row-main .custom-dropdown
    {
        width: 100%;
        padding-left: 0;
        padding-right: 0;
    }

    .reset-button
    {
        margin: 10px 0 0;
    }

    #top .filters-row-search
    {
        row-gap: 0;
    }

    #top .view-toggle
    {
        margin-top: 20px;
        justify-content: center;
    }

    .filter-tags
    {
        gap: 8px;
    }

    .filter-tag
    {
        padding: 6px 10px;
        font-size: 12px;
    }

    .calendar-film-item
    {
        padding-bottom: 0;
    }
}

/* Pagination */
.pagination-wrapper .pagination-btn
{
    background-color: #000;
    color: #fff;
    padding: 8px 15px;
    border: none;
    border-radius: 0;
    cursor: pointer;
    transition: background-color 0.3s;
}

.pagination-wrapper .pagination-btn:hover
{
    background-color: #C30832;
}