:root {
  --primary: #06b6d4; /* Cyan 500 */
  --primary-hover: #0891b2; /* Cyan 600 */
  --primary-light: #cffafe;
  --bg-main: #ffffff;
  --bg-secondary: #f8fafc; /* Slate 50 */
  --text-main: #0f172a; /* Slate 900 */
  --text-muted: #64748b; /* Slate 500 */
  --border-color: #e2e8f0; /* Slate 200 */
  --border-color-hover: #cbd5e1; /* Slate 300 */
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-cyan: 0 10px 15px -3px rgba(6, 182, 212, 0.3);
  
  --font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  overflow-y: scroll;
}

/* Typography */
h1, h2, h3 { font-weight: 600; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* Layout */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */
.site-header {
  padding: 2rem 0;
  border-bottom: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
}

/* Search & Filter Area */
.toolbar {
  padding: 2rem 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.search-wrapper {
  position: relative;
  width: 100%;
}

.search-input {
  width: 100%;
  padding: 0.875rem 1rem;
  font-size: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background-color: var(--bg-main);
  color: var(--text-main);
  transition: border-color 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--text-muted);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.filter-btn {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-main);
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  background: var(--bg-secondary);
}

.filter-btn.active {
  background: var(--bg-secondary);
  border-color: var(--border-color-hover);
  color: var(--text-main);
}

/* Grid */
.icons-count {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1rem;
  padding-bottom: 4rem;
}

.icon-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.5rem 1rem;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  cursor: pointer;
  aspect-ratio: 1;
  transition: border-color 0.2s;
}

.icon-card:hover {
  border-color: var(--border-color-hover);
}

.icon-preview {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-preview svg {
  width: 100%;
  height: 100%;
}

.icon-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
  transition: color 0.2s;
}

.icon-card:hover .icon-name {
  color: var(--primary);
}

.empty-state {
  text-align: center;
  padding: 4rem 0;
  color: var(--text-muted);
  grid-column: 1 / -1;
}

/* Details View */
.view {
  height: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.view.active {
  height: auto;
  overflow: visible;
  opacity: 1;
  pointer-events: auto;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.back-nav {
  padding: 2rem 0 1rem;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 1rem;
  cursor: pointer;
  padding: 0.5rem 1rem 0.5rem 0;
  transition: color 0.2s;
}

.btn-back:hover {
  color: var(--primary);
}

.details-container {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 4rem;
  align-items: center;
  padding: 2rem 0 4rem;
}

@media (max-width: 768px) {
  .details-container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

.details-preview {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 32px;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.details-preview svg {
  width: 60%;
  height: 60%;
  filter: drop-shadow(0 20px 30px rgba(0,0,0,0.1));
}

.details-info {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.details-title {
  font-size: 2.5rem;
  color: var(--text-main);
  line-height: 1.2;
}

.details-category {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--primary-light);
  color: var(--primary-hover);
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  align-self: flex-start;
}

.action-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.btn svg {
  width: 20px;
  height: 20px;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow-cyan);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 20px -3px rgba(6, 182, 212, 0.4);
}

.btn-secondary {
  background: var(--bg-main);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--bg-secondary);
  border-color: var(--border-color-hover);
}

.resolution-selector {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  align-items: center;
}

.resolution-selector label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
}

.resolution-selector select {
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-main);
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--text-main);
  cursor: pointer;
  outline: none;
}
.resolution-selector select:focus {
  border-color: var(--primary);
}

/* Related section */
.related-section {
  padding: 4rem 0;
  border-top: 1px solid var(--border-color);
}

.related-title {
  font-size: 1.5rem;
  margin-bottom: 2rem;
}

/* Footer */
.site-footer {
  padding: 3rem 0;
  text-align: center;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: auto;
}

.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--text-main);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  z-index: 100;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Color Picker Slider */
#hueSlider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(to right, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000);
  outline: none;
}

#hueSlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #ccc;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

#hueSlider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #ccc;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
