@import "./codicons.min.css";
@import "../initView/styles.css";

:root {
  --code-block-bg: color-mix(
    in srgb,
    var(--vscode-editor-background) 95%,
    black 5%
  );
  /* --code-block-bg: var(--vscode-editor-background, --vscode-sideBar-background, rgb(30 30 30))cc; */
  --brand: #414372;
  --cyan: #306998;
  --codeflash-gradient-bg: linear-gradient(135deg, #414372, #685123);
  --codeflash-transparent-gradient-bg: linear-gradient(
    to bottom,
    #4143724f,
    transparent 60%
  );
  --duration: 5s;
  --scale: 0.6;
  --glow-size: 100%;
}

body {
  padding: 0;
  margin: 0;
  font-family: var(--vscode-font-family);
  font-weight: var(--vscode-font-weight);
  font-size: var(--vscode-font-size);
  color: var(--vscode-editor-foreground);
}

/* Scrollbar styling */
* {
  scrollbar-width: thin; /* Firefox */
  scrollbar-color: var(--vscode-scrollbarSlider-background) transparent;
}

/* Webkit scrollbar styling for Chrome/Safari */
*::-webkit-scrollbar {
  width: 8px;
}

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

*::-webkit-scrollbar-thumb {
  background: var(--vscode-scrollbarSlider-background);
  border-radius: 4px;
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--vscode-scrollbarSlider-hoverBackground);
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.spin {
  animation: spin 1s linear infinite;
}

.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: relative;
  padding: 1rem 0;
  z-index: 2;
}
.gradiantBg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--codeflash-transparent-gradient-bg);
  opacity: 0.5;
  pointer-events: none;
  z-index: -1;
}
.gridBackground {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(
      to right,
      var(--vscode-editorLineNumber-foreground) 1px,
      transparent 1px
    ),
    linear-gradient(
      to bottom,
      var(--vscode-editorLineNumber-foreground) 1px,
      transparent 1px
    );
  background-size: 24px 24px;
  opacity: 0.03;
}

.content {
  flex: 1;
  overflow: hidden;
}

/* api key container */
.api-key-container {
  padding: 1.5rem;
  border-radius: 6px;
  background-color: var(--vscode-editor-background);
  box-shadow: 0 0 0 1px var(--vscode-editorWidget-border);
  margin: 1.5rem;
}

.api-key-container h2 {
  font-size: 12px;
  margin-bottom: 1rem;
  color: var(--vscode-editor-foreground);
}

.api-key-container .input-group {
  display: flex;
  align-items: center;
  background-color: var(--vscode-input-background);
  border: 1px solid var(--vscode-input-border);
  border-radius: 4px;
  padding: 4px 8px;
}

.api-key-container input {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--vscode-input-foreground);
  font-family: inherit;
  font-size: 13px;
  outline: none;
}

.api-key-container .hint {
  margin-top: 1rem;
  color: var(--vscode-descriptionForeground);
  font-size: 12px;
}

.api-key-container a {
  color: var(--vscode-textLink-foreground);
  text-decoration: none;
}

.api-key-container a:hover {
  text-decoration: underline;
}
/* end of api key container */

/* core glow element (empty element positioned over the container) */
.glowEffect {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: -1;
  transform: translateZ(0); /* GPU hint */
  will-change: transform, opacity, filter, background-position;
}

/* The visual gradient sits on a pseudo element so we can transform it independently */
.glowEffect::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--glow-size);
  height: var(--glow-size);
  transform: translate(-50%, -50%) scale(var(--scale));
  border-radius: 50%;
  filter: blur(25px) brightness(1.2);
  mix-blend-mode: screen; /* nicer glow when over dark bg; change to normal if undesired */
  transition:
    opacity 200ms linear,
    transform 200ms linear;
  pointer-events: none;
  z-index: -1;
}

/* color variables (override inline or via stylesheet) */
.glowEffect {
  --g1: #414372; /* main golden orange */
  --g2: #f57627; /* warm tangerine */
  --g3: #f53b38; /* coral red for contrast */
  --g4: #7363ed; /* vibrant violet for balance */
}
.modePulse::before {
  background:
    radial-gradient(
      circle at 30% 30%,
      color-mix(in srgb, var(--g1) 85%, transparent) 0%,
      transparent 40%
    ),
    radial-gradient(
      circle at 70% 70%,
      color-mix(in srgb, var(--g2) 85%, transparent) 0%,
      transparent 40%
    ),
    radial-gradient(
      circle at 50% 50%,
      color-mix(in srgb, var(--g3) 80%, transparent) 0%,
      transparent 45%
    );
  animation: glowPulse var(--duration) ease-in-out infinite;
  border-radius: 50%;
}

@keyframes glowPulse {
  0% {
    transform: translate(-50%, -50%) scale(calc(var(--scale) * 1));
    opacity: 0.45;
  }
  50% {
    transform: translate(-50%, -50%) scale(calc(var(--scale) * 1.12));
    opacity: 0.85;
  }
  100% {
    transform: translate(-50%, -50%) scale(calc(var(--scale) * 1));
    opacity: 0.45;
  }
}
.table-wrapper {
  overflow-x: auto;
  margin: 1rem 0;
  /* border-radius: 12px; */
  background-color: var(--vscode-editor-background);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.table-wrapper table {
  width: 100%;
  border-collapse: collapse; /* merges shared borders */
  color: var(--vscode-editor-foreground);
}

.table-wrapper th,
.table-wrapper td {
  padding: 0.6rem 0.8rem;
  text-align: center !important;
  border: 1px solid var(--vscode-editorGroup-border); /* only cell borders */
}

.table-wrapper th:first-child,
.table-wrapper td:first-child {
  text-align: left !important;
}

.table-wrapper th {
  background-color: var(--vscode-sideBarSectionHeader-background);
  color: var(--vscode-editor-foreground);
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 1;
}

.table-wrapper tr:nth-child(even) td {
  background-color: var(--vscode-editor-inactiveSelectionBackground);
}

.table-wrapper tr:hover td {
  background-color: var(--vscode-list-hoverBackground);
}
