/**
 * Office Search Styles
 * 
 * @package NotaryOffices
 * @since 2.0.0
 */

/* ========================================
   Search Page Layout
======================================== */

.notary-search-page {
    min-height: 100vh;
    background-color: #f8f9fa;
}

.search-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 60px 0 40px;
    margin-bottom: 40px;
}

.search-header .page-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.search-header .page-description {
    font-size: 1.1rem;
    opacity: 0.9;
}

.search-container {
    padding-bottom: 60px;
}

/* ========================================
   Search Sidebar (Filters)
======================================== */

.search-sidebar {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    padding: 0;
    margin-bottom: 30px;
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.filter-section {
    border-bottom: 1px solid #e9ecef;
    padding: 20px;
}

.filter-section:last-child {
    border-bottom: none;
}

.filter-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-title i {
    color: #667eea;
    font-size: 1rem;
}

.filter-content {
    color: #666;
}

/* Form Controls */
.filter-content .form-control {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.filter-content .form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.15);
}

/* Checkboxes */
.checkbox-label {
    display: flex;
    align-items: center;
    padding: 8px 0;
    cursor: pointer;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.checkbox-label:hover {
    color: #667eea;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"]:checked {
    accent-color: #667eea;
}

/* Service Categories */
.service-categories {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 10px;
}

.service-category {
    margin-bottom: 20px;
}

.category-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 10px;
    padding-left: 10px;
    border-left: 3px solid #667eea;
}

.service-checkboxes {
    padding-left: 15px;
}

/* Filter Actions */
.filter-actions {
    padding: 20px;
    background: #f8f9fa;
}

.filter-actions .btn {
    font-weight: 600;
    padding: 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.filter-actions .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.filter-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.filter-actions .btn-link {
    color: #6c757d;
    text-decoration: none;
    margin-top: 10px;
}

.filter-actions .btn-link:hover {
    color: #495057;
}

/* ========================================
   Search Results
======================================== */

.search-results {
    padding-top: 40px;
    padding-left: 30px;
}

.results-header {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.results-count {
    font-size: 1.1rem;
    color: #333;
}

.results-count strong {
    color: #667eea;
    font-size: 1.3rem;
}

.results-sort select {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.95rem;
    background: white;
    cursor: pointer;
}

/* Active Filters Display */
.active-filters {
    background: white;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.filters-label {
    font-weight: 600;
    color: #495057;
    margin-right: 10px;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    background: #e7f0ff;
    color: #667eea;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    gap: 8px;
}

.filter-tag .remove-filter {
    color: #667eea;
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.filter-tag .remove-filter:hover {
    color: #764ba2;
}

/* ========================================
   Office Cards
======================================== */

.office-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.office-card {
    background: white;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.office-card:hover {
    box-shadow: 0 5px 20px rgba(0,0,0,0.12);
    transform: translateY(-2px);
    border-color: #667eea;
}

.office-header {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.office-name {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.office-name a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s;
}

.office-name a:hover {
    color: #667eea;
}

.office-kana {
    color: #6c757d;
    font-size: 0.9rem;
    display: inline-block;
    margin-left: 10px;
}

.office-body {
    margin-bottom: 20px;
}

.office-info {
    margin-bottom: 15px;
}

.info-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    color: #495057;
    font-size: 0.95rem;
}

.info-row i {
    color: #667eea;
    width: 20px;
}

.office-services,
.office-languages {
    margin-bottom: 12px;
    font-size: 0.95rem;
    color: #666;
    line-height: 1.6;
}

.office-services strong,
.office-languages strong {
    color: #495057;
    margin-right: 8px;
}

/* Office Badges */
.office-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.badge-info {
    background-color: #e7f0ff;
    color: #0066cc;
}

.badge-success {
    background-color: #e6f7e6;
    color: #00a000;
}

.badge-primary {
    background-color: #f0e6ff;
    color: #6600cc;
}

.badge-warning {
    background-color: #fff7e6;
    color: #cc8800;
}

.office-footer {
    display: flex;
    justify-content: flex-end;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
}

.office-footer .btn {
    padding: 8px 20px;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.office-footer .btn-outline-primary {
    color: #667eea;
    border: 1px solid #667eea;
}

.office-footer .btn-outline-primary:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    color: white;
    transform: translateX(5px);
}

/* ========================================
   No Results
======================================== */

.no-results {
    background: white;
    border-radius: 8px;
    padding: 60px 40px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.no-results i {
    color: #dee2e6;
    margin-bottom: 20px;
}

.no-results h3 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.no-results p {
    color: #6c757d;
    margin-bottom: 25px;
}

.no-results .btn {
    padding: 12px 30px;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    border-radius: 6px;
}

/* ========================================
   Pagination
======================================== */

.office-pagination {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.pagination {
    display: flex;
    gap: 5px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.page-item {
    display: inline-block;
}

.page-link {
    display: block;
    padding: 10px 15px;
    background: white;
    border: 1px solid #dee2e6;
    color: #495057;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 500;
    min-width: 45px;
    text-align: center;
}

.page-link:hover {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

.page-item.active .page-link {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    color: white;
}

.page-item.disabled .page-link {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination-info {
    color: #6c757d;
    font-size: 0.95rem;
}

/* ========================================
   Loading States
======================================== */

.search-loading {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
}

.search-results-container.loading {
    opacity: 0.5;
    pointer-events: none;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========================================
   Mobile Responsive
======================================== */

@media (max-width: 991px) {
    .search-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 300px;
        height: 100vh;
        z-index: 1050;
        transition: left 0.3s ease;
        margin-bottom: 0;
        max-height: 100vh;
    }
    
    .search-sidebar.mobile-open {
        left: 0;
    }
    
    body.filters-open {
        overflow: hidden;
    }
    
    .search-results {
        padding-left: 0;
    }
    
    .results-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
}

@media (max-width: 767px) {
    .search-header {
        padding: 40px 0 30px;
    }
    
    .search-header .page-title {
        font-size: 1.8rem;
    }
    
    .office-card {
        padding: 20px;
    }
    
    .office-name {
        font-size: 1.2rem;
    }
    
    .office-footer {
        padding-top: 10px;
    }
    
    .office-footer .btn {
        width: 100%;
    }
    
    .active-filters {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .filters-label {
        margin-bottom: 10px;
    }
}

@media (max-width: 575px) {
    .search-header .page-title {
        font-size: 1.5rem;
    }
    
    .office-badges {
        gap: 5px;
    }
    
    .badge {
        font-size: 0.8rem;
        padding: 4px 10px;
    }
    
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .page-link {
        padding: 8px 12px;
        min-width: 40px;
        font-size: 0.9rem;
    }
}