.custom-select {
    position: relative;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 100px;
    justify-content: center;
}

.select-box,
#textInput {
    font-weight: 500 !important;
    font-size: 16px !important;
    width: 60%;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 3.2rem;
    padding: 0.5rem 1rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.select-box {
    cursor: pointer;
}

.select-box:hover,
#textInput:hover {
    border-color: var(--theme-color);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.selected-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    display: inline-flex;
    font-size: smaller;
    background-color: var(--theme-color2);
    color: #ffffff;
    border-radius: 35px;
    padding: 2px 8px;
    align-items: center;
    white-space: nowrap;
    transition: background-color 0.2s ease;
}

.tag:hover {
    background-color: var(--theme-color);
}

.remove-tag {
    background-color: transparent;
    margin-left: 8px;
    font-weight: bold;
    font-size: large;
    color: #b5b5b5;
    cursor: pointer;
    border: none;
}

.arrow {
    margin-left: 1rem;
    font-size: 1.25rem;
    color: #adb5bd;
}

.options {
    font-size: smaller;
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    width: 60%;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 0.75rem;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.05);
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    padding: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.open .options {
    display: flex;
}

.option-search-tags {
    position: relative;
}

.search-tags {
    height: 3.2rem;
    margin: 0 5px;
    width: 100%;
    border: none;
    border-radius: 25px;
    padding: 0.5rem;
    outline: none;
}

.clear {
    position: absolute;
    top: 50%;
    right: 1.25rem;
    transform: translateY(-50%);
    background-color: transparent;
    border: none;
    color: #b5b5b5;
    font-size: 16px;
    cursor: pointer;
}

.clear:hover {
    color: #454545;
}

.option {
    border: none;
    margin-top: 10px;
    padding: 2px 8px;
    background-color: var(--theme-color);
    color: #ffffff;
    border-radius: 35px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.option:hover {
    background-color: var(--theme-color2);
}

.option.active {
    background-color: var(--theme-color2);
    display: none !important;
}

.btn-submit {
    position: absolute;
    height: 3.2rem;
    width: 3.2rem;
    left: calc(80% + 0.75rem);
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--theme-color);
    color: #fff;
    font-weight: 500;
    border: none;
    border-radius: 50%;
    flex-shrink: 0;
    transition: transform 1.5s ease-in-out;
    z-index: 10;
}

.btn-submit.move-left {
    transform: rotate(360deg);
}

.btn-submit:hover {
    background-color: var(--theme-color2);
}

@keyframes bg {
    0% {
        opacity: 0;
    }

    50% {
        opacity: 0.2;
    }

    100% {
        opacity: 1;
    }
    from {
        background-color: rgba(7, 141, 132, 0.25);
    }
    to {
        background-color: #ffffff;
    }
}

.animate-bg {
    animation: bg 2s ease-out;
}

#submitBtn {
    color: #a1a1a1;
    background-color: transparent;
    left: calc(80% - 3.4rem);
}

.bg {
    background-color: rgba(177, 251, 246, 0.25) !important;
}

.counter {
    font-size: smaller;
    border-radius: 35px;
    padding: 2px 8px;
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    color: var(--theme-color2);
    border: 1px solid var(--theme-color2);
    background-color: #FFFFFF;
}

.counter:hover {
    background-color: var(--theme-color2);
    color: #ffffff;
}

#selectAll {
    color: var(--theme-color);
    border: 1px solid var(--theme-color);
    background-color: #ffffff;
}

#selectAll:hover {
    background-color: var(--theme-color);
    color: #ffffff;
}

.tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--title-color);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 10px;
    white-space: normal;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 9999999;
    margin-bottom: 5px;
    max-width: 90vw;
    flex-direction: column;
    width: max-content;
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--title-color);
}

.summary-card:hover .tooltip {
    opacity: 1;
    visibility: visible;
    font-size: medium;
}

.counter:hover .tooltip {
    opacity: 1;
    visibility: visible;
}

.preview {
    position: absolute;
    display: inline-block;
    max-width: 400px;
    width: max-content;
    top: calc(100% + 10px);
    left: -500%;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.preview-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: flex-start;
}

#clearAll {
    color: #a1a1a1;
    background-color: transparent;
    left: calc(80% - 5rem);
    padding: 0;
    margin: 0;
    width: 2.5rem;
}

#clearAll .icon-solid {
    display: none;
}

#clearAll:hover .icon-regular {
    display: none;
}

#clearAll:hover .icon-solid {
    display: inline;
    color: #e01e37;
}

.title-area {
    z-index: 0 !important;
}

.summary-detail-row {
    border-bottom: 1px solid black;
}

@media (max-width: 767px) {
    .select-box,
    #textInput{
        width: 80% !important;
        margin-left: 5px !important;
        margin-right: auto !important;
    }
    .options{
        width: 100% !important;
    }

    #searchBtn {
        right: 0;
        top: 0;
    }

    #submitBtn,
    #clearAll{
        right: 0;
        transform: translateX(10%);
    }

    .preview {
        max-width: 250px;
        left: 50% !important;
        transform: translateX(-50%) !important;
    }

    #cardDetails .row {
        flex-direction: column-reverse;
        text-align: center;
    }

    #cardDetails .title-area {
        margin-top: 1rem;
    }

    #summaryTags {
        justify-content: center;
    }

    #authorAvatar {
        border-bottom: 1px solid black;
        width: 100% !important;
        max-width: 250px;
        margin: 0 auto;
    }

    .author-info {
        justify-content: center;
        align-items: center;
        text-align: center;
    }

    #summaryDescription {
        padding: 0 1rem;
    }

    .summary-detail-row {
        border-bottom: none;
    }
}

@media (min-width: 767px) and (max-width: 991px) {
    #cardDetails .row {
        flex-direction: column-reverse;
        text-align: center;
    }

    #cardDetails .col-xl-6 {
        width: 100%;
    }

    #authorAvatar {
        border-bottom: 1px solid black;
        max-width: 300px;
        width: 100%;
        margin: 0 auto 1rem auto;
        display: block;
    }

    #cardDetails .title-area {
        margin-top: 1rem;
    }

    #summaryTitle {
        font-size: 1.5rem;
    }

    #summaryDescription {
        padding: 0 1rem;
        font-size: 1rem;
    }

    #summaryTags {
        justify-content: center;
        gap: 0.5rem;
    }

    .author-info {
        justify-content: center;
        align-items: center;
        gap: 0.5rem;
        margin-top: 1rem;
        text-align: center;
    }

    .author-info span {
        font-size: 0.9rem;
    }

    .summary-detail-row {
        border-bottom: none;
    }
}
