.projects-page {
    background: #EBEBEB;
    width: 100vw;
}

.projects-container {
    max-width: 1424px;
    margin: 0 auto;
    padding: 49px 0 47px 0;
    box-sizing: border-box;
    min-height: calc(80vh);
}

.projects-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 33px 0;
}

.projects-title h1 {
    font-family: 'Jost';
    font-size: 32px;
    font-weight: 700;
}

.projects-title-add-button {
    gap: 10px;
    width: 320px;
    height: 70px;
}

/*! search box */

.search-box {
    display: flex;
    transition: margin 0.4s ease;
}

.search-box input {
    width: 359px;
    height: 57px;
    border: none;
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
    outline: none;
    font-family: 'Montserrat';
    font-weight: 300;
    font-size: 14px;
    padding-left: 12px;
    box-sizing: border-box;
    line-height: 1.2;
    background: #f5f5f5;
    transition: box-shadow 0.4s ease, background 0.4s ease;
    position: relative;
}

.search-box-submit-button,
.search-box-filter-button {
    width: 45px;
    height: 57px;
    background-color: #10069F;
    border: none;
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
    fill: #FFF;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
    box-sizing: border-box;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    transition: transform 0.2s ease;
}

.search-box-filter-button {
    border-radius: 0;
}

.search-box input:focus {
    background: #ffffff;
    box-shadow: 0 0 8px rgba(16, 6, 159, 0.4);
}

.search-box input::placeholder {
    color: #aaa;
    transition: color 0.3s ease, transform 0.3s ease;
}

.search-box input:focus::placeholder {
    color: #10069F;
    transform: translateX(10px);
}

.search-box-submit-button:hover,
.search-box-filter-button:hover {
    background: linear-gradient(135deg, #10069F, #3b3fa5);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(16, 6, 159, 0.4);
}

.search-box-submit-button svg,
.search-box-filter-button svg {
    transition: transform 0.3s ease;
}

.search-box-submit-button:hover svg,
.search-box-filter-button:hover svg {
    transform: scale(1.05);
}

.search-box-submit-button:active,
.search-box-filter-button:active {
    transform: scale(1);
}

/*! cards */

.projects-list {
    display: flex;
    flex-wrap: wrap;
    gap: 48px;
    margin: 0 0 47px 0;
}

.projects-list-item {
    background-color: #151515;
    width: 320px;
    min-height: 420px;
    display: flex;
    justify-content: center;
    align-items: end;
    padding-bottom: 35px;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    transition:
        transform 0.3s ease,
        background-color 0.3s ease,
        /* фон */
        box-shadow 0.3s ease,
        /* тень */
        color 0.3s ease;
    /* текст */
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
}

.projects-list-item a {
    text-decoration: none;
    color: #CCC;
    font-weight: 500;
}

/* 2. Лёгкая подсветка фона + тень */
.projects-list-item:hover {
    background-color: #222;
    /* чуть светлее #151515 */
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    /* “приподнимаем” карточку тенями */
    cursor: pointer;
}

.projects-list-item:hover a {
    color: #4b35ff;
}

/* 4. Анимированная «underline» под текстом */
.projects-list-item::after {
    content: '';
    position: absolute;
    bottom: 10px;
    left: 50%;
    width: 0;
    height: 3px;
    background: #4b35ff;
    transition: width 0.3s ease, left 0.3s ease;
}

.projects-list-item:hover::after {
    width: 60%;
    left: 20%;
}

/* Лёгкий градиент-оверлей */
.projects-list-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(75, 53, 255, 0.2), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.projects-list-item:hover::before {
    opacity: 1;
}

.projects-list-item:active {
    transform: scale(0.95);
}

/*! pagging */

.pagging {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: 'Montserrat';
    width: 50%;
}

.pagging-numbers {
    display: flex;
    gap: 30px;
    align-items: center;
    justify-items: center;
    width: 50%;
}

.pagging-numbers-item {
    font-size: 24px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    background: none;
}

.pagging-numbers-item-active {
    background: #10069F;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    color: #FFF;
}

.pagging-sliders {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 50%;
    box-sizing: border-box;
}

.pagging-sliders button {
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    font-size: 24px;
    font-weight: 500;
    gap: 5px;
    background: none;
}

.pagging-sliders svg {
    fill: #000;
}

.pagging-sliders-deactive {
    opacity: 0.5;
}

.pagging-numbers-item,
.pagging-sliders-item {
    transition:
        background-color 0.2s ease-in-out,
        color 0.2s ease-in-out,
        transform 0.15s ease;
}

.pagging-sliders-item:hover,
.pagging-numbers-item:hover {
    transform: scale(1.05);
}

.pagging-sliders-item:active,
.pagging-numbers-item:active {
    transform: scale(1);
}



@media(max-width: 1500px) {
    .projects-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        justify-self: center;
    }

    .projects-title {
        padding: 0px 25px;
    }

    .pagging {
        justify-self: center;

    }

    .pagging-numbers {
        width: 60%;
    }

    .pagging-sliders {
        width: 40%;
    }

}

@media(max-width: 700px) {
    .projects-list {
        grid-template-columns: repeat(1, 1fr);
    }

    .projects-title {
        flex-direction: column;
        gap: 10px;
    }

    .search-box {
        box-sizing: border-box;
        padding: 10px;
    }

    .search-box input {
        width: 65vw;
    }

    .pagging {
        width: 95%;
        padding: 0px 10px;
    }

    .pagging-numbers {
        justify-content: center;
        font-size: 16px;
        width: 80%;

    }

    .pagging-sliders p {
        display: none;
    }

    .pagging-sliders {
        width: 25%;
        justify-content: left;
    }
}


/*! POPUP */

.popup {
    position: fixed;
    inset: 0;
    z-index: 3;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(0.5rem, 2vw, 2rem);
    /* отступы вокруг контейнера */
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(14px, 1.8vw, 17px);
    /* флюидный размер текста */
    font-weight: 300;
}

.popup-close {
    display: none;
}

.popup-wrp {
    background-color: #f5f5f5;
    border-radius: clamp(0.5rem, 1vw, 1rem);
    width: clamp(320px, 65vw, 600px);
    height: auto;
    max-height: clamp(400px, 90vh, 900px);
    box-sizing: border-box;
    padding: clamp(1rem, 3vw, 2rem) clamp(1.25rem, 4vw, 2rem) clamp(0.75rem, 2.5vw, 1.5rem);
    overflow-y: auto;
    /* позволяет скроллить, если контент выше max-height */
    box-shadow: 0 0 clamp(1rem, 2vw, 2rem) rgba(0, 0, 0, 0.3);
    transition: opacity .3s ease, transform .3s ease;
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Jost', sans-serif;
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    margin-bottom: clamp(1.5rem, 4vh, 3rem);
}

.popup__close-btn {
    border: none;
    background-color: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 0;
}

.popup__close-btn svg {
    width: clamp(1.5rem, 3vw, 2rem);
    height: auto;
    fill: #10069F;
}

.popup__form {
    display: flex;
    flex-direction: column;
    gap: clamp(0.75rem, 2vh, 1.5rem);
}

.form-row {
    display: flex;
    gap: clamp(0.5rem, 1.5vw, 1rem);
    align-items: center;
}

.form-row:not(.form-row-description) .form-row__label {
    flex: 0 0 clamp(80px, 20vw, 150px);
}

input[type='file'] {
    font-family: inherit;
    font-size: 1rem;
    color: #333;
}

input[type='file']::file-selector-button {
    padding: clamp(0.4em, 1vw, 0.8em) clamp(0.8em, 2vw, 1.2em);
    margin-right: clamp(0.5em, 1vw, 1em);
    border: none;
    background-color: #0044cc;
    color: white;
    cursor: pointer;
    border-radius: 0.25em;
    font-size: 0.9rem;
}

.popup input[type="text"],
.popup input[type="url"] {
    width: 100%;
    height: clamp(2rem, 4vh, 3rem);
    border: none;
    border-radius: clamp(0.25rem, 1vw, 0.5rem);
    font-weight: 300;
    font-size: clamp(0.875rem, 1.5vw, 1rem);
    padding-left: clamp(0.75rem, 2vw, 1rem);
    box-sizing: border-box;
    line-height: 1.2;
    background-color: #FFF;
    transition: box-shadow 0.4s ease, background 0.4s ease;
    outline: none;
}

.popup input:focus {
    box-shadow: 0 0 clamp(0.5rem, 1vw, 1rem) rgba(16, 6, 159, 0.4);
}

.form-row-description {
    display: flex;
    flex-direction: column;
    gap: clamp(0.5rem, 1.5vh, 1rem);
}

.form-row__textarea {
    resize: none;
    border: none;
    border-radius: clamp(0.5rem, 1vw, 0.75rem);
    width: 100%;
    height: clamp(8rem, 30vh, 12rem);
    font-weight: 400;
    font-size: clamp(0.75rem, 1.2vw, 0.875rem);
    padding: clamp(1rem, 2.5vw, 1.25rem) clamp(1rem, 2.5vw, 1.25rem);
    box-sizing: border-box;
    line-height: 1.4;
    transition: box-shadow 0.4s ease;
    outline: none;
    background: #FFF;
}

.form-row__textarea:focus {
    box-shadow: 0 0 clamp(0.5rem, 1vw, 1rem) rgba(16, 6, 159, 0.4);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: clamp(1rem, 3vh, 2rem);
}

.form-actions__submit {
    padding: clamp(0.75rem, 1.5vw, 1rem) clamp(1.25rem, 3vw, 2rem);
    font-size: clamp(0.875rem, 1.5vw, 1rem);
    border: none;
    border-radius: clamp(0.5rem, 1vw, 0.75rem);
    cursor: pointer;
    transition: transform .2s ease;
}

.form-actions__submit:hover {
    transform: translateY(-2px);
}

.file-upload {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
}

.file-upload__input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.file-upload__btn {
  padding: 0.5em 1em;
  border-radius: 4px;
  cursor: pointer;
  background: linear-gradient(90deg, #4b35ff, #10069f);
    border: none;
    border-radius: 8px;
    color: #FFF;
    box-shadow: 0 8px 16px rgba(16, 6, 159, 0.2);
}

.file-upload__name {
  font-size: 0.9em;
  color: #333;
}

.file-upload__btn:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 12px rgba(16, 6, 159, 0.3);
    opacity: 0.95;
}

.file-upload__btn:active {
    transform: scale(0.98);
    box-shadow: 0 6px 12px rgba(16, 6, 159, 0.15);
}