/**
 * MLD Saved Searches Frontend Styles
 * 
 * @package MLS_Listings_Display
 * @since 3.2.0
 */

/* Save Search Button */
#bme-save-search-btn {
    margin-left: 10px;
    background-color: #28a745;
    border-color: #28a745;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

#bme-save-search-btn:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

#bme-save-search-btn .bme-icon-save {
    font-size: 16px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

/* Mobile specific for save button */
@media (max-width: 768px) {
    #bme-save-search-btn {
        padding: 8px 12px;
        font-size: 14px;
    }

    #bme-save-search-btn span:not(.bme-icon-save) {
        display: none; /* Hide text on mobile, show only icon */
    }

    #bme-save-search-btn .bme-icon-save {
        font-size: 18px;
        margin: 0;
    }
}

/* Modal Overlay */
.bme-modal-overlay {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 99999;
    animation: fadeIn 0.3s ease;
}

/* Modal Content */
.bme-modal-content {
    position: relative;
    background-color: #fff;
    margin: 40px auto;
    padding: 0;
    width: 90%;
    max-width: 540px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.bme-modal-modern {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Modal Header */
.bme-modal-header {
    padding: 24px 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-bottom: none;
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.bme-modal-header-content {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    color: white;
}

.bme-modal-icon {
    font-size: 28px;
    margin-top: 2px;
    opacity: 0.95;
}

.bme-modal-header h3 {
    margin: 0 0 4px 0;
    font-size: 24px;
    font-weight: 600;
    color: white;
}

.bme-modal-subtitle {
    margin: 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 400;
}

.bme-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.bme-modal-close span {
    font-size: 20px;
    line-height: 1;
    display: block;
}

.bme-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Modal Body */
.bme-modal-body {
    padding: 28px;
}

/* Form Elements */
.bme-form-group {
    margin-bottom: 24px;
}

.bme-form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 15px;
    color: #2d3748;
}

.bme-form-group label .bme-icon {
    color: #667eea;
    font-size: 16px;
}

.bme-required {
    color: #e53e3e;
    font-size: 13px;
}

.bme-optional {
    color: #718096;
    font-size: 13px;
    font-weight: 400;
}

.bme-form-control,
.bme-form-group input[type="text"],
.bme-form-group textarea,
.bme-form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s ease;
    background-color: #f7fafc;
}

.bme-form-control:focus,
.bme-form-group input[type="text"]:focus,
.bme-form-group textarea:focus,
.bme-form-group select:focus {
    outline: none;
    border-color: #667eea;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.bme-form-group textarea {
    resize: vertical;
    min-height: 90px;
    font-family: inherit;
}

.bme-form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a5568' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
    height: auto;
    min-height: 48px;
}

.bme-form-group select.bme-select-tall {
    line-height: normal;
    padding-top: 12px;
    padding-bottom: 12px;
    font-size: 15px;
}

.bme-form-group select option {
    padding: 12px;
    line-height: 1.5;
    font-size: 15px;
}

.bme-form-hint {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: #718096;
    font-style: italic;
}

/* Form Actions */
.bme-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 2px solid #e2e8f0;
}

/* Buttons */
.bme-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bme-btn .bme-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 0;
    font-size: 18px;
    line-height: 1;
}

.bme-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.4);
}

.bme-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.bme-btn-primary:active {
    transform: translateY(0);
}

.bme-btn-primary:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    box-shadow: none;
}

.bme-btn-large {
    padding: 14px 32px;
    font-size: 16px;
}

.bme-btn-secondary {
    background-color: #e2e8f0;
    color: #4a5568;
}

.bme-btn-secondary:hover {
    background-color: #cbd5e0;
}

.bme-btn-secondary .bme-icon {
    font-size: 14px;
    vertical-align: middle;
}

/* Modal Footer */
.bme-modal-footer {
    background-color: #f7fafc;
    padding: 20px 28px;
    border-top: 1px solid #e2e8f0;
}

.bme-saved-searches-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    color: #4a5568;
}

.bme-saved-searches-link .bme-icon-list {
    color: #667eea;
    font-size: 16px;
    font-weight: bold;
}

/* Icon styles */
.bme-icon {
    display: inline-block;
    margin-right: 2px;
}

.bme-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.bme-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* Property Preference Buttons */
.bme-preference-buttons {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
    z-index: 10;
}

.bme-like-btn,
.bme-dislike-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.9);
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.bme-like-btn:hover {
    background-color: #fff;
    color: #e74c3c;
    transform: scale(1.1);
}

.bme-like-btn.active {
    background-color: #e74c3c;
    color: white;
}

.bme-dislike-btn:hover {
    background-color: #fff;
    color: #95a5a6;
    transform: scale(1.1);
}

.bme-dislike-btn.active {
    background-color: #95a5a6;
    color: white;
}

/* Toast Notifications */
.bme-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 20px;
    background-color: #333;
    color: white;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s;
    z-index: 100000;
}

.bme-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.bme-toast-success {
    background-color: #28a745;
}

.bme-toast-error {
    background-color: #dc3545;
}

/* Login Prompt */
.bme-login-prompt .bme-modal-content {
    max-width: 400px;
}

.bme-login-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.bme-login-actions .bme-btn {
    width: 100%;
    justify-content: center;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Mobile Styles */
@media (max-width: 768px) {
    .bme-modal-content {
        margin: 20px;
        width: calc(100% - 40px);
    }
    
    #bme-save-search-btn span {
        display: none;
    }
    
    #bme-save-search-btn {
        padding: 8px 12px;
    }
    
    .bme-form-actions {
        flex-direction: column;
    }
    
    .bme-form-actions .bme-btn {
        width: 100%;
    }
    
    .bme-toast {
        left: 20px;
        right: 20px;
        bottom: 60px;
    }
}