/* Modal Overlay */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2050;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-out, visibility 0.3s ease-out;
}

.custom-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.custom-modal {
    background: var(--bg-card, #fff);
    width: 90%;
    max-width: 480px;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transform: scale(0.3);
    transition: transform 0.3s ease-out;
    text-align: center;
    position: relative;
}

.custom-modal-overlay.active .custom-modal {
    transform: scale(1);
}

.custom-modal-header { margin-bottom: 16px; }

.custom-modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main, #333);
    margin: 0;
}

.custom-modal-body {
    margin-bottom: 24px;
    color: var(--text-secondary, #666);
    font-size: 0.95rem;
    line-height: 1.5;
}

.custom-modal-footer {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.custom-modal-btn {
    padding: 8px 22px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    outline: none;
}

.custom-modal-btn-confirm {
    background: var(--color-primary, #8D5032);
    color: #fff;
}

.custom-modal-btn-confirm:hover {
    filter: brightness(1.1);
}

.custom-modal-btn-cancel {
    background: transparent;
    border: 1px solid var(--color-border, rgba(0,0,0,0.15));
    color: var(--text-secondary, #666);
}

.custom-modal-btn-cancel.is-hidden {
    display: none;
}

.custom-modal-btn-cancel:hover {
    background: rgba(0,0,0,0.05);
}

html.dark .custom-modal {
    background: #1f1f1f;
    color: #fff;
}

html.dark .custom-modal-title { color: #fff; }
html.dark .custom-modal-body  { color: #aaa; }
