/**
 * MLS Listings Display - Common Utilities CSS
 *
 * Styles for notifications, modals, and other shared components
 * Updated to use design system tokens
 *
 * @package MLS_Listings_Display
 * @since 3.3.0
 * @version 7.0.0
 */

/* Notification System */
.bme-notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999999;
    max-width: 400px;
}

.bme-notification {
    margin-bottom: var(--ds-space-2, 10px);
    border-radius: var(--ds-radius-md, 4px);
    box-shadow: var(--ds-shadow-md, 0 2px 8px rgba(0, 0, 0, 0.15));
    overflow: hidden;
    transition: all 0.3s ease;
}

.bme-notification-content {
    display: flex;
    align-items: center;
    padding: var(--ds-space-4, 15px) var(--ds-space-5, 20px);
    position: relative;
}

.bme-notification-message {
    flex: 1;
    padding-right: 30px;
    font-size: var(--ds-text-sm, 14px);
    line-height: 1.5;
}

.bme-notification-close {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
    padding: 5px;
}

.bme-notification-close:hover {
    opacity: 1;
}

/* Notification Types */
.bme-notification-success {
    background-color: #d1fae5;
    color: #065f46;
    border-left: 4px solid var(--ds-success, #10b981);
}

.bme-notification-error {
    background-color: #fee2e2;
    color: #991b1b;
    border-left: 4px solid var(--ds-red, #DC2626);
}

.bme-notification-warning {
    background-color: #fef3c7;
    color: #92400e;
    border-left: 4px solid var(--ds-warning, #f59e0b);
}

.bme-notification-info {
    background-color: #cffafe;
    color: #155e75;
    border-left: 4px solid var(--ds-teal, #0891B2);
}

/* Modal System */
.bme-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--ds-space-5, 20px);
}

.bme-modal {
    background-color: var(--ds-white, #fff);
    border-radius: var(--ds-radius-lg, 8px);
    box-shadow: var(--ds-shadow-xl, 0 4px 20px rgba(0, 0, 0, 0.15));
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Modal Sizes */
.bme-modal-small {
    width: 100%;
    max-width: 400px;
}

.bme-modal-medium {
    width: 100%;
    max-width: 600px;
}

.bme-modal-large {
    width: 100%;
    max-width: 900px;
}

/* Modal Header */
.bme-modal-header {
    padding: var(--ds-space-5, 20px);
    border-bottom: 1px solid var(--ds-border, #e5e7eb);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bme-modal-title {
    margin: 0;
    font-size: var(--ds-text-xl, 20px);
    font-weight: 600;
    color: var(--ds-text-primary, #000);
}

.bme-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: var(--ds-text-tertiary, #9ca3af);
    cursor: pointer;
    padding: 0;
    margin-left: auto;
    transition: color 0.2s;
}

.bme-modal-close:hover {
    color: var(--ds-text-primary, #000);
}

/* Modal Content */
.bme-modal-content {
    padding: var(--ds-space-5, 20px);
    overflow-y: auto;
    flex: 1;
}

/* Modal Footer */
.bme-modal-footer {
    padding: var(--ds-space-4, 15px) var(--ds-space-5, 20px);
    border-top: 1px solid var(--ds-border, #e5e7eb);
    display: flex;
    justify-content: flex-end;
    gap: var(--ds-space-2, 10px);
}

/* Common Button Styles */
.bme-btn {
    display: inline-block;
    padding: var(--ds-space-2, 8px) var(--ds-space-4, 16px);
    font-size: var(--ds-text-sm, 14px);
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    border: 1px solid transparent;
    border-radius: var(--ds-radius-md, 4px);
    transition: all 0.2s ease;
    text-decoration: none;
}

.bme-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.bme-btn-primary {
    color: var(--ds-white, #fff);
    background: linear-gradient(135deg, var(--ds-teal, #0891B2) 0%, var(--ds-teal-hover, #0E7490) 100%);
    border-color: var(--ds-teal, #0891B2);
}

.bme-btn-primary:hover:not(:disabled) {
    box-shadow: 0 4px 12px rgba(8, 145, 178, 0.3);
    transform: translateY(-1px);
}

.bme-btn-secondary {
    color: var(--ds-text-secondary, #374151);
    background-color: var(--ds-white, #fff);
    border-color: var(--ds-border, #e5e7eb);
}

.bme-btn-secondary:hover:not(:disabled) {
    background-color: var(--ds-surface-subtle, #f9fafb);
    border-color: var(--ds-border-strong, #d1d5db);
}

.bme-btn-danger {
    color: var(--ds-white, #fff);
    background-color: var(--ds-red, #DC2626);
    border-color: var(--ds-red, #DC2626);
}

.bme-btn-danger:hover:not(:disabled) {
    background-color: var(--ds-red-hover, #B91C1C);
    border-color: var(--ds-red-hover, #B91C1C);
}

/* Loading Spinner */
.bme-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--ds-border, #e5e7eb);
    border-radius: 50%;
    border-top-color: var(--ds-teal, #0891B2);
    animation: bme-spin 1s linear infinite;
}

@keyframes bme-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .bme-notification-container {
        left: 10px;
        right: 10px;
        max-width: none;
    }
    
    .bme-modal {
        margin: 10px;
    }
    
    .bme-modal-footer {
        flex-wrap: wrap;
    }
    
    .bme-modal-footer .bme-btn {
        flex: 1;
        min-width: 100px;
    }
}