﻿.ant-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

    .ant-modal-overlay.ant-modal-visible {
        opacity: 1;
        display: flex;
    }

/* Position styles */
.ant-modal-position-center {
    margin: auto;
}

.ant-modal-position-top {
    margin: 1rem auto auto auto;
}

.ant-modal-wrapper {
    position: relative;
    background-color: var(--background-lighter);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-height: calc(100vh - 2rem);
    display: flex;
    flex-direction: column;
    animation: antModalSlideIn 0.3s ease-out;
}

.ant-modal-size-sm {
    max-width: 300px;
}

.ant-modal-size-md {
    max-width: 500px;
}

.ant-modal-size-lg {
    max-width: 800px;
}

.ant-modal-size-full {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    margin: 0;
    border-radius: 0;
}

.ant-modal-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: var(--background-lighter);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: inherit;
}

.ant-modal-size-full .ant-modal-container {
    border: none;
}

.ant-modal-header {
    display: flex;
    align-items: center;
    padding: .5em;
    background-color: var(--panel-header);
    border-bottom: 1px solid var(--border-color);
    padding-top: .15em;
    padding-bottom: .15em;
}

.ant-modal-header-icon {
    margin-right: 0.75rem;
    color: var(--primary-color);
}

.ant-modal-header-title {
    flex: 1;
    margin: 0;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ant-modal-close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.2s ease;
    margin-left: 0.5rem;
}

    .ant-modal-close-btn:hover {
        color: var(--text-primary);
    }

.ant-modal-body {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
}

.ant-modal-footer {
    display: flex;
    justify-content: flex-end;
    background-color: var(--panel-header);
    border-top: 1px solid var(--border-color);
    gap: 0.5rem;
}

@keyframes antModalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .ant-modal-wrapper:not(.ant-modal-size-full) {
        margin: 0.5rem;
        max-height: calc(100vh - 1rem);
    }

    .ant-modal-size-sm,
    .ant-modal-size-md,
    .ant-modal-size-lg {
        max-width: calc(100vw - 1rem);
    }
}
