/* ==================== DESIGN SYSTEM & TOKENS ==================== */
:root {
  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Color Palette (Premium Light Theme) */
  --bg-main: #f8fafc;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --border-color: rgba(15, 23, 42, 0.08);
  --border-focus: rgba(255, 107, 0, 0.4);
  
  --primary: #ff6b00;
  --primary-hover: #ff8522;
  --primary-gradient: linear-gradient(135deg, #ff5100 0%, #ff8800 100%);
  --secondary: #f1f5f9;
  --secondary-hover: #e2e8f0;
  
  --accent-blue: #0284c7;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-dark: #0f172a;
  
  --success: #10b981;
  --danger: #ef4444;
  
  /* Layout & Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 4px 18px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 20px 40px rgba(15, 23, 42, 0.12);
  --shadow-glow: 0 0 20px rgba(255, 107, 0, 0.08);
  
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== GLOBAL STYLES ==================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  letter-spacing: -0.02em;
}

button, input, select, textarea {
  font-family: inherit;
  color: inherit;
}

.hidden {
  display: none !important;
}

/* ==================== COMPONENT STYLES: BUTTONS ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
}

.btn-primary {
  background: var(--primary-gradient);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(255, 81, 0, 0.2);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(255, 81, 0, 0.3);
}

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

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

.btn-danger {
  background-color: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.btn-danger:hover {
  background-color: var(--danger);
  color: white;
}

.btn-text {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 6px 12px;
}

.btn-text:hover {
  color: var(--text-main);
  background-color: rgba(15, 23, 42, 0.04);
}

.btn-icon {
  background: none;
  border: none;
  padding: 8px;
  border-radius: 50%;
  color: var(--text-muted);
}

.btn-icon:hover {
  color: var(--text-main);
  background-color: rgba(15, 23, 42, 0.05);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.btn-block {
  width: 100%;
}

/* ==================== COMPONENT STYLES: FORMS ==================== */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.form-group input, .form-group select {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text-main);
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.form-group input:focus, .form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 8px rgba(255, 107, 0, 0.15);
}

.disabled-input {
  background-color: #f1f5f9 !important;
  opacity: 0.7;
  cursor: not-allowed;
}

.input-lg {
  font-size: 18px !important;
  font-weight: 600;
  padding: 12px 16px !important;
}

.char-counter {
  font-size: 11px;
  color: var(--text-muted);
  text-align: right;
}

/* ==================== 1. ZIP YÜKLEME EKRANI (UPLOAD SCREEN) ==================== */
.upload-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  position: relative;
  z-index: 10;
  background-color: var(--bg-main);
  padding: 20px;
}

.glow-bg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255,107,0,0.06) 0%, rgba(255,107,0,0) 70%);
  z-index: -1;
  pointer-events: none;
  filter: blur(40px);
}

.upload-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 40px;
  max-width: 500px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.logo-area {
  margin-bottom: 30px;
}

.logo-icon {
  width: 48px;
  height: 48px;
  color: var(--primary);
  margin-bottom: 12px;
}

.logo-area h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 2px;
  background: linear-gradient(to right, var(--primary), #d97706);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-area p {
  color: var(--text-muted);
  font-size: 14px;
}

.drop-zone {
  border: 2px dashed rgba(15, 23, 42, 0.15);
  border-radius: var(--radius-md);
  padding: 40px 20px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  background: rgba(15, 23, 42, 0.01);
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--primary);
  background: rgba(255, 107, 0, 0.02);
}

.upload-icon {
  width: 40px;
  height: 40px;
  color: var(--text-muted);
  margin-bottom: 16px;
  transition: var(--transition);
}

.drop-zone:hover .upload-icon {
  color: var(--primary);
  transform: translateY(-4px);
}

.drop-zone h3 {
  font-size: 16px;
  margin-bottom: 6px;
}

.drop-zone p {
  font-size: 13px;
  color: var(--text-muted);
}

.hidden-file-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.upload-actions {
  margin-top: 24px;
  display: flex;
  justify-content: center;
}

.upload-notes {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  font-size: 11px;
  color: var(--text-muted);
}

.upload-notes i {
  width: 14px;
  height: 14px;
  vertical-align: text-bottom;
  color: var(--success);
  margin-right: 4px;
}

/* ==================== 2. WORKSPACE CONTAINER (MAIN LAYOUT) ==================== */
.workspace-container {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* Sidebar Styling */
.sidebar {
  width: 280px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  box-shadow: 2px 0 10px rgba(15, 23, 42, 0.02);
}

.sidebar-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-color);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 28px;
  height: 28px;
  color: var(--primary);
}

.brand h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-main);
}

.sub-badge {
  font-size: 10px;
  background-color: rgba(255, 107, 0, 0.1);
  color: var(--primary);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.sidebar-nav {
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-grow: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: none;
  background: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
}

.nav-item:hover {
  color: var(--text-main);
  background-color: rgba(15, 23, 42, 0.04);
}

.nav-item.active {
  color: var(--primary);
  background-color: var(--secondary);
  font-weight: 600;
  border-left: 3px solid var(--primary);
}

.sidebar-footer {
  padding: 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #f8fafc;
}

.device-info {
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 12px;
  font-size: 12px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.info-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}

.info-row:last-child {
  margin-bottom: 0;
}

.info-row .lbl {
  color: var(--text-muted);
}

.info-row .val {
  font-weight: 600;
  color: var(--text-main);
}

/* Main Content Area */
.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
}

.content-header {
  padding: 24px 40px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.header-title-area h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-main);
}

.header-title-area p {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 4px;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  background-color: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.15);
  color: var(--success);
  padding: 4px 10px;
  border-radius: 20px;
}

.status-badge.saving {
  background-color: rgba(255, 107, 0, 0.08);
  border-color: rgba(255, 107, 0, 0.15);
  color: var(--primary);
}

/* Tab Management */
.tab-contents {
  padding: 40px;
  flex-grow: 1;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* ==================== 3. RECIPES TAB & GRIDS ==================== */
.recipes-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  font-size: 14px;
}

.path-text {
  font-weight: 600;
  color: var(--primary);
}

.grid-layout {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}

/* Card item */
.grid-item {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  min-height: 180px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.grid-item:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.grid-item.dragging {
  opacity: 0.4;
  border-style: dashed;
  border-color: var(--primary);
  transform: scale(0.98);
}

.grid-item.drag-over {
  border-color: var(--primary);
  background-color: var(--bg-card-hover);
  transform: scale(1.04);
  box-shadow: var(--shadow-md);
}

.grid-item-img {
  width: 76px;
  height: 76px;
  border-radius: var(--radius-md);
  object-fit: cover;
  background-color: #f1f5f9;
  border: 1px solid rgba(15, 23, 42, 0.05);
  margin-bottom: 12px;
}

.grid-item-name {
  font-size: 13px;
  font-weight: 600;
  word-break: break-word;
  color: var(--text-main);
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.grid-item-badge {
  font-size: 10px;
  font-weight: 700;
  background-color: rgba(15, 23, 42, 0.04);
  color: var(--text-muted);
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 8px;
}

/* Edit button inside grid items */
.grid-item-edit-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  z-index: 10;
  box-shadow: var(--shadow-sm);
}

.grid-item-edit-btn:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 4px 8px rgba(255, 107, 0, 0.2);
}

.grid-item-edit-btn svg {
  width: 14px;
  height: 14px;
}

.grid-item.empty {
  border-style: dashed;
  background: rgba(15, 23, 42, 0.01);
  opacity: 0.6;
}

.grid-item.empty:hover {
  opacity: 1;
  border-style: solid;
  background-color: var(--bg-card);
}

.grid-item.empty .grid-item-img {
  filter: opacity(0.3) grayscale(1);
}

/* ==================== 4. GENERAL SETTINGS PANELS ==================== */
.settings-form-layout {
  display: flex;
  flex-direction: column;
  gap: 30px;
  max-width: 800px;
}

.settings-section {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.settings-section h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
  color: var(--primary);
}

.settings-section h3 i {
  width: 18px;
  height: 18px;
}

/* ==================== 5. FAVORITES LAYOUT ==================== */
.fav-header {
  margin-bottom: 24px;
  font-size: 14px;
  color: var(--text-muted);
}

.fav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.fav-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.fav-card:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.fav-num {
  font-size: 11px;
  font-weight: 700;
  background-color: var(--primary);
  color: white;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fav-info {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fav-title {
  font-size: 13px;
  font-weight: 600;
}

.fav-select {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 4px 6px;
  font-size: 12px;
  width: 100%;
  color: var(--text-main);
  outline: none;
}

.fav-select:focus {
  border-color: var(--primary);
}

/* ==================== 6. RECIPE EDITOR DRAWER ==================== */
.editor-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  z-index: 100;
  visibility: hidden;
  transition: var(--transition);
}

.editor-drawer.open {
  visibility: visible;
}

.drawer-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.editor-drawer.open .drawer-overlay {
  opacity: 1;
}

.drawer-content {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 580px;
  height: 100%;
  background-color: #ffffff;
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.editor-drawer.open .drawer-content {
  transform: translateX(0);
}

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

.title-wrap h2 {
  font-size: 20px;
  margin-top: 6px;
  color: var(--text-main);
}

.badge {
  font-size: 10px;
  font-weight: 700;
  background-color: rgba(255, 107, 0, 0.1);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: 20px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

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

.editor-row {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.editor-meta-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 20px;
}

/* Image preview container */
.icon-selector-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.icon-preview-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.img-preview {
  width: 90px;
  height: 90px;
  border-radius: var(--radius-md);
  object-fit: cover;
  background-color: #f1f5f9;
  border: 1px solid var(--border-color);
}

.icon-upload-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.file-upload-label {
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Switch styling for Group Active Toggle */
.toggle-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background-color: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.toggle-title {
  font-size: 14px;
  font-weight: 600;
  display: block;
}

.toggle-desc {
  font-size: 12px;
  color: var(--text-muted);
}

.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider-round {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: .25s;
  border-radius: 34px;
}

.slider-round:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .25s;
  border-radius: 50%;
}

input:checked + .slider-round {
  background-color: var(--primary);
}

input:checked + .slider-round:before {
  transform: translateX(24px);
}

/* Step Editor styling */
.editor-steps-wrap {
  border-top: 1px solid var(--border-color);
  padding-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.steps-tabs {
  display: flex;
  background-color: #f1f5f9;
  border-radius: var(--radius-md);
  padding: 4px;
}

.step-tab-btn {
  flex-grow: 1;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: none;
  border: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.step-tab-btn:hover {
  color: var(--text-main);
}

.step-tab-btn.active {
  background-color: #ffffff;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.step-content-box {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.step-enable-row {
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

/* Custom Checkbox */
.checkbox-container {
  display: block;
  position: relative;
  padding-left: 28px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  user-select: none;
  color: var(--text-main);
}

.checkbox-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkmark {
  position: absolute;
  top: 0;
  left: 0;
  height: 18px;
  width: 18px;
  background-color: #e2e8f0;
  border-radius: 4px;
  transition: var(--transition);
}

.checkbox-container:hover input ~ .checkmark {
  background-color: #cbd5e1;
}

.checkbox-container input:checked ~ .checkmark {
  background-color: var(--primary);
}

.checkmark:after {
  content: "";
  position: absolute;
  display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
  display: block;
}

.checkbox-container .checkmark:after {
  left: 6px;
  top: 3px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Sliders within Steps */
.step-sliders-group {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.slider-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 500;
}

.slider-header .lbl {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.slider-header .lbl i {
  width: 14px;
  height: 14px;
}

.val-input-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--primary);
  font-weight: 700;
}

.val-input {
  width: 50px;
  padding: 2px 4px;
  border: 1px solid var(--border-color);
  background: #ffffff;
  border-radius: var(--radius-xs);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  text-align: center;
  outline: none;
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.val-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.15);
}

/* Remove number input spinner arrows */
.val-input::-webkit-outer-spin-button,
.val-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.val-input[type=number] {
  -moz-appearance: textfield;
}

.val-unit {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

/* Custom HTML5 Range styling */
input[type=range] {
  -webkit-appearance: none;
  width: 100%;
  background: transparent;
}

input[type=range]:focus {
  outline: none;
}

input[type=range]::-webkit-slider-runnable-track {
  width: 100%;
  height: 6px;
  cursor: pointer;
  background: #e2e8f0;
  border-radius: 4px;
}

input[type=range]::-webkit-slider-thumb {
  height: 18px;
  width: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  -webkit-appearance: none;
  margin-top: -6px;
  transition: transform 0.1s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

input[type=range]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

/* Drawer Footer */
.drawer-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #f8fafc;
}

.footer-save-actions {
  display: flex;
  gap: 12px;
}

/* ==================== 7. ICON SELECTION MODAL ==================== */
.modal-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  z-index: 10;
}

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

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex-grow: 1;
}

.icon-modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 12px;
}

.icon-modal-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 6px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.icon-modal-item:hover {
  border-color: var(--primary);
  background-color: rgba(255, 107, 0, 0.03);
  transform: scale(1.05);
}

.icon-modal-img {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  object-fit: cover;
}

.icon-modal-id {
  font-size: 9px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ==================== 8. UTILITIES & ANIMATIONS ==================== */
.text-green {
  color: var(--success);
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .5; }
}

/* Custom Scrollbar for modern feel */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}
