/* ============================================================
   Search Freelancer V2 - Grid Layout with Sidebar Filters
   Phase 4 Sprint 3 - F16 Redesign
   ============================================================ */

/* --- Page Header --- */
.sf-page-header {
  background: linear-gradient(135deg, #E60026 0%, #B8001F 100%);
  padding: 140px 0 40px;
  color: #fff;
  text-align: center;
}

.sf-header-content {
  max-width: 600px;
  margin: 0 auto;
}

.sf-page-title {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: #fff;
}

.sf-page-subtitle {
  font-size: 1rem;
  opacity: 0.9;
  margin: 0 0 16px;
  color: rgba(255,255,255,0.9);
}

.sf-results-meta {
  display: inline-block;
  background: rgba(255,255,255,0.15);
  padding: 6px 18px;
  border-radius: 20px;
  font-size: 0.9rem;
}

.sf-results-count strong {
  font-weight: 700;
  color: #fff;
}

/* --- Main Content Grid --- */
.sf-main-content {
  padding: 30px 0 60px;
  background: #f5f6fa;
  min-height: 60vh;
}

.sf-content-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  align-items: start;
}

/* --- Filter Sidebar --- */
.sf-filter-sidebar {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  padding: 20px;
  position: sticky;
  top: 120px;
}

.sf-sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid #f0f0f0;
}

.sf-sidebar-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0;
}

.sf-btn-clear-all {
  background: none;
  border: none;
  color: #E60026;
  font-size: 0.8rem;
  cursor: pointer;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.2s;
}

.sf-btn-clear-all:hover {
  background: rgba(230, 0, 38, 0.08);
}

/* Active Filter Chips */
.sf-active-filters {
  margin-bottom: 16px;
}

.sf-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sf-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #FEE2E2;
  color: #E60026;
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 0.75rem;
  font-weight: 600;
}

.sf-filter-chip .chip-remove {
  cursor: pointer;
  font-size: 0.65rem;
  opacity: 0.7;
  margin-left: 2px;
}

.sf-filter-chip .chip-remove:hover {
  opacity: 1;
}

/* Filter Groups */
.sf-filter-group {
  margin-bottom: 18px;
}

.sf-filter-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
}

.sf-filter-label i {
  color: #E60026;
  font-size: 0.8rem;
  width: 16px;
  text-align: center;
}

.sf-filter-input,
.sf-filter-select {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  font-size: 0.85rem;
  color: #333;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.sf-filter-input:focus,
.sf-filter-select:focus {
  border-color: #E60026;
  box-shadow: 0 0 0 3px rgba(230, 0, 38, 0.1);
  outline: none;
}

/* Checkbox Filter */
.sf-filter-checkbox-group {
  padding: 12px;
  background: #f9fafb;
  border-radius: 8px;
}

.sf-filter-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: #333;
}

.sf-filter-checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #E60026;
  cursor: pointer;
}

.sf-filter-checkbox-label i {
  color: #2E7D32;
  font-size: 0.85rem;
}

.sf-filter-hint {
  display: block;
  font-size: 0.75rem;
  color: #888;
  margin-top: 4px;
  padding-left: 26px;
}

/* Apply Filters Button (Mobile only) */
.sf-btn-apply-filters {
  display: none;
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #E60026 0%, #B8001F 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 16px;
}

/* --- Controls Bar (Sort + Mobile Toggle) --- */
.sf-controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.sf-sort-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sf-sort-control label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #555;
  white-space: nowrap;
}

.sf-sort-select {
  padding: 6px 12px;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  font-size: 0.85rem;
  color: #333;
  background: #fff;
  cursor: pointer;
}

.sf-btn-mobile-filters {
  display: none;
  padding: 8px 16px;
  background: #f0f0f0;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #333;
  cursor: pointer;
  gap: 6px;
  align-items: center;
}

/* --- Freelancer Cards Grid --- */
.sf-freelancers-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* --- Freelancer Card --- */
.sf-freelancer-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.sf-freelancer-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

/* Boosted/Featured Card */
.sf-freelancer-card.sf-card-boosted {
  border: 2px solid #FFD700;
  position: relative;
}

.sf-boost-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  color: #333;
  padding: 4px 12px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sf-boost-badge i {
  font-size: 0.65rem;
}

.sf-boost-badge .sf-boost-sponsor {
  font-weight: 500;
  opacity: 0.8;
  font-size: 0.65rem;
}

/* Card Body */
.sf-card-body {
  padding: 20px;
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.sf-card-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 12px;
  border: 3px solid #f0f0f0;
}

.sf-card-boosted .sf-card-avatar {
  border-color: #FFD700;
}

.sf-card-name {
  font-size: 1rem;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sf-card-name a {
  color: inherit;
  text-decoration: none;
}

.sf-card-name a:hover {
  color: #E60026;
}

.sf-card-location {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 0.8rem;
  color: #777;
  margin-bottom: 8px;
}

.sf-card-location img {
  width: 16px;
  height: 11px;
}

/* Trust Badges */
.sf-card-badges {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.sf-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
}

.sf-badge-verified {
  background: #E8F5E9;
  color: #2E7D32;
}

.sf-badge-top-rated {
  background: #FFF8E1;
  color: #F57F17;
}

/* Rating */
.sf-card-rating {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 10px;
}

.sf-stars {
  display: flex;
  gap: 2px;
}

.sf-stars i {
  font-size: 0.75rem;
  color: #ddd;
}

.sf-stars i.active {
  color: #FFB800;
}

.sf-stars i.half {
  color: #FFB800;
}

.sf-rating-text {
  font-size: 0.8rem;
  color: #555;
  font-weight: 600;
}

.sf-review-count {
  font-size: 0.75rem;
  color: #999;
}

/* About Text */
.sf-card-about {
  font-size: 0.8rem;
  color: #666;
  line-height: 1.5;
  margin-bottom: 12px;
  flex: 1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

/* Category Tags */
.sf-card-categories {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-bottom: 12px;
}

.sf-category-tag {
  background: #f5f5f5;
  color: #555;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 500;
}

/* Portfolio Badge */
.sf-portfolio-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #E60026 0%, #B8001F 100%);
  color: #fff;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.sf-portfolio-badge i {
  font-size: 0.65rem;
}

/* Card Footer */
.sf-card-footer {
  padding: 12px 20px;
  border-top: 1px solid #f0f0f0;
  background: #fafbfc;
  display: flex;
  gap: 8px;
  justify-content: center;
}

.sf-btn-view-profile {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  border: 2px solid #E60026;
  color: #E60026;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  background: transparent;
}

.sf-btn-view-profile:hover {
  background: #E60026;
  color: #fff;
}

.sf-btn-invite {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #E60026, #B8001F);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
}

.sf-btn-invite:hover {
  background: linear-gradient(135deg, #CC0022, #990019);
  box-shadow: 0 4px 12px rgba(230, 0, 38, 0.3);
}

/* --- Skeleton Loading --- */
.sf-skeleton-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.sf-skeleton-card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.sf-skeleton-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: sf-shimmer 1.5s infinite;
  margin: 0 auto 16px;
}

.sf-skeleton-line {
  height: 14px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: sf-shimmer 1.5s infinite;
  border-radius: 7px;
  margin-bottom: 10px;
}

.sf-skeleton-name {
  width: 60%;
  margin-left: auto;
  margin-right: auto;
}

.sf-skeleton-location {
  width: 40%;
  margin-left: auto;
  margin-right: auto;
  height: 10px;
}

.sf-skeleton-rating {
  width: 50%;
  margin-left: auto;
  margin-right: auto;
  height: 12px;
}

.sf-skeleton-bio {
  width: 90%;
  margin-left: auto;
  margin-right: auto;
}

.sf-skeleton-bio.short {
  width: 70%;
}

.sf-skeleton-tags {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 12px;
}

.sf-skeleton-tag {
  width: 60px;
  height: 20px;
  border-radius: 10px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: sf-shimmer 1.5s infinite;
}

@keyframes sf-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* --- Empty State --- */
.sf-empty-state {
  text-align: center;
  padding: 60px 20px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.sf-empty-icon {
  font-size: 3rem;
  color: #ddd;
  margin-bottom: 16px;
}

.sf-empty-state h3 {
  font-size: 1.2rem;
  color: #333;
  margin: 0 0 8px;
}

.sf-empty-state p {
  font-size: 0.9rem;
  color: #888;
  margin: 0 0 20px;
}

.sf-btn-reset {
  padding: 10px 24px;
  background: #E60026;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.sf-btn-reset:hover {
  background: #CC0022;
}

/* --- Pagination --- */
.sf-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.sf-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
  color: #333;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.sf-page-btn:hover {
  border-color: #E60026;
  color: #E60026;
  background: #FEE2E2;
}

.sf-page-btn.active {
  background: #E60026;
  color: #fff;
  border-color: #E60026;
}

.sf-page-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.sf-page-ellipsis {
  padding: 0 6px;
  color: #999;
  font-size: 0.85rem;
}

/* --- Mobile Filter Overlay --- */
.sf-filter-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 998;
}

.sf-filter-overlay.active {
  display: block;
}

/* ============================================================
   Responsive Design
   ============================================================ */

/* Tablet: 2 columns */
@media (max-width: 1024px) {
  .sf-content-grid {
    grid-template-columns: 260px 1fr;
    gap: 20px;
  }

  .sf-freelancers-grid,
  .sf-skeleton-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .sf-page-header {
    padding: 120px 0 30px;
  }
}

/* Mobile: 1 column, sidebar becomes drawer */
@media (max-width: 768px) {
  .sf-page-header {
    padding: 100px 0 24px;
  }

  .sf-page-title {
    font-size: 1.5rem;
  }

  .sf-content-grid {
    grid-template-columns: 1fr;
  }

  .sf-filter-sidebar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    border-radius: 0;
    overflow-y: auto;
    padding: 24px;
    max-height: 100vh;
  }

  .sf-filter-sidebar.active {
    display: block;
  }

  .sf-btn-mobile-filters {
    display: inline-flex;
  }

  .sf-btn-apply-filters {
    display: block;
  }

  .sf-freelancers-grid,
  .sf-skeleton-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .sf-card-body {
    padding: 16px;
  }

  .sf-card-avatar {
    width: 64px;
    height: 64px;
  }
}

@media (max-width: 480px) {
  .sf-page-header {
    padding: 90px 0 20px;
  }

  .sf-page-title {
    font-size: 1.3rem;
  }

  .sf-page-subtitle {
    font-size: 0.85rem;
  }

  .sf-controls-bar {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }

  .sf-sort-control {
    width: 100%;
  }

  .sf-sort-select {
    flex: 1;
  }

  .sf-btn-mobile-filters {
    width: 100%;
    justify-content: center;
  }
}

/* RTL Support */
[dir="rtl"] .sf-filter-label i,
.rtl .sf-filter-label i {
  margin-left: 6px;
  margin-right: 0;
}

[dir="rtl"] .sf-filter-chip .chip-remove,
.rtl .sf-filter-chip .chip-remove {
  margin-left: 0;
  margin-right: 2px;
}
