/**
 * Flix Theme - Project Archive
 *
 * Styles for the projects archive page. Loaded on project archive pages.
 */

/* ================================
   Projects Archive
   ================================ */

/* Projects Header */
.projects-header {
    text-align: left;
}

.projects-header.section-padding{
    padding: 112px 0 80px 0;
}

.projects-header .page-title {
    font-family: var(--font-family);
    font-weight: 700;
    font-size: 48px;
    line-height: 120%;
    color: #000;
    margin-bottom: var(--spacing-sm);
    text-align: left;
}

.projects-header .section-description {
    text-align: left;
    font-family: var(--font-family);
    font-weight: 400;
    line-height: 150%;
    color: var(--gray-700);
}

/* Projects Toolbar */
.projects-toolbar.has-border-lines {
    overflow: visible;
}

.projects-toolbar__inner {
    display: flex;
    align-items: flex-end;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.projects-toolbar__search {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 560px;
    max-width: 100%;
}

.projects-toolbar__search-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
}

.projects-toolbar__search-input {
    width: 100%;
    height: 50px;
    padding: 9px 13px 9px 40px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    background: var(--base-white);
    font-size: 1rem;
    color: var(--gray-900);
    transition: border-color 0.2s;
}

.projects-toolbar__search-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--blue-100);
}

.projects-toolbar__filter-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    white-space: nowrap;
    height: 50px;
    margin-left: auto;
}

.projects-toolbar__filter-btn svg {
    width: 18px;
    height: 18px;
}

.projects-toolbar__sort {
    position: relative;
}

.projects-toolbar__sort-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    height: 50px;
    padding: 15px 24px;
    border: none;
    border-radius: 8px;
    font-family: var(--second-family);
    font-weight: 500;
    font-size: 16px;
    line-height: 150%;
    color: var(--gray-700);
    background: transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
}

.projects-toolbar__sort-toggle:hover {
    background: var(--gray-50);
    color: var(--gray-900);
    border-color: var(--gray-400);
}

.projects-toolbar__sort-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 240px;
    background: var(--base-white);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    box-shadow: 0 4px 6px -2px rgba(0, 0, 0, 0.05), 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    padding: 6px;
    list-style: none;
    margin: 0;
    z-index: 50;
}

.projects-toolbar__sort.open .projects-toolbar__sort-dropdown {
    display: block;
}

.projects-toolbar__sort-dropdown li {
    padding: 10px 14px;
    font-size: 0.9375rem;
    color: var(--gray-700);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.projects-toolbar__sort-dropdown li:hover {
    background: var(--gray-50);
    color: var(--gray-900);
}

.projects-toolbar__sort-dropdown li.active {
    background: var(--gray-100);
    color: var(--gray-900);
    font-weight: 500;
}

/* Active filter tags */
.projects-toolbar__active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: var(--spacing-sm);
}

.projects-toolbar__active-filters:empty {
    display: none;
}

.active-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    padding: 6px 12px 6px 14px;
    background: var(--gray-100);
    font-family: var(--second-family);
    font-weight: 400;
    font-size: 16px;
    line-height: 150%;
    color: #000;

    cursor: pointer;
    transition: background 0.2s;
}

.active-filter-tag:hover {
    background: var(--main-color-100);
}

.active-filter-tag__remove {
    font-size: 18px;
    line-height: 1;
}

.active-filter-tag--clear {
    background: var(--gray-100);
    color: var(--color-text-light);
    border-color: var(--color-border);
}

.active-filter-tag--clear:hover {
    background: var(--gray-200);
    color: var(--color-text);
}

.projects-grid-section{
    border-bottom: 1px solid var(--gray-200);
}

/* ================================
   Offcanvas Filters
   ================================ */

.offcanvas-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.offcanvas-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.offcanvas-filters {
    position: fixed;
    top: 0;
    left: 0;
    width: 600px;
    max-width: 90vw;
    height: 100vh;
    height: 100dvh;
    background: var(--base-white);
    z-index: 1051;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.offcanvas-filters.is-open {
    transform: translateX(0);
}

.offcanvas-filters__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md);
    padding-bottom: 48px;
}

.offcanvas-filters__title {
    font-family: var(--font-family);
    font-weight: 700;
    font-size: 48px;
    line-height: 120%;
    color: var(--gray-900);
    margin: 0;
}

.offcanvas-filters__close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    color: var(--color-text-light);
    transition: color 0.2s;
}

.offcanvas-filters__close:hover {
    color: var(--color-text);
}

.offcanvas-filters__body {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-md);
}

.offcanvas-filters__section {
    border-top: 1px solid var(--gray-300);
    padding: 24px 0;
    margin-bottom: 0;
}

.offcanvas-filters__section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.offcanvas-filters__section-title {
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 18px;
    line-height: 150%;
    color: #000;
    margin: 0;
}

/* Section reset button — 3 states */
.offcanvas-filters__section-reset {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: none;
    background: none;
    font-family: var(--font-family);
    font-weight: 500;
    font-size: 14px;
    line-height: 150%;
    color: #000;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
}

/* State 3 (disabled): refresh icon, opacity 0.5 */
.offcanvas-filters__section-reset[disabled] {
    cursor: default;
    opacity: 0.5;
}

.offcanvas-filters__section-reset .offcanvas-filters__reset-icon--clear {
    display: none;
}

.offcanvas-filters__section-reset .offcanvas-filters__reset-icon--refresh {
    display: block;
}

/* State 2 (active, has selections): refresh icon, full opacity */
.offcanvas-filters__section-reset:not([disabled]) {
    opacity: 1;
}

/* State 1 (hover on active): X icon, full opacity */
.offcanvas-filters__section-reset:not([disabled]):hover .offcanvas-filters__reset-icon--clear {
    display: block;
}

.offcanvas-filters__section-reset:not([disabled]):hover .offcanvas-filters__reset-icon--refresh {
    display: none;
}

/* Filter chips */
.offcanvas-filters__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 9px 17px;
    border: 1px solid var(--color-border-dark);
    border-radius: 8px;
    background: transparent;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    font-family: var(--second-family);
    font-weight: 500;
    font-size: 14px;
    line-height: 150%;
    color: var(--gray-700);
    cursor: pointer;
    transition: var(--transition);
}

.filter-chip:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.filter-chip:hover {
    background: var(--gray-50);
    color: var(--gray-900);
    border-color: var(--gray-400);
}

.filter-chip.is-active {
    background: var(--gray-900);
    border-color: var(--gray-900);
    color: var(--base-white);
}

/* Checkbox lists */
.offcanvas-filters__search {
    margin-bottom: 24px;
}

.offcanvas-filters__search-input {
    width: 100%;
    padding: 9px 13px 9px 40px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    background: var(--base-white);
    font-size: 1rem;
    color: var(--gray-900);
}

.offcanvas-filters__search-input::placeholder {
    font-family: var(--second-family);
    font-weight: 400;
    font-size: 16px;
    line-height: 150%;
    color: var(--gray-500);
}

.offcanvas-filters__search-input:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: -1px;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--blue-100);
}

.offcanvas-filters__checkbox-list {
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.offcanvas-filters__checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.25rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
}

.offcanvas-filters__checkbox:hover {
    background: var(--gray-50);
}

.offcanvas-filters__checkbox input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    background: var(--base-white);
    cursor: pointer;
    transition: var(--transition);
}

.offcanvas-filters__checkbox input[type="checkbox"]:checked {
    background: var(--color-primary);
    border-color: var(--color-primary);
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3E%3C/svg%3E");
    background-size: 12px;
    background-position: center;
    background-repeat: no-repeat;
}

.offcanvas-filters__checkbox-label {
    font-family: var(--font-family);
    font-weight: 500;
    font-size: 16px;
    line-height: 125%;
    color: var(--gray-700);
    flex: 1;
}

.offcanvas-filters__checkbox-count {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.offcanvas-filters__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    border-top: 1px solid var(--gray-300);
}

/* Resetează toate — same style as section reset but 16px */
.offcanvas-filters__reset-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: none;
    background: none;
    font-family: var(--font-family);
    font-weight: 500;
    font-size: 16px;
    line-height: 150%;
    color: #000;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.offcanvas-filters__reset-all[disabled] {
    cursor: default;
    opacity: 0.5;
}

.offcanvas-filters__reset-all .offcanvas-filters__reset-icon--clear {
    display: none;
}

.offcanvas-filters__reset-all .offcanvas-filters__reset-icon--refresh {
    display: block;
}

.offcanvas-filters__reset-all:not([disabled]) {
    opacity: 1;
}

.offcanvas-filters__reset-all:not([disabled]):hover .offcanvas-filters__reset-icon--clear {
    display: block;
}

.offcanvas-filters__reset-all:not([disabled]):hover .offcanvas-filters__reset-icon--refresh {
    display: none;
}


.project-arhive-reviews{
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

/* ================================
   Responsive
   ================================ */

@media (max-width: 768px) {
    .offcanvas-filters {
        top: 36px;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: 100%;
        height: calc(100dvh - 36px);
        border-radius: 16px 16px 0 0;
        transform: translateY(100%);
    }
	
	.offcanvas-filters__header{
		padding-top: 48px;
	}

    .offcanvas-filters.is-open {
        transform: translateY(0);
    }

    .projects-header.section-padding {
        padding: 48px 0 32px 0;
    }
    .projects-header .page-title {
        font-size: 32px;
    }
    .projects-toolbar__inner {
        flex-wrap: wrap;
    }
    .projects-toolbar__search {
        width: 100%;
    }
    .projects-toolbar__filter-btn {
        flex: 1;
    }
    .projects-toolbar__sort {
        flex: 1;
    }
    .projects-toolbar__sort-toggle {
        width: 100%;
        justify-content: space-between;
    }
    .projects-grid-section.section-padding {
        padding-top: 32px;
    }
	.offcanvas-filters__title{
		font-size: 32px;
	}
}

@media (max-width: 480px) {
    .projects-header .page-title {
        font-size: 32px;
    }
}
