/**
 * Modal Utilities Styles - The Living Company Design System
 */

/* Modal Container */
#modal-container {
    font-family: 'Inter', -apple-system, sans-serif;
}

/* Backdrop */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 31, 22, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-backdrop.show {
    opacity: 1;
    visibility: visible;
}

/* Dialog */
.modal-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    z-index: 9999;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
}

.modal-dialog.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

/* Content */
.modal-content {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

/* Header */
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #eef2ea;
}

.modal-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a1f16;
    margin: 0;
}

.modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: #94a083;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f5f7f2;
    color: #525f46;
}

/* Body */
.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.modal-body p {
    color: #525f46;
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
}

/* Input */
.modal-input {
    width: 100%;
    padding: 12px 16px;
    margin-top: 16px;
    font-family: inherit;
    font-size: 1rem;
    color: #1a1f16;
    background: #f5f7f2;
    border: 2px solid #dde4d6;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.modal-input:focus {
    outline: none;
    border-color: #4a7c23;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(74, 124, 35, 0.1);
}

.modal-input::placeholder {
    color: #94a083;
}

/* Footer */
.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    background: #f5f7f2;
    border-top: 1px solid #eef2ea;
}

/* Buttons */
.modal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 500;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-btn-primary {
    background: #2d5016;
    color: #ffffff;
}

.modal-btn-primary:hover {
    background: #4a7c23;
}

.modal-btn-secondary {
    background: #ffffff;
    color: #525f46;
    border: 1px solid #dde4d6;
}

.modal-btn-secondary:hover {
    background: #eef2ea;
    border-color: #94a083;
}

.modal-btn-danger {
    background: #dc2626;
    color: #ffffff;
}

.modal-btn-danger:hover {
    background: #b91c1c;
}

/* Wide variant for modals with rich content */
.modal-dialog.modal-wide {
    max-width: 720px;
}

/* Responsive */
@media (max-width: 640px) {
    .modal-dialog {
        width: 95%;
        max-width: none;
    }

    .modal-header {
        padding: 16px 20px;
    }

    .modal-title {
        font-size: 1.25rem;
    }

    .modal-body {
        padding: 20px;
    }

    .modal-footer {
        padding: 12px 20px;
        flex-direction: column-reverse;
    }

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