/**
 * GRAPHIC VIEW — Smart Search System Stylesheet
 * Responsive Search Bar, Grid/List Views, Voice Waveforms, AI Assistant Modal
 * Developed by: Web Era Solutions | Made with ❤️ by Web Era Solutions
 */

:root {
  --gv-search-primary: #10B981;
  --gv-search-primary-dark: #059669;
  --gv-search-navy: #0B1B3D;
  --gv-search-navy-light: #162B56;
  --gv-search-bg-sand: #F6F1E7;
  --gv-search-card-border: #E2E8F0;
  --gv-search-text-dark: #0F172A;
  --gv-search-text-muted: #64748B;
  --gv-search-ai-gradient: linear-gradient(135deg, #6366F1, #8B5CF6, #EC4899);
}

/* 1. SMART SEARCH BAR */
.gv-smart-search-box {
  position: relative;
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
}

.gv-smart-search-inner {
  display: flex;
  align-items: center;
  background: #FFFFFF;
  border: 2px solid #E2E8F0;
  border-radius: 9999px;
  padding: 6px 8px 6px 20px;
  box-shadow: 0 10px 25px -5px rgba(11, 27, 61, 0.08), 0 8px 10px -6px rgba(11, 27, 61, 0.04);
  transition: all 0.25s ease;
}

.gv-smart-search-inner:focus-within {
  border-color: var(--gv-search-primary);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.18), 0 12px 28px rgba(11, 27, 61, 0.12);
}

.gv-search-input-icon {
  color: var(--gv-search-text-muted);
  font-size: 18px;
  margin-right: 12px;
  display: flex;
  align-items: center;
}

.gv-search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 16px;
  color: var(--gv-search-text-dark);
  outline: none;
  font-family: inherit;
  padding: 8px 0;
  min-width: 120px;
}

.gv-search-input::placeholder {
  color: #94A3B8;
  font-size: 15px;
}

.gv-search-clear-btn {
  background: transparent;
  border: none;
  color: #94A3B8;
  padding: 6px;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}
.gv-search-clear-btn:hover {
  color: #EF4444;
}

.gv-search-actions-group {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
}

/* Voice Search Button */
.gv-btn-voice {
  background: #F1F5F9;
  border: 1px solid #E2E8F0;
  color: #475569;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.gv-btn-voice:hover {
  background: #E2E8F0;
  color: var(--gv-search-navy);
  transform: scale(1.05);
}

.gv-btn-voice.listening {
  background: #FEE2E2;
  border-color: #EF4444;
  color: #EF4444;
  animation: pulseVoice 1.4s infinite;
}

@keyframes pulseVoice {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
  70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* AI Assistant Button */
.gv-btn-ai {
  background: var(--gv-search-ai-gradient);
  border: none;
  color: #FFFFFF;
  padding: 0 16px;
  height: 42px;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
  transition: all 0.25s ease;
}

.gv-btn-ai:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(139, 92, 246, 0.45);
  filter: brightness(1.05);
}

.gv-btn-ai i {
  font-size: 14px;
}

/* Search Submit Button */
.gv-btn-submit {
  background: var(--gv-search-primary);
  border: none;
  color: #FFFFFF;
  padding: 0 20px;
  height: 42px;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  transition: all 0.2s ease;
}

.gv-btn-submit:hover {
  background: var(--gv-search-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

/* 2. AUTOCOMPLETE SUGGESTIONS DROPDOWN */
.gv-search-suggestions {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 20px;
  box-shadow: 0 20px 35px -10px rgba(11, 27, 61, 0.15);
  z-index: 1050;
  overflow: hidden;
  display: none;
  animation: dropIn 0.2s ease-out;
}

@keyframes dropIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.gv-suggestion-group {
  padding: 10px 16px 6px;
}

.gv-suggestion-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #94A3B8;
  margin-bottom: 6px;
}

.gv-suggestion-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--gv-search-text-dark);
  text-decoration: none;
  transition: background 0.15s ease;
  cursor: pointer;
}

.gv-suggestion-item:hover, .gv-suggestion-item.active {
  background: #F8FAFC;
  color: var(--gv-search-primary-dark);
}

.gv-suggestion-thumb {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
  background: #E2E8F0;
  margin-right: 12px;
  flex-shrink: 0;
}

/* 3. GRID & LIST VIEW STYLES */
.gv-view-toggle-wrap {
  display: inline-flex;
  background: #F1F5F9;
  padding: 3px;
  border-radius: 12px;
  border: 1px solid #E2E8F0;
}

.gv-view-btn {
  border: none;
  background: transparent;
  color: #64748B;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.gv-view-btn.active {
  background: #FFFFFF;
  color: var(--gv-search-navy);
  box-shadow: 0 2px 6px rgba(11, 27, 61, 0.08);
}

/* Grid Layout */
.gv-search-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.gv-card-item {
  background: #FFFFFF;
  border: 1px solid var(--gv-search-card-border);
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(11, 27, 61, 0.03);
}

.gv-card-item:hover {
  transform: translateY(-4px);
  border-color: #CBD5E1;
  box-shadow: 0 16px 30px -10px rgba(11, 27, 61, 0.1);
}

.gv-card-media {
  position: relative;
  width: 100%;
  height: 200px;
  background: #F8FAFC;
  overflow: hidden;
}

.gv-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.gv-card-item:hover .gv-card-img {
  transform: scale(1.05);
}

.gv-card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
}

.gv-card-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.gv-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--gv-search-text-dark);
  line-height: 1.35;
  margin-bottom: 6px;
}

.gv-card-store {
  font-size: 13px;
  color: var(--gv-search-text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 12px;
}

.gv-card-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid #F1F5F9;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gv-card-price {
  font-size: 18px;
  font-weight: 800;
  color: var(--gv-search-navy);
}

/* List Layout */
.gv-search-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.gv-search-list .gv-card-item {
  flex-direction: row;
  height: auto;
  min-height: 160px;
}

.gv-search-list .gv-card-media {
  width: 220px;
  min-width: 220px;
  height: auto;
}

@media (max-width: 768px) {
  .gv-search-list .gv-card-item {
    flex-direction: column;
  }
  .gv-search-list .gv-card-media {
    width: 100%;
    height: 190px;
  }
}

/* 4. VOICE SEARCH MODAL */
.gv-voice-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 27, 61, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.gv-voice-modal-card {
  background: #FFFFFF;
  border-radius: 28px;
  max-width: 520px;
  width: 100%;
  padding: 36px 32px;
  text-align: center;
  box-shadow: 0 25px 50px -12px rgba(11, 27, 61, 0.25);
  position: relative;
}

.gv-voice-wave-wrap {
  width: 90px;
  height: 90px;
  margin: 0 auto 20px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gv-voice-wave-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.15);
  animation: wavePulse 1.8s ease-out infinite;
}

.gv-voice-wave-ring:nth-child(2) {
  animation-delay: 0.6s;
}

@keyframes wavePulse {
  0% { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(1.8); opacity: 0; }
}

.gv-voice-mic-core {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #EF4444;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  position: relative;
  z-index: 2;
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
}

.gv-voice-live-text {
  min-height: 60px;
  background: #F8FAFC;
  border: 1px dashed #CBD5E1;
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 16px;
  color: var(--gv-search-text-dark);
  margin: 16px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* 5. AI ASSISTANT MODAL & DRAWER */
.gv-ai-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 27, 61, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 2000;
  display: flex;
  justify-content: flex-end;
  animation: fadeIn 0.2s ease;
}

.gv-ai-drawer {
  background: #FFFFFF;
  width: 100%;
  max-width: 520px;
  height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 35px rgba(11, 27, 61, 0.2);
  animation: slideDrawer 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideDrawer {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.gv-ai-header {
  padding: 20px 24px;
  background: var(--gv-search-navy);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gv-ai-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #F8FAFC;
}

.gv-ai-msg {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
}

.gv-ai-msg.bot {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  color: var(--gv-search-text-dark);
  align-self: flex-start;
  box-shadow: 0 2px 6px rgba(11, 27, 61, 0.04);
}

.gv-ai-msg.user {
  background: var(--gv-search-primary);
  color: #FFFFFF;
  align-self: flex-end;
}

.gv-ai-footer {
  padding: 16px 20px;
  background: #FFFFFF;
  border-top: 1px solid #E2E8F0;
}

/* Mobile Adjustments */
@media (max-width: 576px) {
  .gv-smart-search-inner {
    padding: 4px 6px 4px 14px;
  }
  .gv-btn-ai span {
    display: none;
  }
  .gv-btn-ai {
    padding: 0 12px;
    width: 40px;
    height: 40px;
    justify-content: center;
  }
  .gv-btn-voice {
    width: 38px;
    height: 38px;
    font-size: 15px;
  }
  .gv-btn-submit {
    padding: 0 14px;
    font-size: 13px;
  }
  .gv-btn-submit span {
    display: none;
  }
  .gv-search-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .gv-smart-search-inner {
    padding: 3px 4px 3px 10px;
    gap: 4px;
  }
  .gv-search-input-icon {
    font-size: 15px;
    margin-right: 6px;
  }
  .gv-search-input {
    font-size: 14px;
    min-width: 0;
  }
  .gv-search-actions-group {
    gap: 4px;
    margin-left: 4px;
  }
  .gv-btn-voice, .gv-btn-ai, .gv-btn-submit {
    width: 35px;
    height: 35px;
    min-height: 35px;
    padding: 0;
    justify-content: center;
  }
  .gv-btn-submit {
    padding: 0 10px;
  }
}

@media (max-width: 340px) {
  .gv-btn-voice {
    display: none;
  }
}
