/**
 * MLS Saved Searches Frontend Styles
 * Updated to use design system tokens
 *
 * @version 7.0.0
 */

/* Container */
.mld-saved-searches,
.mld-saved-properties {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--ds-space-5, 20px);
}

/* Header */
.mld-saved-searches-header,
.mld-saved-properties-header {
    margin-bottom: 30px;
    text-align: center;
}

.mld-saved-searches-header h2,
.mld-saved-properties-header h2 {
    margin-bottom: 10px;
    font-size: var(--ds-text-3xl, 28px);
    color: var(--ds-text-primary, #000);
}

.mld-description {
    color: #666;
    font-size: 16px;
}

/* Loading State */
.mld-loading {
    text-align: center;
    padding: 40px 0;
}

.mld-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid var(--ds-border, #e5e7eb);
    border-top: 4px solid var(--ds-teal, #0891B2);
    border-radius: 50%;
    animation: mld-spin 1s linear infinite;
    margin-bottom: var(--ds-space-4, 15px);
}

@keyframes mld-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* No Results */
.mld-no-searches,
.mld-no-properties {
    text-align: center;
    padding: 60px 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.mld-no-searches p,
.mld-no-properties p {
    margin-bottom: 15px;
    font-size: 16px;
    color: #666;
}

/* Search Cards */
.mld-searches-list {
    display: grid;
    gap: 20px;
}

.mld-search-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s;
}

.mld-search-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.mld-search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.mld-search-header h3 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.mld-search-status {
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.mld-search-status.active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--ds-success, #10b981);
}

.mld-search-status.inactive {
    background: rgba(220, 38, 38, 0.1);
    color: var(--ds-red, #DC2626);
}

.mld-search-details {
    margin-bottom: 20px;
}

.mld-search-filters {
    margin-bottom: 10px;
    color: #555;
    line-height: 1.5;
}

.mld-search-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 14px;
    color: #666;
}

.mld-search-meta span {
    display: inline-block;
}

.mld-search-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Buttons */
.mld-button {
    display: inline-block;
    padding: 10px 20px;
    background: #f0f0f0;
    color: #333;
    text-decoration: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.mld-button:hover {
    background: #e5e5e5;
    color: #333;
}

.mld-button-primary {
    background: var(--ds-teal, #0891B2);
    color: var(--ds-white, white);
    border-color: var(--ds-teal, #0891B2);
}

.mld-button-primary:hover {
    background: var(--ds-teal-hover, #0E7490);
    color: var(--ds-white, white);
    border-color: var(--ds-teal-hover, #0E7490);
}

.mld-button-danger {
    background: var(--ds-red, #DC2626);
    color: var(--ds-white, white);
    border-color: var(--ds-red, #DC2626);
}

.mld-button-danger:hover {
    background: var(--ds-red-hover, #B91C1C);
    color: var(--ds-white, white);
    border-color: var(--ds-red-hover, #B91C1C);
}

.mld-button-secondary {
    background: white;
    color: #666;
    border-color: #ddd;
}

.mld-button-secondary:hover {
    background: #f5f5f5;
    color: #333;
}

.mld-button-small {
    padding: 6px 12px;
    font-size: 13px;
}

.mld-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Modal */
.mld-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.mld-modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.mld-modal-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mld-modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.mld-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mld-modal-close:hover {
    color: #333;
}

.mld-modal-body {
    padding: 20px;
}

.mld-modal-footer {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Form */
.mld-form-group {
    margin-bottom: 20px;
}

.mld-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.mld-form-group input[type="text"],
.mld-form-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.mld-form-group input[type="checkbox"] {
    margin-right: 8px;
}

.mld-help-text {
    margin-top: 5px;
    font-size: 13px;
    color: #666;
}

/* Notifications */
.mld-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 4px;
    font-size: 14px;
    z-index: 1001;
    display: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.mld-notification-success {
    background: rgba(16, 185, 129, 0.1);
    color: #065f46;
    border: 1px solid var(--ds-success, #10b981);
}

.mld-notification-error {
    background: rgba(220, 38, 38, 0.1);
    color: #991b1b;
    border: 1px solid var(--ds-red, #DC2626);
}

/* Login Required */
.mld-login-required {
    text-align: center;
    padding: 60px 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.mld-login-required p {
    margin-bottom: 20px;
    font-size: 16px;
    color: #666;
}

/* Properties Grid */
.mld-properties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* Property Card */
.mld-property-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s;
}

.mld-property-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.mld-property-image {
    position: relative;
    padding-top: 66.67%; /* 3:2 aspect ratio */
    overflow: hidden;
    background: #f5f5f5;
}

.mld-property-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mld-property-price {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 18px;
    font-weight: 600;
}

.mld-property-details {
    padding: 15px;
}

.mld-property-address {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #333;
    font-weight: 500;
    line-height: 1.3;
}

.mld-property-stats {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 14px;
    color: #666;
}

.mld-property-stats span {
    display: inline-block;
}

.mld-property-actions {
    display: flex;
    gap: 10px;
}

.mld-property-actions .mld-button {
    flex: 1;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .mld-saved-searches,
    .mld-saved-properties {
        padding: 15px;
    }
    
    .mld-search-meta {
        flex-direction: column;
        gap: 5px;
    }
    
    .mld-search-actions {
        flex-direction: column;
    }
    
    .mld-button-small {
        width: 100%;
        text-align: center;
    }
    
    .mld-modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .mld-properties-grid {
        grid-template-columns: 1fr;
    }
}