/**
 * Modal Component Styles
 * Graf & Asociados - Cap Rate Calculator
 */

/* Modal overlay - full screen backdrop */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--graf-overlay-bg, rgba(0, 0, 0, 0.5));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.modal-overlay.modal-show {
    opacity: 1;
}

.modal-overlay.modal-closing {
    opacity: 0;
}

/* Modal content container */
.modal-content {
    background: var(--graf-white, #ffffff);
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: auto;
    transform: scale(0.9);
    transition: transform 0.2s ease;
}

.modal-show .modal-content {
    transform: scale(1);
}

.modal-closing .modal-content {
    transform: scale(0.9);
}

/* Modal header */
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--graf-border, #dee2e6);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--graf-body-color, #1a1a1a);
}

.modal-close {
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    color: var(--graf-text-secondary, #666);
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--graf-body-color, #1a1a1a);
}

.modal-close .material-symbols-outlined {
    font-size: 24px;
}

/* Modal body */
.modal-body {
    padding: 1.5rem;
}

.modal-body p {
    margin: 0;
    line-height: 1.6;
    color: var(--graf-body-color, #1a1a1a);
}

/* Modal footer */
.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--graf-border, #dee2e6);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Modal buttons */
.modal-btn {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 4px;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.modal-btn:focus {
    outline: 2px solid var(--graf-primary, #007bff);
    outline-offset: 2px;
}

.modal-btn-secondary {
    background: var(--graf-warm-100, #f8f9fa);
    color: var(--graf-body-color, #1a1a1a);
    border: 1px solid var(--graf-border, #dee2e6);
}

.modal-btn-secondary:hover {
    background: var(--graf-border, #dee2e6);
}

.modal-btn-danger {
    background: var(--graf-danger, #dc3545);
    color: var(--graf-white, #ffffff);
}

.modal-btn-danger:hover {
    background: var(--graf-danger-dark, #c82333);
}

.modal-btn-primary {
    background: var(--graf-primary, #007bff);
    color: var(--graf-white, #ffffff);
}

.modal-btn-primary:hover {
    background: var(--graf-primary-dark, #0056b3);
}

/* Responsive */
@media (max-width: 640px) {
    .modal-content {
        width: 95%;
        margin: 1rem;
    }

    .modal-header {
        padding: 1rem;
    }

    .modal-body {
        padding: 1rem;
    }

    .modal-footer {
        padding: 0.75rem 1rem;
        flex-direction: column-reverse;
    }

    .modal-btn {
        width: 100%;
    }
}

/* Accessibility - prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
}
