﻿/* ==========================================
   Search Page Layout
========================================== */
.brpro-search-wrapper {
  padding: 30px 0 60px;
}

.brpro-search-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  align-items: start;
}

/* Sidebar: History */
.search-history-panel {
  padding: 24px;
  position: sticky;
  top: 80px;
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--brpro-border);
}

.history-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--brpro-text);
  margin: 0;
}

.clear-btn {
  background: transparent;
  border: none;
  color: var(--brpro-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.clear-btn:hover {
  background: rgba(255, 71, 71, 0.1);
  color: #FF4747;
}

.history-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-list li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--brpro-muted);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.2s;
  background: var(--brpro-bg);
  border: 1px solid transparent;
}

.history-list li a svg {
  flex-shrink: 0;
  opacity: 0.6;
}

.history-list li a:hover {
  background: var(--brpro-panel);
  border-color: var(--brpro-accent);
  color: var(--brpro-accent);
  transform: translateX(4px);
}

.empty-history {
  text-align: center;
  padding: 30px 0;
  color: var(--brpro-muted-2);
  font-size: 14px;
}

/* Main Content: Results */
.search-results-panel {
  padding: 24px;
  min-height: 500px;
}

.brpro-mobile-search-inline {
  display: none;
}

.results-header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--brpro-border);
}

.results-header h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--brpro-text);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.results-header h2::before {
  content: "";
  display: block;
  width: 4px;
  height: 18px;
  background: var(--brpro-accent);
  border-radius: 2px;
}

.empty-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 0;
  color: var(--brpro-muted);
}

.empty-results svg {
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-results p {
  margin: 0;
  font-size: 16px;
}

/* Grid & Pagination reuse from library */
.brpro-library-grid .nlist {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin: 0;
  padding: 0;
}

.brpro-library-grid .nlist li {
  width: 100%;
  margin: 0;
  padding: 0;
}

/* Responsive */
@media (max-width: 1024px) {
  .brpro-search-layout {
    grid-template-columns: 240px 1fr;
  }
  
  .brpro-library-grid .nlist {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .brpro-mobile-search-inline {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
  }

  .brpro-mobile-search-inline input {
    flex: 1;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--brpro-border);
    border-radius: 10px;
    font-size: 16px;
    color: var(--brpro-text);
    background: #fff;
    outline: none;
  }

  .brpro-mobile-search-inline input:focus {
    border-color: var(--brpro-accent);
    box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.1);
  }

  .brpro-mobile-search-inline button {
    min-height: 44px;
    padding: 0 16px;
    border: none;
    border-radius: 10px;
    background: var(--brpro-accent);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
  }

  .brpro-search-layout {
    grid-template-columns: 1fr;
  }

  .search-history-panel {
    position: static;
    padding: 16px;
  }

  .history-list {
    flex-direction: row;
    flex-wrap: wrap;
  }
  
  .history-list li {
    flex: 1 1 calc(50% - 8px);
  }

  .search-results-panel {
    padding: 16px;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .brpro-library-grid .nlist {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}
