/* Basic reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #f4f4f5;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --warning: #f97316;
  --suggestion: #22c55e;
}

/* Dark mode overrides */
body.dark {
  --bg: #020617;
  --card-bg: #020617;
  --border: #111827;
  --text-main: #3458a1;
  --text-muted: #9ca3af;
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --warning: #fb923c;
  --suggestion: #22c55e;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
      sans-serif;
    background: var(--bg);
    color: var(--text-main);
    transition: background 0.2s ease, color 0.2s ease;
  }
  
/* Layout helpers */
.container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Navbar */
.navbar {
  background: #020617;
  color: #e5e7eb;
  border-bottom: 1px solid #020617;
   }
      
   .theme-toggle {
    border: none;
    background: transparent;
    cursor: pointer;
    margin-right: 0.5rem;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: background 0.15s ease, transform 0.05s ease;
  }
  
  .theme-toggle:hover {
    background: rgba(148, 163, 184, 0.25);
    transform: translateY(-1px);
  }
  
  body.dark .theme-toggle:hover {
    background: rgba(30, 64, 175, 0.6);
  }
  

.nav-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 0;
}

.logo {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.nav-links {
  display: none;
  gap: 1.5rem;
  font-size: 0.9rem;
}

.nav-links .nav-link {
  text-decoration: none;
  color: #cbd5f5;
  padding-bottom: 2px;
}

.nav-links .nav-link:hover {
  color: #ffffff;
}

.nav-links .nav-link.active {
  color: #ffffff;
  border-bottom: 2px solid var(--primary);
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Main */
.main {
  padding: 2.5rem 0 3rem;
}

/* Generic page wrapper */
.page {
  display: block;
}

.page-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

/* Hero */
.hero {
  text-align: center;
  margin-bottom: 2rem;
}

.hero h1 {
  font-size: 1.9rem;
  font-weight: 700;
}

.hero p {
  margin-top: 0.75rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.primary-btn,
.secondary-btn {
  border: none;
  cursor: pointer;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.6rem 1.2rem;
  transition: background 0.15s ease, box-shadow 0.15s ease,
    transform 0.05s ease;
}

.primary-btn {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.25);
}

.primary-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.secondary-btn {
  background: #ffffff;
  color: var(--text-main);
  border: 1px solid var(--border);
}

.secondary-btn:hover {
  background: #f9fafb;
}

.disabled-btn {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

/* Cards */
.card {
  background: var(--card-bg);
  border-radius: 1rem;
  border: 1px solid var(--border);
  box-shadow: 0 12px 35px rgba(15, 23, 42, 0.04);
}

/* Editor Card */
.editor-card {
  margin-top: 1.75rem;
  padding: 1rem 1rem 1.2rem;
}

.editor-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.red {
  background: #f97373;
}
.yellow {
  background: #facc15;
}
.green {
  background: #4ade80;
}

.filename {
  margin-left: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Editor Body */
.editor-body {
  background: #020617;
  border-radius: 0.75rem;
  padding: 0.75rem;
}

textarea#codeInput {
  width: 100%;
  min-height: 220px;
  border: none;
  resize: vertical;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco,
    Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.85rem;
  line-height: 1.4;
  background: transparent;
  color: #e5e7eb;
  outline: none;
}

/* Controls */
.editor-controls {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.9rem;
}

#languageSelect {
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: #f8fafc;
  font-size: 0.9rem;
}

/* File button uses label */
.file-btn {
  text-align: center;
}

/* Suggestions Card */
.suggestions-card {
  margin-top: 1.5rem;
  padding: 1.2rem 1.25rem 1.35rem;
}

#suggestedCode {
  width: 100%;
  min-height: 180px;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  padding: 0.75rem;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco,
    Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.85rem;
  line-height: 1.4;
  background: #f9fafb;
  color: var(--text-main);
  resize: vertical;
}

body.dark #suggestedCode {
  background: #020617;
  color: #e5e7eb;
}

.suggestion-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.6rem;
}

.small-btn {
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  border-radius: 0.5rem;
}

body.dark .small-btn {
  background: #020617;
  color: #e5e7eb;
  border-color: #1f2937;
}


/* Results Card */
.results-card {
  margin-top: 1.5rem;
  padding: 1.2rem 1.25rem 1.35rem;
}

.results-card h2 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

/* Summary row */
.summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.summary-item {
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  padding: 0.6rem 0.7rem;
  background: #f9fafb;
}

.summary-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.summary-value {
  font-size: 1.05rem;
  font-weight: 600;
}

/* Issues list */
.issues-list {
  list-style: none;
  margin-top: 0.25rem;
}

.issue {
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  background: #ffffff;
}

.issue-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.issue-badge {
  display: inline-block;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #ffffff;
}

.badge-warning {
  background: var(--warning);
}

.badge-suggestion {
  background: var(--suggestion);
}

.issue-detail {
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* Empty state */
.no-issues {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--suggestion);
}

/* REPORTS PAGE */
.reports-card {
  padding: 1.2rem 1.25rem 1.35rem;
}

.reports-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.reports-count {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.reports-table-wrapper {
  overflow-x: auto;
}

.reports-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.reports-table th,
.reports-table td {
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 0.4rem;
  text-align: left;
}

.reports-table th {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.reports-table tbody tr:nth-child(even) {
  background: #f8fafc;
}

.empty-text {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* INTEGRATIONS PAGE */
.integrations-card {
  padding: 1.2rem 1.25rem 1.35rem;
}

.integration-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.integration-item {
  border-radius: 0.9rem;
  border: 1px solid var(--border);
  padding: 0.9rem 0.9rem 1rem;
  background: #f9fafb;
}

.integration-item h3 {
  margin-top: 0.4rem;
  font-size: 1rem;
}

.integration-item p {
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.7rem;
}

.integration-logo {
  width: 32px;
  height: 32px;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #ffffff;
}

.integration-logo.github {
  background: #111827;
}

.integration-logo.gitlab {
  background: #f97316;
}

.integration-logo.bitbucket {
  background: #2563eb;
}

.integrations-note {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ABOUT PAGE */
.about-card {
  padding: 1.2rem 1.25rem 1.35rem;
}

.about-card h2 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.about-card h3 {
  margin-top: 1rem;
  font-size: 1rem;
}

.about-card p {
  margin-top: 0.35rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.about-list {
  margin-top: 0.4rem;
  padding-left: 1.2rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.about-list li {
  margin-bottom: 0.35rem;
}

.about-footer {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Utils */
.hidden {
  display: none;
}

/* Responsive */
@media (min-width: 768px) {
  .nav-links {
    display: flex;
  }

  .main {
    padding-top: 3rem;
  }

  .hero h1 {
    font-size: 2.3rem;
  }

  .editor-controls {
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
  }

  #languageSelect {
    width: 180px;
  }

  .file-btn {
    width: auto;
  }

  .primary-btn,
  .secondary-btn {
    padding-inline: 1.4rem;
  }
}

/* REPORTS PAGE */
.reports-card {
  padding: 1.2rem 1.25rem 1.35rem;
}

.about-card {
  padding: 1.2rem 1.25rem 1.35rem;
}
