/*     Modal       */

* {
    box-sizing: border-box;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: start;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 10000;
    overflow-y: auto;
    overflow-x: hidden;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(12px);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-overlay.centered {
    align-items: center;
}

@keyframes modalFadeInTop {
    from {
        opacity: 0;
        transform: translateY(-40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-window {
    box-shadow: 0 0 8px 1px rgb(0, 0, 0);
    padding: 1.2rem;
    margin-top: 5%;
    width: 100%;
    max-width: 600px;
    animation: modalFadeInTop 0.4s ease;
    display: flex;
    flex-direction: column;
    align-items: start;
    justify-content: center;
    color: white;
    background: var(--box-gradient-normal);
    border-radius: 6px;
    opacity: 1;
}

.modal-window.lg {
    max-width: 1000px;
}

.modal-window.block {
    display: block;
}

.modal-overlay.centered .modal-window {
    margin-top: 0;
}

.modal-overlay.success .modal-window {
    background: #000000;
    background: var(--gradient-success);
}

.modal-overlay.error .modal-window {
    background: #000000;
    background: var(--gradient-error);
}

.modal-window.scrollable {
    overflow-y: auto;
    overflow-x: hidden;
}

.modal-overlay.centered:has(.modal-window.scrollable) {
    align-items: start;
    padding: 5%;
}

.close-modal {
    margin: 0;
    padding: 0;
    background: none;
    border: none;
    color: white;
    font-size: 25px;
}

.close-modal:hover {
    color: black;
}

.modal-window p {
    font-size: 18px;
}

.modal-window .header {
    width: calc(100% + 2.4rem);
    margin-left: -1.2rem;
    margin-right: -1.2rem;
    margin-top: -1.2rem;
    padding: 0 1.2rem;
    display: flex;
    align-items: center;
    color: white;
    border-bottom: 2px solid var(--divider-color);
}

.modal-window .body {
    padding: 1rem;
    width: 100%;
}

.modal-window .footer {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: end;
    gap: 10px;
}

/*      Article     */

.card {
    margin: 0;
    box-sizing: border-box;
    width: 100%;
    height: calc(100% - 1.5rem);
    box-shadow: rgba(0, 0, 0, 0.2) 0px 2px 8px 0px;
    background-color: rgba(0, 0, 0, 0.35);
    margin-bottom: 1.5rem;
}

.card.success {
    background: var(--gradient-success);
}

.card.error {
    background: var(--gradient-error);
}

.card.active {
    background: var(--gradient-active);
}

/*   Card header   */
.card-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    height: calc(50px + 1.5rem);
    justify-content: space-between;
    font-size: 1.25rem;
    border-bottom: 1px solid var(--divider-color);
    padding: 0.75rem;
    box-sizing: border-box;
}

.card h3 {
    padding: 0;
    margin: 0;
    font-size: 1.25rem;
    display: flex;
    overflow-wrap: break-word;
    gap: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/*   Card Body   */

.card-body {
    padding: 1rem;
}

.card-body td {
    padding: 0;
    padding-top: 5px;
}

.card-body tr:first-child td {
    padding-top: 0;
}

/*   Footer   */

.card-footer {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    width: 100%;
    border-top: 2px solid var(--divider-color);
}

.card-footer a,
.card-footer button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    text-align: center;
    line-height: 35px;
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.9rem;
    background: transparent;
    border: none;
    border-radius: 0;
    border-left: 2px solid var(--divider-color);
    font-family: "Outfit", sans-serif;
    padding: 0;
}

.card-footer a.hover,
.card-footer button:hover{
    background-color: rgba(0, 0, 0, 0.2) !important;
}

.card-footer a:first-child,
.card-footer button:first-child {
    border-left: none;
}

.alert {
    box-sizing: border-box;
    width: 100%;
    padding: 1rem;
    font-size: 1.25rem;
    display: none;
    justify-content: space-between;
    align-items: center;
    border-radius: 10px;
    box-shadow: 0 0 8px 2px rgb(25, 25, 25);
}

.alert.active {
    display: flex;
}

.alert.success {
    background: var(--gradient-success);
}

.alert-close {
    font-size: 1.25rem;
}

.alert-close:hover {
    color: #333;
}


@media screen and (max-width: 992px) {
    .card-header {
        flex-direction: column;
    }

    .card-footer {
        display: block;

    }

    .card-footer a,
    .card-footer button {
        display: block;
        border-left: none;
    }

    .card-footer a:first-child,
    .card-footer button:first-child {
        border-bottom-left-radius: 0px;

    }

    .card-footer a:last-child,
    .card-footer button:last-child {
        border-bottom-right-radius: 10px;
        border-bottom-left-radius: 10px;
    }

    .modal-overlay.centered {
        align-items: start;
        padding: 5%;
    }
}

/*      Box       */

.box {
    background-color: rgba(0, 0, 0, 0.35);
    padding: 20px;
    box-shadow: rgba(0, 0, 0, 0.2) 0px 2px 8px 0px;
    border-radius: 5px;
    height: calc(100%);
}

.box h2 {
    margin: 0 0 20px 0;
    padding: 0;
    font-size: 1.2rem;
}

.box p {
    line-height: 1rem;
    margin: 0;
    margin-bottom: 10px;
}

.box h2.title {
    font-size: 1.3rem;
    margin-bottom: 5px;
}

.box hr,
.modal-window hr {
    background-color: var(--primary-color);
}