/* ===== saved-searches.css ===== */
/**
 * Saved Searches Styles - UNIFIED DESIGN v3
 */

/* Allow notifications block */
.la-saved-searches-container .la-allow-notifications-block {
    background: var(--la-bg-secondary);
    border: 1px solid var(--la-border);
    border-radius: 5px;
    padding: 14px;
}

.la-saved-searches-container .la-allow-notifications-block p {
    margin: 0 0 8px 0;
}

.la-saved-searches-container .la-allow-notifications-block p:last-of-type {
    margin-bottom: 12px;
}

.la-saved-searches-container .la-allow-notifications-block .la-allow-notifications-btn {
    margin: 0;
}

.la-saved-searches-container .la-allow-notifications-block .la-push-disable-btn {
    margin: 0;
}

.la-saved-searches-container .la-push-permission-hint,
.la-saved-searches-container #la-push-permission-hint {
    margin: 8px 0;
    padding: 10px;
    background: rgb(145 32 32);
    border-left: 4px solid rgb(187 142 10);
}

/* ============================================
   SAVED SEARCHES GRID
   ============================================ */
.la-saved-searches-container .la-saved-searches-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-top: 16px;
}

/* ============================================
   SAVED SEARCH CARD
   ============================================ */
.la-saved-searches-container .la-saved-search-card {
    background: var(--la-bg);
    border: 1px solid var(--la-border);
    border-radius: 5px;
    padding: 14px;
    box-shadow: var(--la-inner-highlight), var(--la-shadow);
    transition: all 0.2s ease;
}

.la-saved-searches-container .la-saved-search-card:hover {
    border-color: var(--la-accent);
    box-shadow: var(--la-inner-highlight), var(--la-shadow-hover);
    transform: translateY(-2px);
}

/* Header - ONE ROW */
.la-saved-searches-container .la-saved-search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--la-border);
    gap: 10px;
}

.la-saved-searches-container .la-saved-search-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--la-text);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Toggle Switch */
.la-saved-searches-container .la-notification-toggle-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
    flex-shrink: 0;
}

.la-saved-searches-container .la-notification-toggle-label {
    font-size: 9px;
    color: var(--la-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.la-saved-searches-container .la-toggle-switch {
    position: relative;
    width: 44px;
    height: 22px;
}

.la-saved-searches-container .la-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.la-saved-searches-container .la-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--la-bg-tertiary);
    border: 1px solid var(--la-border);
    border-radius: 11px;
    transition: all 0.2s ease;
    box-shadow: var(--la-inner-highlight);
}

.la-saved-searches-container .la-toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background: var(--la-bg);
    border: 1px solid var(--la-border);
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.la-saved-searches-container input:checked + .la-toggle-slider {
    background: var(--la-accent);
    border-color: var(--la-accent-hover);
}

.la-saved-searches-container input:checked + .la-toggle-slider:before {
    transform: translateX(22px);
    border-color: transparent;
}

/* Unseen badge row: badge + “Mark as seen” */
.la-saved-searches-container .la-unseen-badge-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-bottom: 12px;
}

/* Unseen Badge (omitted from HTML when count is 0) */
.la-saved-searches-container .la-unseen-badge:empty {
    display: none !important;
}

.la-saved-searches-container .la-unseen-badge {
    background: var(--la-accent);
    color: #ffffff;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 0;
    display: inline-block;
}

.la-saved-searches-container .la-unseen-badge-row .la-mark-search-seen-btn {
    flex-shrink: 0;
    white-space: nowrap;
}

/* Filters Display */
.la-saved-searches-container .la-saved-search-filters {
    margin-bottom: 12px;
}

.la-saved-searches-container .la-saved-search-filters h4 {
    font-size: 10px;
    font-weight: 600;
    color: var(--la-text-muted);
    margin: 0 0 6px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.la-saved-searches-container .la-filter-tag {
    display: inline-block;
    background: var(--la-bg-secondary);
    padding: 4px 8px;
    border-radius: 5px;
    font-size: 11px;
    margin: 3px 3px 3px 0;
    border: 1px solid var(--la-border-light);
}

.la-saved-searches-container .la-filter-label {
    color: var(--la-text-light);
}

.la-saved-searches-container .la-filter-value {
    color: var(--la-accent-text);
    font-weight: 500;
}

/* Search Meta */
.la-saved-searches-container .la-saved-search-meta {
    padding: 10px;
    background: var(--la-bg-secondary);
    border-radius: 5px;
    margin-bottom: 12px;
    border: 1px solid var(--la-border-light);
    box-shadow: var(--la-inner-highlight);
}

.la-saved-searches-container .la-saved-search-meta small {
    color: var(--la-text-light);
    font-size: 11px;
    line-height: 1.5;
}

/* Actions - ONE ROW */
.la-saved-searches-container .la-saved-search-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.la-saved-searches-container .la-saved-search-actions .la-button {
    flex: 1 1 auto;
    min-width: 100px;
}

.la-saved-searches-container .la-delete-confirm {
    background: var(--la-error) !important;
    color: #ffffff !important;
    border-color: var(--la-error) !important;
}

/* ============================================
   SAVE SEARCH MODAL
   ============================================ */
#la-save-search-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
}

#la-save-search-modal.active {
    display: flex;
}

#la-save-search-modal .la-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--la-overlay);
}

#la-save-search-modal .la-modal-content {
    position: relative;
    z-index: 2;
    background: var(--la-bg);
    border: 1px solid var(--la-border);
    border-radius: 5px;
    max-width: 400px;
    width: 90%;
    box-shadow: var(--la-inner-highlight), var(--la-shadow-hover);
}

#la-save-search-modal .la-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid var(--la-border);
    background: var(--la-bg-secondary);
    border-radius: 5px 5px 0 0;
}

#la-save-search-modal .la-modal-header h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--la-text);
}

/* Modal close button - override Elementor CSS - match la-filter-close styles */
.la-modal-close,
#la-save-search-modal .la-modal-close {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    padding: 0 !important;
    font-size: 18px !important;
    border-radius: 5px !important;
    background: var(--la-bg-secondary) !important;
    border: 1px solid var(--la-border) !important;
    box-shadow: var(--la-inner-highlight) !important;
    cursor: pointer !important;
    color: var(--la-text) !important;
    transition: all 0.15s ease !important;
    outline: none !important;
    margin: 0 !important;
}

.la-modal-close:hover,
#la-save-search-modal .la-modal-close:hover {
    background: var(--la-bg-tertiary) !important;
    border-color: var(--la-border-dark) !important;
}

.la-modal-close:active {
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1) !important;
}

#la-save-search-modal .la-modal-body {
    padding: 18px;
}

#la-save-search-modal .la-modal-body p {
    color: var(--la-text-light);
    margin: 0 0 14px 0;
    font-size: 13px;
}

#la-save-search-modal .la-form-group {
    margin-bottom: 14px;
}

#la-save-search-modal .la-form-group label {
    display: block;
    font-weight: 500;
    color: var(--la-text);
    margin-bottom: 5px;
    font-size: 13px;
}

#la-save-search-modal .la-form-help {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: var(--la-text-muted);
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.la-toast-notification {
    position: fixed;
    top: -100px;
    right: 16px;
    background: var(--la-bg);
    border: 1px solid var(--la-border);
    border-radius: 5px;
    padding: 12px 16px;
    box-shadow: var(--la-inner-highlight), var(--la-shadow-hover);
    z-index: 999999;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 260px;
    max-width: 380px;
    transition: top 0.3s ease;
}

.la-toast-notification.la-toast-show {
    top: 16px;
}

.la-toast-notification.la-toast-success {
    border-color: var(--la-success);
}

.la-toast-notification.la-toast-error {
    border-color: var(--la-error);
}

.la-toast-notification.la-toast-warning {
    border-color: var(--la-warning);
}

.la-toast-notification.la-toast-info {
    border-color: var(--la-info);
}

.la-toast-notification .la-toast-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.la-toast-notification.la-toast-success .la-toast-icon {
    color: var(--la-success);
}

.la-toast-notification.la-toast-error .la-toast-icon {
    color: var(--la-error);
}

.la-toast-notification.la-toast-warning .la-toast-icon {
    color: var(--la-warning);
}

.la-toast-notification.la-toast-info .la-toast-icon {
    color: var(--la-info);
}

.la-toast-notification .la-toast-message {
    flex: 1;
    font-size: 13px;
    color: var(--la-text);
    line-height: 1.4;
}

.la-toast-notification .la-toast-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--la-bg-secondary);
    border: 1px solid var(--la-border);
    font-size: 14px;
    color: var(--la-text-muted);
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    border-radius: 5px;
    flex-shrink: 0;
    transition: all 0.15s ease;
    box-shadow: var(--la-inner-highlight);
}

.la-toast-notification .la-toast-close:hover {
    background: var(--la-bg-tertiary);
    color: var(--la-text);
}

/* ============================================
   RESPONSIVE - TABLET
   ============================================ */
@media (max-width: 1024px) {
    .la-saved-searches-container .la-saved-searches-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */
@media (max-width: 767px) {
    .la-saved-searches-container .la-saved-searches-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .la-saved-searches-container .la-saved-search-card {
        padding: 12px;
    }
    
    /* Header - STILL ONE ROW on mobile */
    .la-saved-searches-container .la-saved-search-header {
        flex-direction: row;
        align-items: center;
    }
    
    /* Actions - STILL ONE ROW on mobile */
    .la-saved-searches-container .la-saved-search-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .la-saved-searches-container .la-saved-search-actions .la-button {
        flex: 1;
        padding: 0 8px !important;
        font-size: 11px !important;
    }
    
    .la-toast-notification {
        left: 12px;
        right: 12px;
        min-width: auto;
    }
}
