/* Search Page Styles */
.search-page { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); min-height: 100vh; overflow-x: hidden; }
.search-main { width: 100%; max-width: 900px; margin: 80px auto 32px; padding: 0 24px; box-sizing: border-box; }
.search-title { font-family: 'ClashBold', Arial, sans-serif; font-size: 2.5rem; margin: 0 0 8px; color: #fff; text-align: center; text-shadow: 0 2px 8px rgba(0,0,0,0.2); }
.search-subtitle { font-family: 'ClashRegular', Arial, sans-serif; font-size: 1.05rem; margin: 0 0 20px; color: rgba(255,255,255,0.9); text-align: center; }
.search-bar { position: relative; display: flex; gap: 12px; align-items: center; margin-bottom: 24px; background: #fff; border-radius: 50px; padding: 8px 16px; box-shadow: 0 4px 24px rgba(0,0,0,0.15); box-sizing: border-box; width: 100%; }
.search-bar .search-input { flex: 1; padding: 12px 8px; border: none; outline: none; font-size: 16px; font-family: 'ClashRegular', Arial, sans-serif; background: transparent; min-width: 0; }
.search-bar .search-btn { width: 48px; height: 48px; min-width: 48px; border-radius: 50%; border: none; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: transform 0.2s; flex-shrink: 0; }
.search-bar .search-btn:hover { transform: scale(1.05); }
.search-bar .search-btn svg { stroke: #fff; }
.search-info { color: #fff; margin: 16px 0; font-size: 0.95rem; text-align: center; opacity: 0.9; }

/* Autocomplete dropdown — matches homepage style */
.search-bar { overflow: visible; }
.cc-suggest-box {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  background: #fff;
  border: 1px solid #cbd4de;
  border-radius: 16px;
  box-shadow: 0 12px 32px -8px rgba(0,0,0,0.28);
  z-index: 200;
  max-height: 280px;
  overflow: auto;
}
.cc-suggest-list { list-style: none; margin: 6px 0; padding: 0; }
.cc-suggest-item { margin: 0; padding: 0; }
.cc-suggest-item button {
  width: 100%;
  text-align: left;
  background: #fff;
  border: none;
  padding: 11px 18px;
  font-family: 'ClashRegular', Arial, sans-serif;
  font-size: 0.95rem;
  color: #1a1a2e;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: background 0.15s;
}
.cc-suggest-item button:hover { background: #f4f7fb; }
.cc-suggest-item.is-active button { background: #eaf2ff; }
.cc-sg-name { font-family: 'ClashBold', Arial, sans-serif; font-weight: 600; flex: 1; }
.cc-sg-clan { color: #555; font-size: 0.85rem; font-style: italic; }
.cc-sg-tag { color: #888; font-size: 0.83rem; margin-left: auto; }
.cc-suggest-empty { padding: 14px 18px; color: #888; font-size: 0.9rem; font-family: 'ClashRegular', Arial, sans-serif; }

/* Results List */
.results-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; width: 100%; }

/* Result Item - Card Style */
.result-item { width: 100%; }
.result-item > button {
  width: 100%;
  display: grid;
  grid-template-columns: 2fr 1.2fr 1.5fr 1.2fr 60px 1fr;
  gap: 8px;
  align-items: center;
  padding: 14px 16px;
  border: none;
  background: #fff;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  transition: all 0.2s ease;
  text-align: left;
  box-sizing: border-box;
}
.result-item > button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  background: #fafbff;
}

/* Each field as a box */
.result-item span {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 8px;
  background: #f5f6fa;
  min-height: 36px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: 'ClashRegular', Arial, sans-serif;
}

.result-item .r-name {
  font-weight: 600;
  font-family: 'ClashBold', Arial, sans-serif;
  color: #1a1a2e;
  background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
  font-size: 1.1rem;
}

.result-item .r-tag {
  color: #333;
  font-family: 'ClashRegular', Arial, sans-serif;
  font-size: 0.9rem;
  background: #eef0f5;
}

.result-item .r-clan {
  color: #2d5a2d;
  font-size: 0.95rem;
  background: #e8f4e8;
  font-family: 'ClashRegular', Arial, sans-serif;
}

.result-item .r-clantag {
  color: #446644;
  font-size: 0.85rem;
  background: #f0f5f0;
  font-family: 'ClashRegular', Arial, sans-serif;
}

.result-item .r-level {
  width: 46px;
  height: 46px;
  min-height: 46px;
  padding: 0;
  background: url('/assets/images/experience.webp') center/contain no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'ClashBold', Arial, sans-serif;
  font-size: 1.1rem;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
  letter-spacing: 0.5px;
  border-radius: 0;
}

.result-item .r-trophies {
  color: #8b6914;
  font-weight: 600;
  font-size: 1rem;
  background: #fff8e0;
  justify-content: center;
  font-family: 'ClashBold', Arial, sans-serif;
}

/* Table Header */
.results-header {
  display: grid;
  grid-template-columns: 2fr 1.2fr 1.5fr 1.2fr 60px 1fr;
  gap: 8px;
  padding: 10px 16px;
  color: rgba(255,255,255,0.9);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: 'ClashBold', Arial, sans-serif;
  box-sizing: border-box;
  width: 100%;
}
.results-header span {
  padding: 0 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Mobile Styles */
@media (max-width: 768px) {
  .search-main { margin: 60px auto 24px; padding: 0 12px; box-sizing: border-box; }
  .search-title { font-size: 1.6rem; margin-bottom: 6px; }
  .search-subtitle { font-size: 0.95rem; margin-bottom: 16px; }
  .search-bar { padding: 6px 12px; gap: 8px; border-radius: 40px; }
  .search-bar .search-input { font-size: 15px; padding: 10px 6px; }
  .search-bar .search-btn { width: 42px; height: 42px; }
  
  .results-header { display: none; }
  
  .results-list { gap: 8px; }
  
  /* Compact horizontal layout like PC */
  .result-item > button {
    display: grid;
    grid-template-columns: 1fr 36px 70px;
    grid-template-rows: auto auto;
    grid-template-areas:
      "name level trophies"
      "info info info";
    gap: 6px 8px;
    padding: 10px 12px;
    border-radius: 12px;
    align-items: center;
  }
  
  .result-item span {
    padding: 4px 8px;
    border-radius: 6px;
    min-height: auto;
    font-size: 0.85rem;
  }
  
  .result-item .r-name {
    grid-area: name;
    font-size: 1rem;
    padding: 6px 10px;
    background: transparent;
  }
  
  .result-item .r-level {
    grid-area: level;
    width: 36px;
    height: 36px;
    min-height: 36px;
    font-size: 0.95rem;
  }
  
  .result-item .r-trophies {
    grid-area: trophies;
    font-size: 0.9rem;
    padding: 6px 8px;
    justify-content: center;
  }
  
  /* Hide these on mobile - show in compact info row */
  .result-item .r-tag,
  .result-item .r-clantag {
    display: none;
  }

  .result-item .r-clan {
    display: flex;
    grid-area: info;
    min-width: 0;
    max-width: 100%;
    padding: 4px 10px;
    background: rgba(232, 244, 232, 0.9);
    color: #2d5a2d;
    font-size: 0.82rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* Small mobile */
@media (max-width: 400px) {
  .search-main { padding: 0 8px; }
  .result-item > button { padding: 8px 10px; gap: 4px 6px; }
  .result-item .r-name { font-size: 0.9rem; }
  .result-item .r-level { width: 32px; height: 32px; min-height: 32px; font-size: 0.85rem; }
  .result-item .r-trophies { font-size: 0.8rem; }
}
