.modal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;

    &.modal-active {
        opacity: 1;
        pointer-events: all;
    }
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal {
    background-image: url('../../images/hotel/modal.jpg');
    background-size: cover;
    background-position: top left;
    color: var(--basecolor);
    border: 1px solid var(--basecolor);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    max-width: min(90vw, 600px);
    max-height: 90vh;
    width: 100%;
    overflow: hidden;
    transform: scale(0.8) translateY(20px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);

    &.modal-visible {
        transform: scale(1) translateY(0);
        opacity: 1;
    }

    .modal-close {
        position: absolute;
        top: 10px;
        right: 10px;
        width: 30px;
        height: 30px;
        border: 1px solid var(--basecolor);
        background: rgba(255, 255, 255, 0.1);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--basecolor-light);
        transition: all 0.2s ease;
        z-index: 10;

        &:hover {
            background: rgba(255, 255, 255, 0.2);
            color: #e3e3e3;
            transform: scale(1.1);
        }

        &:active {
            transform: scale(0.95);
        }

        svg {
            width: 20px;
            height: 20px;
        }
    }

    .modal-content {
        padding: 40px 24px 24px;
        overflow-y: auto;
        max-height: calc(90vh - 80px);
    }
}

.journal-character {
    width: 200px;
    float: left;
    margin-right: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--basecolor);
}

@media (max-width: 768px) {
    .modal {
        max-width: 95vw;
        max-height: 95vh;
        margin: 10px;

        .modal-content {
            padding: 32px 16px 16px;
            max-height: calc(95vh - 64px);
        }

        .modal-close {
            top: 12px;
            right: 12px;
            width: 36px;
            height: 36px;

            svg {
                width: 18px;
                height: 18px;
            }
        }
    }
    .modal-backdrop {
        padding: 0;
    }
}

.modal {
    &.modal-slide-top {
        transform: translateY(-100%) scale(0.8);
        opacity: 0;

        &.modal-visible {
            transform: translateY(0) scale(1);
            opacity: 1;
        }
    }

    &.modal-slide-bottom {
        transform: translateY(100%) scale(0.8);
        opacity: 0;

        &.modal-visible {
            transform: translateY(0) scale(1);
            opacity: 1;
        }
    }

    &.modal-slide-left {
        transform: translateX(-100%) scale(0.8);
        opacity: 0;

        &.modal-visible {
            transform: translateX(0) scale(1);
            opacity: 1;
        }
    }

    &.modal-slide-right {
        transform: translateX(100%) scale(0.8);
        opacity: 0;

        &.modal-visible {
            transform: translateX(0) scale(1);
            opacity: 1;
        }
    }

    &.modal-fade {
        transform: scale(1);
        opacity: 0;

        &.modal-visible {
            opacity: 1;
        }
    }
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--basecolor);
}

.form-group {
    margin-bottom: 1rem;

    label {
        display: block;
        margin-bottom: 0.5rem;
        font-weight: 500;
        color: var(--basecolor);
    }

    input[type="text"],
    input[type="email"],
    input[type="password"],
    select,
    textarea {
        width: 100%;
        padding: 0.75rem;
        border: 1px solid #555;
        border-radius: 6px;
        font-size: 1rem;
        background: #3a3a3a;
        color: #eaeaea;
        transition: border-color 0.2s ease, box-shadow 0.2s ease;

        &:focus {
            outline: none;
            border-color: #3e3e3e;
            box-shadow: 0 0 0 3px rgba(74, 74, 74, 0.1);
        }
    }

    input[type="checkbox"] {
        margin-right: 0.5rem;
    }

    &.checkbox-group {
        display: flex;
        align-items: center;
        margin-bottom: 1rem;

        label {
            margin-bottom: 0;
            cursor: pointer;
        }
    }
}

.modal-subtitle {
    font-size: 1rem;
    color: var(--basecolor-light);
    margin-bottom: 1.5rem;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #444;

    .btn {
        padding: 8px 16px;
        border: none;
        border-radius: 6px;
        cursor: pointer;
        font-size: 14px;
        font-weight: 500;
        transition: all 0.2s ease;
    }
}
