/* Reset and variables */
:root {
  --font-title: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, monospace;
  
  --color-bg: #0d1117;
  --color-panel: rgba(13, 17, 23, 0.7);
  --color-panel-border: rgba(255, 255, 255, 0.08);
  --color-panel-glow: rgba(99, 102, 241, 0.15);
  
  --color-accent: #6366f1;
  --color-accent-hover: #4f46e5;
  --color-accent-glow: rgba(99, 102, 241, 0.4);
  
  --color-text-primary: #f3f4f6;
  --color-text-secondary: #9ca3af;
  --color-text-muted: #6b7280;
  
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

body {
  font-family: var(--font-body);
  color: var(--color-text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.sidebar-wrapper {
  position: absolute;
  top: 32px;
  right: 32px;
  bottom: 32px;
  z-index: 10;
  pointer-events: none;
  display: flex;
  flex-direction: column;
}

.sidebar-wrapper > * {
  pointer-events: auto;
}

.sidebar {
  width: 280px;
  background: rgba(15, 15, 20, 0.7);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255,255,255,0.1);
  overflow-y: auto;
  color: #f8f9fa;
  font-family: 'Inter', system-ui, sans-serif;
  z-index: 10;
  pointer-events: auto;
  max-height: 100%;
}

.sidebar::-webkit-scrollbar {
  width: 4px;
}
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.2);
  border-radius: 10px;
}

.title {
  margin: 0 0 20px 0;
  font-size: 20px;
  font-weight: 800;
  background: linear-gradient(135deg, #ffffff 0%, #a5b4fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}

.section-title {
  margin: 20px 0 12px 0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 700;
  color: #818cf8;
}

.card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), background 0.2s;
}
.card:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.12);
}

.color-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
}

.color-label {
  font-size: 12px;
  font-weight: 500;
  color: #cbd5e1;
}

.color-picker-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0,0,0,0.3);
  padding: 4px 10px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.06);
  transition: border 0.2s;
}
.color-picker-wrap:hover {
  border-color: rgba(255,255,255,0.15);
}

.color-input {
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  outline: none;
  border-radius: 50%;
  cursor: pointer;
  overflow: hidden;
  background: transparent;
  -webkit-appearance: none;
}
.color-input::-webkit-color-swatch-wrapper {
  padding: 0;
}
.color-input::-webkit-color-swatch {
  border: none;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.2) inset;
}
.color-input::-moz-color-swatch {
  border: none;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.2) inset;
}

.hex-text {
  font-size: 10px;
  color: #94a3b8;
  font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, monospace;
  text-transform: uppercase;
}

.btn-primary {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: white;
  border: none;
  padding: 10px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  width: 100%;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
  text-align: center;
  display: block;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
  background: linear-gradient(135deg, #818cf8 0%, #6366f1 100%);
}

.btn-remove {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-remove:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}

.text-input {
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.1);
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  width: 100%;
  font-size: 12px;
  outline: none;
  transition: border 0.2s, background 0.2s;
  box-sizing: border-box;
}
.text-input:focus {
  border-color: #818cf8;
  background: rgba(0,0,0,0.4);
}

.item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.item-title {
  font-size: 12px;
  font-weight: 600;
  color: #f1f5f9;
}

.mobile-toggle-btn {
  display: none;
}

/* Adjust toolbar position on mobile screen sizes */
@media (max-width: 768px) {
  .mobile-toggle-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 32px;
    right: 32px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(15, 15, 20, 0.9) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    color: #f8f9fa !important;
    cursor: pointer;
    z-index: 99999 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5) !important;
    transition: var(--transition-smooth);
  }

  .mobile-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.15);
  }

  .sidebar-wrapper {
    left: 20px;
    right: 20px;
    bottom: 80px;
    top: auto;
    width: auto;
    max-height: 50vh;
    transform: translateY(calc(50vh + 100px));
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-smooth);
  }

  .sidebar-wrapper.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
  }

  .sidebar-wrapper .sidebar {
    width: 100% !important;
    max-height: 50vh !important;
  }
}
