/* Modern, Premium, Dark & Light Glassmorphism Design System */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  /* HSL Color Palette Tokens */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  
  /* Light Theme Defaults */
  --bg-app: #f8fafc;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --border-color: rgba(226, 232, 240, 0.8);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  --primary: 250 84% 54%; /* Indigo */
  --primary-rgb: 79, 70, 229;
  --secondary: 271 91% 65%; /* Purple */
  --success: 142 71% 45%; /* Emerald */
  --warning: 38 92% 50%; /* Amber */
  --danger: 0 84% 60%; /* Rose */
  
  --primary-gradient: linear-gradient(135deg, hsl(250 84% 54%), hsl(271 91% 65%));
  --accent-glow: radial-gradient(circle at 50% 50%, rgba(79, 70, 229, 0.15), transparent 60%);
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.05), 0 4px 6px -4px rgba(15, 23, 42, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.06), 0 8px 10px -6px rgba(15, 23, 42, 0.06);
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-blur: blur(16px);
  --glass-border: rgba(255, 255, 255, 0.6);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

/* Dark Theme Overrides */
[data-theme="dark"] {
  --bg-app: #0b0f19;
  --bg-sidebar: rgba(15, 23, 42, 0.85);
  --bg-card: rgba(30, 41, 59, 0.45);
  --bg-card-hover: rgba(30, 41, 59, 0.7);
  --border-color: rgba(255, 255, 255, 0.06);
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  
  --primary: 250 95% 65%;
  --primary-rgb: 129, 140, 248;
  --secondary: 271 95% 70%;
  
  --primary-gradient: linear-gradient(135deg, hsl(250 95% 65%), hsl(271 95% 70%));
  --accent-glow: radial-gradient(circle at 50% 50%, rgba(129, 140, 248, 0.12), transparent 70%);
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  --glass-bg: rgba(15, 23, 42, 0.65);
  --glass-blur: blur(20px);
  --glass-border: rgba(255, 255, 255, 0.04);
}

/* Reset & Global */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--bg-app);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Toast Notifications Container */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 380px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  padding: 16px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translateY(20px);
  opacity: 0;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: opacity 0.3s ease, transform 0.3s ease;
  backdrop-filter: var(--glass-blur);
}

.toast.success { border-left: 4px solid hsl(var(--success)); }
.toast.error { border-left: 4px solid hsl(var(--danger)); }
.toast.warning { border-left: 4px solid hsl(var(--warning)); }
.toast.info { border-left: 4px solid hsl(var(--primary)); }

.toast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.toast-content {
  flex-grow: 1;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
}

.toast-close {
  cursor: pointer;
  color: var(--text-muted);
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}
.toast-close:hover {
  color: var(--text-primary);
}

@keyframes slideUp {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Main Layout Grid */
.app-container {
  display: flex;
  flex-grow: 1;
  position: relative;
  min-height: 100vh;
}

/* Sidebar Navigation */
.app-sidebar {
  width: 280px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 100vh;
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.3s ease, border-color 0.3s ease;
  overflow-y: auto;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 12px;
  border-bottom: 1px solid var(--border-color);
}

.logo-icon {
  background: var(--primary-gradient);
  color: #ffffff;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.logo-text {
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.5px;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-search {
  position: relative;
  margin-bottom: 8px;
}

.sidebar-search input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  background: var(--bg-card-hover);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  outline: none;
  transition: all 0.2s ease;
}

.sidebar-search input:focus {
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.sidebar-search i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 16px;
  height: 16px;
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex-grow: 1;
}

.category-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.category-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  color: var(--text-muted);
  padding: 0 12px 6px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.menu-item:hover {
  background-color: var(--bg-card-hover);
  color: var(--text-primary);
}

.menu-item.active {
  background: var(--primary-gradient);
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.menu-item i {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Sidebar Banner Ads Area */
.sidebar-ad-card {
  margin-top: auto;
  background: var(--bg-card-hover);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.ad-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  margin-bottom: 8px;
}

/* Main Panel Area */
.app-main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Top Header Bar */
.app-header {
  height: 70px;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-sidebar);
  backdrop-filter: var(--glass-blur);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 990;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.header-logo {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 10;
}

.header-logo:hover {
  opacity: 0.9;
  transform: translate(-50%, -52%) scale(1.02);
}

.header-logo:active {
  transform: translate(-50%, -48%) scale(0.98);
}

.header-logo .logo-icon-mini {
  background: var(--primary-gradient);
  color: #ffffff;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(79, 70, 229, 0.2);
}

.header-logo .logo-icon-mini i {
  width: 15px !important;
  height: 15px !important;
}

.header-logo .logo-text-mini {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.3px;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-family: inherit;
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 8px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}

.theme-toggle {
  background: var(--bg-card-hover);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-toggle:hover {
  border-color: hsl(var(--primary));
  color: hsl(var(--primary));
}

.theme-toggle i {
  width: 20px;
  height: 20px;
}

/* Main Dashboard & Content */
.main-content {
  padding: 32px 24px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 32px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

/* Hero Section */
.hero-section {
  text-align: center;
  padding: 48px 24px;
  background: var(--accent-glow), var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-badge {
  background: rgba(79, 70, 229, 0.1);
  color: hsl(var(--primary));
  padding: 6px 16px;
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
  border: 1px solid rgba(79, 70, 229, 0.15);
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.15;
  margin-bottom: 12px;
  max-width: 700px;
}

.hero-title span {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  font-weight: 500;
  max-width: 600px;
  margin-bottom: 28px;
  line-height: 1.6;
}

.hero-search {
  position: relative;
  width: 100%;
  max-width: 500px;
}

.hero-search input {
  width: 100%;
  padding: 16px 20px 16px 48px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  outline: none;
  transition: all 0.2s ease;
}

.hero-search input:focus {
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15);
}

.hero-search i {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 20px;
  height: 20px;
}

/* Category Filter Tabs */
.filter-tabs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 auto;
}

.filter-tab {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 10px 20px;
  border-radius: 99px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.filter-tab:hover {
  border-color: hsl(var(--primary));
  color: hsl(var(--primary));
}

.filter-tab.active {
  background: var(--primary-gradient);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

/* Tools Dashboard Grid */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.tool-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--primary-gradient);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: rgba(79, 70, 229, 0.2);
}

.tool-card:hover::before {
  opacity: 1;
}

.tool-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 4px;
  transition: transform 0.3s ease;
}

.tool-card:hover .tool-icon-wrapper {
  transform: scale(1.1);
}

/* Category Specific Card Theme colors */
.cat-dev .tool-icon-wrapper { background: rgba(79, 70, 229, 0.1); color: hsl(250 84% 54%); }
.cat-diag .tool-icon-wrapper { background: rgba(14, 165, 233, 0.1); color: #0ea5e9; }
.cat-text .tool-icon-wrapper { background: rgba(236, 72, 153, 0.1); color: #ec4899; }
.cat-design .tool-icon-wrapper { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.cat-finance .tool-icon-wrapper { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.cat-seo .tool-icon-wrapper { background: rgba(239, 68, 68, 0.1); color: #ef4444; }

.tool-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
}

.tool-card-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
  flex-grow: 1;
}

.tool-card-action {
  font-size: 0.85rem;
  font-weight: 700;
  color: hsl(var(--primary));
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  transition: gap 0.2s ease;
}

.tool-card:hover .tool-card-action {
  gap: 10px;
}

.tool-card-action i {
  width: 16px;
  height: 16px;
}

/* Ad card layout inside grid */
.grid-ad-card {
  grid-column: span 1;
  background: var(--bg-card-hover);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  min-height: 250px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* Active Tool View Panel */
.tool-view-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s ease;
}

.breadcrumb a:hover {
  color: hsl(var(--primary));
}

.breadcrumb i {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
}

.breadcrumb span {
  color: var(--text-primary);
}

.tool-view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.tool-view-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tool-view-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.tool-view-desc {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Responsive Grid Box for Tool IO */
.tool-io-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 992px) {
  .tool-io-grid {
    grid-template-columns: 1fr;
  }
}

.tool-card-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

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

.box-title {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.box-title i {
  width: 18px;
  height: 18px;
  color: hsl(var(--primary));
}

.box-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Buttons System */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--primary-gradient);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.18);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.25);
}
.btn-primary:active {
  transform: translateY(0);
}

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

.btn-success {
  background: hsl(var(--success));
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.18);
}
.btn-success:hover {
  filter: brightness(1.05);
}

.btn-danger {
  background: hsl(var(--danger));
  color: #ffffff;
}
.btn-danger:hover {
  filter: brightness(1.05);
}

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

.btn i {
  width: 16px;
  height: 16px;
}

/* Forms System */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  width: 100%;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.form-control {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-card-hover);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 500;
  outline: none;
  transition: all 0.2s ease;
}

.form-control:focus {
  border-color: hsl(var(--primary));
  background: var(--bg-card);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

textarea.form-control {
  min-height: 220px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.6;
}

textarea.form-control-output {
  background-color: var(--bg-card-hover);
  border-color: var(--border-color);
  cursor: text;
}

/* Custom Checkboxes and Radios */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.checkbox-label input[type="checkbox"],
.checkbox-label input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: hsl(var(--primary));
  cursor: pointer;
}

/* Range Inputs */
input[type="range"] {
  width: 100%;
  accent-color: hsl(var(--primary));
  height: 6px;
  background: var(--border-color);
  border-radius: 99px;
  outline: none;
  cursor: pointer;
}

/* Drag and Drop Zone */
.upload-zone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  background: var(--bg-card-hover);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  transition: all 0.2s ease;
}

.upload-zone:hover, .upload-zone.dragover {
  border-color: hsl(var(--primary));
  background: rgba(79, 70, 229, 0.04);
}

.upload-icon {
  width: 48px;
  height: 48px;
  color: var(--text-muted);
}

.upload-zone:hover .upload-icon {
  color: hsl(var(--primary));
}

.upload-text {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.upload-subtext {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Result outputs */
.result-box {
  background: var(--bg-card-hover);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
  overflow-x: auto;
  max-height: 400px;
  color: var(--text-primary);
}

.error-message {
  border: 1px solid rgba(239, 68, 68, 0.2);
  background: rgba(239, 68, 68, 0.05);
  color: #ef4444;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 0.875rem;
  font-weight: 600;
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.success-message {
  border: 1px solid rgba(16, 185, 129, 0.2);
  background: rgba(16, 185, 129, 0.05);
  color: #10b981;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 0.875rem;
  font-weight: 600;
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Interactive Color Cards (Color Picker/Palette) */
.color-tiles-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  min-height: 250px;
  width: 100%;
}

@media (max-width: 600px) {
  .color-tiles-grid {
    grid-template-columns: 1fr;
    min-height: auto;
  }
}

.color-tile {
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px;
  color: #ffffff;
  position: relative;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.color-tile:hover {
  transform: scale(1.03);
  box-shadow: var(--shadow-lg);
}

.color-hex {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.color-lock-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.35);
  border: none;
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: all 0.2s ease;
}

.color-lock-btn:hover {
  background: rgba(0, 0, 0, 0.55);
}

.color-lock-btn.locked {
  background: hsl(var(--primary));
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

/* Image resize preview box */
.image-preview-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  background: var(--bg-card-hover);
}

.image-preview-container img {
  max-width: 100%;
  max-height: 250px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.image-stats {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  gap: 16px;
}

/* CSS Gradient Stop Slider container */
.gradient-bar-preview {
  height: 80px;
  border-radius: var(--radius-lg);
  width: 100%;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
}

/* Diff elements highlighting */
.diff-added {
  background-color: rgba(16, 185, 129, 0.15);
  color: #047857;
  text-decoration: none;
}
.diff-removed {
  background-color: rgba(239, 68, 68, 0.15);
  color: #b91c1c;
  text-decoration: line-through;
}

/* Browser Info Cards */
.info-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.info-item-card {
  background: var(--bg-card-hover);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.info-item-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  color: var(--text-muted);
}

.info-item-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  word-break: break-all;
}

/* Leaflet Map placeholder */
#leaflet-map {
  width: 100%;
  height: 300px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  margin-top: 12px;
  background-color: var(--bg-card-hover);
}

/* Bottom Ads Banner Placeholders */
.footer-ad-banner {
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
  max-width: 728px;
  width: 100%;
  margin: 32px auto 0;
  min-height: 90px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* Global hidden element utilities */
.hidden {
  display: none !important;
}

/* Mobile Sidebar Overlays */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 995;
}

/* Footer Section */
.app-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-sidebar);
  padding: 24px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.app-footer span {
  color: hsl(var(--primary));
}

/* Responsive adjust for tablets & mobile */
@media (max-width: 992px) {
  .app-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
  }
  .app-sidebar.mobile-open {
    transform: translateX(0);
  }
  .sidebar-overlay.mobile-open {
    display: block;
  }
  .mobile-toggle {
    display: flex;
  }
  .app-header {
    justify-content: flex-start;
  }
  .hero-title {
    font-size: 2rem;
  }
}

/* PWA Install Shortcut Banner */
.pwa-banner {
  position: fixed;
  bottom: 100px;
  left: 20px;
  right: 20px;
  background: var(--primary-gradient);
  color: #ffffff;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(255, 255, 255, 0.15);
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@media (min-width: 768px) {
  .pwa-banner {
    left: auto;
    right: 24px;
    width: 420px;
  }
}
