/* ================================================ */
/* SAVED SEARCHES MODULE STYLES                    */
/* ================================================ */

/* Save Search Button in Header Search Bar */
#saveSearchBtn {
    display: none; /* Hidden by default, shown only on search-results.php */
    flex-shrink: 0;
    white-space: nowrap;
    padding: 0 16px;
    height: 42px;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s ease-in-out;
}

#saveSearchBtn i {
    font-size: 16px;
}

#saveSearchBtn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Saved state button */
#saveSearchBtn.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* ================================================ */
/* SAVED SEARCHES LIST - DASHBOARD                */
/* ================================================ */

.saved-searches-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.saved-searches-container h6{
    font-family: "AnotherGroteskW05" !important;
    font-weight: 500 !important;
}

.saved-searches-container .list-group-item{
    margin-bottom: 20px !important;
    padding-top: 18px !important;
    padding-bottom: 18px !important;
}

.saved-search-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 1.25rem;
    transition: all 0.2s ease-in-out;
}

.saved-search-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.saved-search-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.saved-search-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.saved-search-info {
    flex: 1;
    min-width: 0;
}

.saved-search-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
    word-wrap: break-word;
}

.saved-search-description {
    font-size: 0.875rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.saved-search-date {
    font-size: 0.8125rem;
    color: #999;
}

.saved-search-actions {
    flex-shrink: 0;
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.saved-search-actions .btn {
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.saved-search-actions .btn i {
    font-size: 14px;
}

.saved-search-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Run search button */
.run-search-btn {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: white !important;
}

.run-search-btn:hover {
    background: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
}

/* Edit button */
.edit-search-label-btn {
    border-color: #6c757d !important;
    color: #6c757d !important;
}

.edit-search-label-btn:hover {
    background: #6c757d !important;
    color: white !important;
}

/* Delete button */
.delete-search-btn {
    border-color: #dc3545 !important;
    color: #dc3545 !important;
}

.delete-search-btn:hover {
    background: #dc3545 !important;
    color: white !important;
}

/* ================================================ */
/* SAVE SEARCH MODAL                              */
/* ================================================ */

#saveSearchModal .modal-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
}

#saveSearchModal .modal-header .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

#saveSearchModal .modal-header .btn-close:hover {
    opacity: 1;
}

#saveSearchModal .modal-body {
    padding: 1.5rem;
}

#searchLabelInput {
    border-radius: 6px;
    border: 2px solid #dee2e6;
    padding: 0.75rem;
    font-size: 1rem;
    transition: all 0.2s;
}

#searchLabelInput:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(51, 204, 51, 0.1);
}

#searchParamsPreview {
    color: var(--secondary-color);
    font-size: 0.875rem;
}

#saveSearchModal .modal-footer {
    border-top: 1px solid #dee2e6;
    padding: 1rem 1.5rem;
}

/* ================================================ */
/* EMPTY STATE                                     */
/* ================================================ */

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.empty-state-icon {
    font-size: 4rem;
    color: #dee2e6;
    margin-bottom: 1.5rem;
}

.empty-state-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.75rem;
}

.empty-state-description {
    color: var(--secondary-color);
    font-size: 1rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* ================================================ */
/* RESPONSIVE DESIGN                               */
/* ================================================ */

/* Tablets and below */
@media (max-width: 991px) {
    .saved-search-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .saved-search-icon {
        align-self: flex-start;
    }
    
    .saved-search-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

/* Mobile phones */
@media (max-width: 767px) {
    #saveSearchBtn span {
        display: none !important;
    }
    
    #saveSearchBtn {
        padding: 0 12px;
        min-width: 42px;
    }
    
    .saved-search-item {
        padding: 1rem;
    }
    
    .saved-search-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .saved-search-title {
        font-size: 1rem;
    }
    
    .saved-search-description {
        font-size: 0.8125rem;
    }
    
    .saved-search-actions {
        flex-wrap: wrap;
    }
    
    .saved-search-actions .btn {
        flex: 1;
        min-width: calc(33.333% - 0.35rem);
    }
}

/* Small mobile phones */
@media (max-width: 480px) {
    .empty-state {
        padding: 2rem 1rem;
    }
    
    .empty-state-icon {
        font-size: 3rem;
    }
    
    .empty-state-title {
        font-size: 1.25rem;
    }
    
    .empty-state-description {
        font-size: 0.875rem;
    }
    
    #saveSearchModal .modal-dialog {
        margin: 0.5rem;
    }
}

/* ================================================ */
/* ANIMATIONS                                      */
/* ================================================ */

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.saved-search-item {
    animation: slideInUp 0.3s ease-out;
}

/* Stagger animation for multiple items */
.saved-search-item:nth-child(1) { animation-delay: 0.05s; }
.saved-search-item:nth-child(2) { animation-delay: 0.1s; }
.saved-search-item:nth-child(3) { animation-delay: 0.15s; }
.saved-search-item:nth-child(4) { animation-delay: 0.2s; }
.saved-search-item:nth-child(5) { animation-delay: 0.25s; }

/* Loading animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading-pulse {
    animation: pulse 1.5s ease-in-out infinite;
}

/* ================================================ */
/* PRINT STYLES                                    */
/* ================================================ */

@media print {
    #saveSearchBtn,
    .saved-search-actions {
        display: none !important;
    }
}

/* ================================================ */
/* ACCESSIBILITY                                   */
/* ================================================ */

.saved-search-actions .btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

#saveSearchBtn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .saved-search-item {
        border-width: 2px;
    }
    
    .saved-search-icon {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .saved-search-item,
    .saved-search-actions .btn,
    #saveSearchBtn {
        animation: none;
        transition: none;
    }
    
    .saved-search-item:hover,
    .saved-search-actions .btn:hover,
    #saveSearchBtn:hover {
        transform: none;
    }
}