@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --bg-dark: #090a0f;
  --bg-card: rgba(17, 19, 31, 0.65);
  --bg-sidebar: rgba(11, 13, 23, 0.85);
  --border-glass: rgba(255, 255, 255, 0.07);
  --border-focus: rgba(99, 102, 241, 0.4);
  
  --primary: #6366f1;
  --primary-glow: rgba(99, 102, 241, 0.15);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #475569;
  
  /* Icon Customizer Properties */
  --custom-size: 36px;
  --custom-stroke: 2px;
  --custom-color: #f8fafc;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  overflow: hidden;
}

/* Layout Structure */
.app-container {
  display: flex;
  width: 100%;
  height: 100vh;
  position: relative;
}

/* Sidebar Styling */
.sidebar {
  width: 320px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  height: 100%;
  backdrop-filter: blur(20px);
  z-index: 10;
}

.brand-section {
  padding: 24px;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.35);
}

.brand-logo i {
  color: #fff;
  font-size: 1.25rem;
}

.brand-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(135deg, #f8fafc 40%, #c084fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.version-tag {
  font-size: 0.65rem;
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(99, 102, 241, 0.3);
  margin-left: auto;
  font-weight: 600;
}

.category-nav {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.section-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}

.category-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 24px;
}

.category-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.9rem;
  font-weight: 500;
}

.category-item:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
}

.category-item.active {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.12) 0%, rgba(168, 85, 247, 0.02) 100%);
  color: #818cf8;
  border-left: 3px solid var(--primary);
  font-weight: 600;
}

.category-count {
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 6px;
  border-radius: 99px;
  color: var(--text-secondary);
}

.category-item.active .category-count {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
}

/* Main Content Styling */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(circle at 80% 10%, rgba(99, 102, 241, 0.04) 0%, transparent 60%);
}

/* Top Toolbar */
.top-bar {
  padding: 24px 40px;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.search-wrapper {
  position: relative;
  width: 420px;
}

.search-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  padding: 12px 16px 12px 44px;
  border-radius: 12px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s ease;
}

.search-input:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

.search-icon-el {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  pointer-events: none;
}

.cdn-badge-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  padding: 10px 18px;
  border-radius: 10px;
  cursor: pointer;
  color: var(--text-secondary);
  font-weight: 500;
  transition: all 0.2s ease;
  font-size: 0.85rem;
}

.cdn-badge-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--primary);
  color: var(--text-primary);
}

/* Customizer Bar (Right above Grid) */
.customizer-bar {
  padding: 16px 40px;
  background: rgba(17, 19, 31, 0.3);
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.control-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.control-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.custom-range {
  -webkit-appearance: none;
  width: 100px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  outline: none;
}

.custom-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
  transition: all 0.15s ease;
}

.custom-range::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.color-swatches {
  display: flex;
  gap: 6px;
}

.swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.15s ease;
}

.swatch:hover {
  transform: scale(1.2);
}

.swatch.active {
  border-color: #fff;
  transform: scale(1.15);
  box-shadow: 0 0 8px currentColor;
}

.effect-toggles {
  display: flex;
  gap: 6px;
}

.effect-btn {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 600;
}

.effect-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.effect-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 12px var(--primary-glow);
}

/* Grid Panel Container */
.grid-panel {
  flex: 1;
  overflow-y: auto;
  padding: 40px;
}

.catalog-header-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.catalog-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
}

.catalog-title span {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-left: 8px;
}

/* Dynamic Grid */
.icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 16px;
}

.icon-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.icon-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.03);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3), 0 0 15px rgba(99, 102, 241, 0.08);
}

.icon-card-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-size: var(--custom-size);
  color: var(--custom-color);
}

.icon-card-preview svg {
  stroke-width: var(--custom-stroke) !important;
}

.icon-card-name {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: center;
  word-break: break-all;
  max-width: 100%;
}

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

/* Modal / Drawer details panel */
.details-drawer {
  position: absolute;
  top: 0;
  right: -420px;
  width: 420px;
  height: 100%;
  background: rgba(10, 11, 18, 0.95);
  border-left: 1px solid var(--border-glass);
  backdrop-filter: blur(24px);
  z-index: 100;
  transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  box-shadow: -20px 0 50px rgba(0, 0, 0, 0.5);
}

.details-drawer.open {
  right: 0;
}

.drawer-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
}

.close-drawer {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.25rem;
  transition: color 0.15s ease;
}

.close-drawer:hover {
  color: #ef4444;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.drawer-preview-card {
  width: 100%;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  aspect-ratio: 1.6;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.drawer-preview-icon {
  font-size: 64px;
}

.drawer-preview-icon svg {
  stroke-width: 2px !important;
}

.drawer-metadata {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  padding-bottom: 8px;
}

.meta-key {
  color: var(--text-muted);
  font-weight: 600;
}

.meta-value {
  color: var(--text-primary);
  font-weight: 500;
}

.code-snippet-box {
  width: 100%;
  background: #040508;
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  padding: 14px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.code-snippet {
  font-family: 'Space Grotesk', monospace;
  font-size: 0.8rem;
  color: #a5b4fc;
  overflow-x: auto;
  white-space: nowrap;
  max-width: 80%;
}

.copy-snippet-btn {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: #818cf8;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.15s ease;
  font-weight: 600;
}

.copy-snippet-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.copy-snippet-btn.success {
  background: #10b981;
  color: #fff;
  border-color: #10b981;
}

.drawer-actions {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 12px;
}

.btn-primary-action {
  width: 100%;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #fff;
  border: none;
  padding: 12px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  font-size: 0.9rem;
}

.btn-primary-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

/* Alert Notification */
.toast-alert {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #10b981;
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.35);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 1000;
}

.toast-alert.show {
  transform: translateX(-50%) translateY(0);
}

/* CDN Dialog Modal */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.cdn-modal {
  background: #0f111a;
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  width: 520px;
  max-width: 90%;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.open .cdn-modal {
  transform: scale(1);
}

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

.modal-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
}

.close-modal {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.5rem;
}

.close-modal:hover {
  color: #ef4444;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .sidebar {
    width: 250px;
  }
  .search-wrapper {
    width: 100%;
  }
  .top-bar {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px;
  }
  .cdn-badge-btn {
    width: 100%;
    justify-content: center;
  }
  .customizer-bar {
    padding: 16px;
  }
}
