/* SmartRoom.uk — Premium Dark Theme */

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #1a1a28;
  --bg-card-hover: #22223a;
  --bg-glass: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.15);
  --text-primary: #f0f0f5;
  --text-secondary: #8888a0;
  --text-muted: #55556a;
  --accent: #6c5ce7;
  --accent-light: #a29bfe;
  --accent-glow: rgba(108, 92, 231, 0.3);
  --green: #00d2a0;
  --green-glow: rgba(0, 210, 160, 0.2);
  --red: #ff6b6b;
  --orange: #ffa94d;
  --blue: #4dabf7;
  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* === NAVIGATION === */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 700;
  font-size: 20px;
}

.logo-icon { font-size: 24px; }
.logo-text { color: var(--text-primary); }
.logo-accent { color: var(--accent-light); }

.nav-links {
  display: flex;
  gap: 4px;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

.nav-link:hover { color: var(--text-primary); background: var(--bg-glass); }
.nav-link.active { color: var(--accent-light); background: rgba(108, 92, 231, 0.1); }

.protocol-select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font);
  cursor: pointer;
}

/* === HERO === */
.hero {
  position: relative;
  padding: 140px 24px 80px;
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(ellipse at 30% 20%, rgba(108, 92, 231, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(0, 210, 160, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(108, 92, 231, 0.05) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  max-width: 800px;
  width: 100%;
  text-align: center;
}

.hero-title {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent-light), var(--green), var(--blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 40px;
  line-height: 1.6;
}

/* === SEARCH BOX === */
.search-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  box-shadow: var(--shadow), 0 0 60px var(--accent-glow);
  transition: border-color 0.3s, box-shadow 0.3s;
}

.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: var(--shadow), 0 0 80px var(--accent-glow);
}

.search-ai-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-light);
  margin-bottom: 12px;
}

.ai-icon {
  font-size: 16px;
  animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.2); }
}

.toggle {
  position: relative;
  width: 36px;
  height: 20px;
  cursor: pointer;
}

.toggle input { display: none; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--text-muted);
  border-radius: 10px;
  transition: 0.3s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 2px;
  top: 2px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
}

.toggle input:checked + .toggle-slider { background: var(--accent); }
.toggle input:checked + .toggle-slider::before { transform: translateX(16px); }

.search-input-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 16px;
  font-family: var(--font);
  resize: none;
  outline: none;
  min-height: 24px;
  max-height: 120px;
}

.search-input::placeholder { color: var(--text-muted); }

.search-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.search-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 20px var(--accent-glow); }
.search-btn:active { transform: translateY(0); }
.search-btn-icon { font-size: 18px; }

.search-suggestions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.suggestion {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.2s;
}

.suggestion:hover { 
  border-color: var(--accent); 
  color: var(--accent-light); 
  background: rgba(108, 92, 231, 0.1); 
}

/* === AI ANALYSIS === */
.ai-analysis {
  margin-top: 20px;
  background: var(--bg-card);
  border: 1px solid rgba(108, 92, 231, 0.2);
  border-radius: var(--radius);
  padding: 16px 20px;
  text-align: left;
  animation: fadeIn 0.3s ease;
}

.ai-analysis-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-light);
  margin-bottom: 8px;
}

.ai-explanation {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.ai-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.ai-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.ai-tag.protocol { background: rgba(0, 210, 160, 0.1); color: var(--green); border: 1px solid rgba(0, 210, 160, 0.2); }
.ai-tag.room { background: rgba(77, 171, 247, 0.1); color: var(--blue); border: 1px solid rgba(77, 171, 247, 0.2); }
.ai-tag.keyword { background: rgba(108, 92, 231, 0.1); color: var(--accent-light); border: 1px solid rgba(108, 92, 231, 0.2); }

/* === SECTIONS === */
.results-section, .radar-section, .configurator-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.section-header h2 {
  font-size: 24px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-desc {
  color: var(--text-secondary);
  font-size: 15px;
  width: 100%;
}

.sort-select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font);
  cursor: pointer;
}

/* === PRODUCTS GRID === */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

/* === PRODUCT CARD === */
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
}

.product-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.product-image {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--bg-secondary);
}

.product-body { padding: 14px; }

.product-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 10px;
  line-height: 1.4;
}

.product-price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}

.product-price {
  font-size: 20px;
  font-weight: 700;
  color: var(--green);
}

.product-original-price {
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: line-through;
}

.product-discount {
  font-size: 12px;
  font-weight: 600;
  color: var(--red);
  background: rgba(255, 107, 107, 0.1);
  padding: 2px 8px;
  border-radius: 6px;
}

.product-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.product-rating { color: var(--orange); }
.product-volume { color: var(--text-muted); }

.product-insight {
  font-size: 12px;
  color: var(--accent-light);
  background: rgba(108, 92, 231, 0.08);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  line-height: 1.4;
}

.product-value-score {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(8px);
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
}

.score-high { color: var(--green); border: 1px solid var(--green-glow); }
.score-mid { color: var(--orange); border: 1px solid rgba(255, 169, 77, 0.2); }
.score-low { color: var(--text-muted); border: 1px solid var(--border); }

.product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--red);
  color: white;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.product-buy-btn {
  display: block;
  width: 100%;
  padding: 10px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  text-decoration: none;
}

.product-buy-btn:hover { opacity: 0.9; transform: translateY(-1px); }

/* === ROOM TEMPLATES === */
.room-templates {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin-bottom: 32px;
}

.room-template-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: all 0.3s;
}

.room-template-card:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.room-template-icon { font-size: 32px; margin-bottom: 10px; }
.room-template-name { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.room-template-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }

/* === CONFIG FORM === */
.config-form {
  animation: fadeIn 0.3s ease;
}

.config-form-inner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.config-form-inner h3 {
  font-size: 20px;
  margin-bottom: 20px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full-width { margin-bottom: 20px; }

.form-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-input {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font);
  transition: border-color 0.2s;
}

.form-input:focus { outline: none; border-color: var(--accent); }

.config-submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--accent), var(--green));
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.2s;
}

.config-submit-btn:hover { opacity: 0.9; transform: translateY(-1px); }

/* === CONFIG RESULTS === */
.config-results {
  animation: fadeIn 0.3s ease;
}

.config-package {
  background: var(--bg-card);
  border: 1px solid rgba(108, 92, 231, 0.2);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 24px;
}

.config-package-name {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--accent-light);
}

.config-package-desc {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.config-package-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 14px;
  margin-bottom: 24px;
}

.config-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-glass);
  border-radius: 8px;
}

.config-product-group { margin-bottom: 24px; }

.config-product-group h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
  padding-left: 4px;
}

/* === DEALS CATEGORIES === */
.deals-category {
  margin-bottom: 36px;
}

.deals-category-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 14px;
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: inline-block;
}

/* === LOADING === */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(10, 10, 15, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-spinner { text-align: center; }

.spinner-ring {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-text {
  font-size: 15px;
  color: var(--text-secondary);
}

.pulse-dot {
  width: 12px;
  height: 12px;
  background: var(--green);
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.radar-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  font-size: 15px;
  color: var(--text-secondary);
}

/* === LOAD MORE === */
.load-more {
  text-align: center;
  padding: 32px;
}

.load-more-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 12px 32px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.2s;
}

.load-more-btn:hover { border-color: var(--accent); }

/* === MODAL === */
.modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 28px;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover { color: var(--text-primary); }

/* === FOOTER === */
.footer {
  border-top: 1px solid var(--border);
  padding: 48px 24px 32px;
  background: var(--bg-secondary);
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
}

.footer-brand { margin-bottom: 32px; }
.footer-tagline { color: var(--text-muted); font-size: 14px; margin-top: 8px; }

.footer-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 32px;
  margin-bottom: 32px;
}

.footer-col h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.footer-col a {
  display: block;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  padding: 4px 0;
  transition: color 0.2s;
}

.footer-col a:hover { color: var(--accent-light); }

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}

.footer-bottom p { margin-bottom: 4px; }

/* === ANIMATIONS === */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeIn 0.3s ease; }

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .nav-links { display: none; }
  
  .hero { padding: 100px 16px 60px; min-height: auto; }
  .hero-title { font-size: 28px; }
  .hero-subtitle { font-size: 15px; }
  
  .search-box { padding: 14px 16px; }
  .search-input { font-size: 15px; }
  .search-btn span:last-child { display: none; }
  
  .search-suggestions { gap: 6px; }
  .suggestion { font-size: 12px; padding: 5px 10px; }
  
  .products-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .product-title { font-size: 13px; }
  .product-price { font-size: 17px; }
  .product-body { padding: 10px; }
  
  .room-templates { grid-template-columns: repeat(2, 1fr); }
  
  .form-grid { grid-template-columns: 1fr; }
  
  .results-section, .radar-section, .configurator-section {
    padding: 24px 16px 60px;
  }
  
  .section-header h2 { font-size: 20px; }
  
  .footer-links { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .products-grid { grid-template-columns: 1fr; }
  .room-templates { grid-template-columns: 1fr; }
}
