/* command-palettes.css */

/* General Grid Setup */
.cp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  padding: 2rem 0;
  max-width: 1200px;
  margin: 0 auto;
}

.cp-card {
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border-color, #eaeaea);
  border-radius: 20px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
}

[data-theme="dark"] .cp-card {
  background: var(--card-bg, #1a1a1a);
  border-color: var(--border-color, #333);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.cp-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .cp-card:hover {
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
}

.demo-box {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 2rem 1rem;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1rem 0;
  position: relative;
}

[data-theme="dark"] .demo-box {
  background: #111;
}

/* 1. VS Code Style */
.cp-vscode-demo {
  background: #f0f0f0;
}
[data-theme="dark"] .cp-vscode-demo { background: #1e1e1e; }

.command-palette.vscode {
  width: 100%;
  max-width: 450px;
  background: #ffffff;
  border: 1px solid #d4d4d4;
  border-radius: 6px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #333;
  overflow: hidden;
}
[data-theme="dark"] .command-palette.vscode {
  background: #252526;
  border-color: #454545;
  color: #cccccc;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.command-palette.vscode .cp-header {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid #d4d4d4;
}
[data-theme="dark"] .command-palette.vscode .cp-header { border-bottom-color: #454545; }

.command-palette.vscode .cp-header i {
  color: #007acc;
  font-size: 12px;
  margin-right: 8px;
}
[data-theme="dark"] .command-palette.vscode .cp-header i { color: #569cd6; }

.command-palette.vscode input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  color: inherit;
}

.command-palette.vscode .cp-body {
  max-height: 250px;
  overflow-y: auto;
}

.command-palette.vscode .cp-group {
  font-size: 11px;
  text-transform: uppercase;
  padding: 8px 12px 4px;
  color: #666;
}

.command-palette.vscode .cp-item {
  display: flex;
  align-items: center;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
}
.command-palette.vscode .cp-item.active {
  background: #0060c0;
  color: white;
}

.command-palette.vscode .cp-item-icon {
  width: 20px;
  opacity: 0.8;
}

.command-palette.vscode .cp-item-label {
  flex: 1;
}

.command-palette.vscode .cp-item-shortcut {
  font-size: 12px;
  opacity: 0.6;
}

/* 2. Raycast Style */
.cp-raycast-demo { background: #e5e5e5; }
[data-theme="dark"] .cp-raycast-demo { background: #0f0f0f; }

.command-palette.raycast {
  width: 100%;
  max-width: 480px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
  font-family: 'Inter', sans-serif;
  color: #1a1a1a;
  display: flex;
  flex-direction: column;
}
[data-theme="dark"] .command-palette.raycast {
  background: rgba(30, 30, 30, 0.8);
  border-color: rgba(255, 255, 255, 0.1);
  color: #ededed;
}

.command-palette.raycast .cp-header {
  display: flex;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
[data-theme="dark"] .command-palette.raycast .cp-header { border-bottom-color: rgba(255, 255, 255, 0.08); }

.command-palette.raycast input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 18px;
  font-weight: 500;
  color: inherit;
}

.command-palette.raycast .cp-badge {
  font-size: 12px;
  background: rgba(0, 0, 0, 0.05);
  padding: 4px 8px;
  border-radius: 6px;
  font-weight: 600;
  color: #666;
}
[data-theme="dark"] .command-palette.raycast .cp-badge {
  background: rgba(255, 255, 255, 0.1);
  color: #aaa;
}

.command-palette.raycast .cp-filter {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 13px;
}
[data-theme="dark"] .command-palette.raycast .cp-filter { border-bottom-color: rgba(255, 255, 255, 0.08); }

.command-palette.raycast .cp-filter span {
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  color: #666;
  font-weight: 500;
}
[data-theme="dark"] .command-palette.raycast .cp-filter span { color: #aaa; }
.command-palette.raycast .cp-filter span.active {
  background: rgba(0, 0, 0, 0.06);
  color: #111;
}
[data-theme="dark"] .command-palette.raycast .cp-filter span.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.command-palette.raycast .cp-body {
  padding: 8px;
}

.command-palette.raycast .cp-item {
  display: flex;
  align-items: center;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
}
.command-palette.raycast .cp-item.active {
  background: #f4f4f4;
}
[data-theme="dark"] .command-palette.raycast .cp-item.active { background: rgba(255, 255, 255, 0.05); }

.command-palette.raycast .cp-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  margin-right: 12px;
  font-size: 16px;
}
.bg-red { background: #ff4b4b; }
.bg-blue { background: #3b82f6; }

.command-palette.raycast .cp-item-content { flex: 1; }
.command-palette.raycast .cp-item-title { font-size: 14px; font-weight: 500; }
.command-palette.raycast .cp-item-subtitle { font-size: 12px; color: #888; margin-top: 2px; }

.command-palette.raycast .cp-item-action {
  font-size: 12px;
  color: #666;
  background: rgba(0,0,0,0.05);
  padding: 4px 8px;
  border-radius: 4px;
}

.command-palette.raycast .cp-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 10px 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 12px;
  color: #888;
}
[data-theme="dark"] .command-palette.raycast .cp-footer { border-top-color: rgba(255, 255, 255, 0.08); }
.command-palette.raycast kbd {
  background: rgba(0,0,0,0.05);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: inherit;
}
[data-theme="dark"] .command-palette.raycast kbd { background: rgba(255,255,255,0.1); }

/* 3. Spotlight Style */
.cp-spotlight-demo { background: url('https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe?q=80&w=2564&auto=format&fit=crop') center/cover; }

.command-palette.spotlight {
  width: 100%;
  max-width: 500px;
  background: rgba(250, 250, 250, 0.7);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.15);
  color: #1d1d1f;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  overflow: hidden;
}
[data-theme="dark"] .command-palette.spotlight {
  background: rgba(30, 30, 30, 0.6);
  border-color: rgba(255, 255, 255, 0.1);
  color: #f5f5f7;
}

.command-palette.spotlight .cp-header {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}
[data-theme="dark"] .command-palette.spotlight .cp-header { border-bottom-color: rgba(255,255,255,0.1); }

.command-palette.spotlight .cp-header i {
  font-size: 20px;
  color: #86868b;
  margin-right: 12px;
}

.command-palette.spotlight input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 24px;
  font-weight: 300;
  color: inherit;
}

.command-palette.spotlight .cp-result-main {
  display: flex;
  align-items: center;
  padding: 20px;
  background: rgba(0, 122, 255, 0.1);
}
[data-theme="dark"] .command-palette.spotlight .cp-result-main { background: rgba(10, 132, 255, 0.15); }

.command-palette.spotlight .cp-result-icon {
  font-size: 32px;
  color: #007aff;
  margin-right: 16px;
}
[data-theme="dark"] .command-palette.spotlight .cp-result-icon { color: #0a84ff; }

.command-palette.spotlight .cp-result-text {
  font-size: 32px;
  font-weight: 400;
}

.command-palette.spotlight .cp-group {
  padding: 8px 20px;
  font-size: 12px;
  font-weight: 600;
  color: #86868b;
  background: rgba(0,0,0,0.03);
  text-transform: uppercase;
}
[data-theme="dark"] .command-palette.spotlight .cp-group { background: rgba(255,255,255,0.03); }

.command-palette.spotlight .cp-item {
  display: flex;
  align-items: center;
  padding: 12px 20px;
}
.command-palette.spotlight .cp-item.active {
  background: #007aff;
  color: white;
}
[data-theme="dark"] .command-palette.spotlight .cp-item.active { background: #0a84ff; }

.command-palette.spotlight .cp-item-icon {
  font-size: 18px;
  margin-right: 12px;
  color: inherit;
}
.command-palette.spotlight .cp-item:not(.active) .cp-item-icon { color: #34c759; }

/* 4. Linear Style */
.cp-linear-demo { background: #121212; }

.command-palette.linear {
  width: 100%;
  max-width: 460px;
  background: #1e1e20;
  border: 1px solid #2e2e32;
  border-radius: 10px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.05) inset;
  color: #eeeeee;
  font-family: 'Inter', sans-serif;
  overflow: hidden;
}

.command-palette.linear .cp-header {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid #2e2e32;
}

.command-palette.linear input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 16px;
}
.command-palette.linear input::placeholder { color: #6b6b70; }

.command-palette.linear .cp-shortcut {
  font-size: 11px;
  color: #8b8b90;
  background: #2a2a2e;
  padding: 2px 6px;
  border-radius: 4px;
}

.command-palette.linear .cp-body { padding: 6px; }

.command-palette.linear .cp-group {
  font-size: 12px;
  color: #8b8b90;
  padding: 8px 10px 4px;
  font-weight: 500;
}

.command-palette.linear .cp-item {
  display: flex;
  align-items: center;
  padding: 10px;
  border-radius: 6px;
  margin-bottom: 2px;
  cursor: pointer;
}
.command-palette.linear .cp-item.active {
  background: #2c2c30;
}

.command-palette.linear .cp-item-icon {
  color: #8b8b90;
  font-size: 14px;
  width: 24px;
}
.command-palette.linear .cp-item.active .cp-item-icon { color: #eeeeee; }

.command-palette.linear .cp-item-label {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
}

.command-palette.linear .cp-item-shortcut {
  font-size: 12px;
  color: #8b8b90;
  letter-spacing: 1px;
}

/* 5. Cyber / Neon Style */
.cp-cyber-demo { background: #050510; }

.command-palette.cyber {
  width: 100%;
  max-width: 500px;
  background: rgba(5, 5, 10, 0.85);
  border: 1px solid #00ffcc;
  box-shadow: 0 0 20px rgba(0, 255, 204, 0.2), inset 0 0 10px rgba(0, 255, 204, 0.1);
  color: #00ffcc;
  font-family: 'Courier New', Courier, monospace;
  position: relative;
  overflow: hidden;
}

.command-palette.cyber .cp-header {
  display: flex;
  align-items: center;
  padding: 16px;
  border-bottom: 1px dashed #00ffcc;
  background: rgba(0, 255, 204, 0.05);
}

.command-palette.cyber .cp-prompt {
  color: #ff00ff;
  font-weight: bold;
  margin-right: 10px;
}

.command-palette.cyber input {
  background: transparent;
  border: none;
  color: #fff;
  font-family: inherit;
  font-size: 16px;
  outline: none;
  width: auto;
}

.command-palette.cyber .cp-cursor {
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.command-palette.cyber .cp-body { padding: 16px; }

.command-palette.cyber .cp-group {
  color: #ff00ff;
  margin-bottom: 10px;
  font-size: 14px;
}

.command-palette.cyber .cp-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
  opacity: 0.8;
}
.command-palette.cyber .cp-item.active {
  opacity: 1;
  text-shadow: 0 0 8px #00ffcc;
  background: rgba(0, 255, 204, 0.1);
}

.command-palette.cyber .cp-item-status { color: #00ffcc; }
.command-palette.cyber .cp-item-status.warning { color: #ff0055; text-shadow: 0 0 8px #ff0055; }

.command-palette.cyber .cp-scanline {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: rgba(0, 255, 204, 0.5);
  box-shadow: 0 0 10px #00ffcc;
  animation: scan 3s linear infinite;
}

@keyframes scan {
  0% { top: 0; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}
