/* Custom CSS for BibTeX Validator Documentation
 * Integrates Tailwind CSS utilities, shadcn/ui styles, and Inter font
 * Compatible with Shibuya theme
 */

/* Inter Font Family */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

/* shadcn/ui CSS Variables - Light Mode (default) */
:root {
  --background: 0 0% 100%;
  --foreground: 240 10% 3.9%;
  --card: 0 0% 100%;
  --card-foreground: 240 10% 3.9%;
  --popover: 0 0% 100%;
  --popover-foreground: 240 10% 3.9%;
  --primary: 240 5.9% 10%;
  --primary-foreground: 0 0% 98%;
  --secondary: 240 4.8% 95.9%;
  --secondary-foreground: 240 5.9% 10%;
  --muted: 240 4.8% 95.9%;
  --muted-foreground: 240 3.8% 46.1%;
  --accent: 240 4.8% 95.9%;
  --accent-foreground: 240 5.9% 10%;
  --destructive: 0 84.2% 60.2%;
  --destructive-foreground: 0 0% 98%;
  --border: 240 5.9% 90%;
  --input: 240 5.9% 90%;
  --ring: 240 10% 3.9%;
  --radius: 0.5rem;
}

/* Dark Mode Support (for Shibuya theme dark mode) */
[data-theme="dark"],
html.dark,
.dark {
  --background: 240 10% 3.9%;
  --foreground: 0 0% 98%;
  --card: 240 10% 3.9%;
  --card-foreground: 0 0% 98%;
  --popover: 240 10% 3.9%;
  --popover-foreground: 0 0% 98%;
  --primary: 0 0% 98%;
  --primary-foreground: 240 5.9% 10%;
  --secondary: 240 3.7% 15.9%;
  --secondary-foreground: 0 0% 98%;
  --muted: 240 3.7% 15.9%;
  --muted-foreground: 240 5% 64.9%;
  --accent: 240 3.7% 15.9%;
  --accent-foreground: 0 0% 98%;
  --destructive: 0 62.8% 30.6%;
  --destructive-foreground: 0 0% 98%;
  --border: 240 3.7% 15.9%;
  --input: 240 3.7% 15.9%;
  --ring: 240 4.9% 83.9%;
}

/* Apply Inter font to body and main content */
body,
.sphinx-content,
.rst-content {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  font-variation-settings: normal;
}

/* Code and monospace font */
code,
pre,
.highlight,
.literal-block {
  font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", "Courier New",
    monospace;
}

/* Utility Classes - shadcn/ui inspired components */

/* Card component */
.sd-card,
.card {
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--card));
  color: hsl(var(--card-foreground));
  padding: 1.5rem;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
}

/* Badge component */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px; /* rounded-full */
  border: 1px solid hsl(var(--border));
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
  transition: colors 0.2s;
}

.badge-primary {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: hsl(var(--primary));
}

.badge-secondary {
  background-color: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
  border-color: hsl(var(--secondary));
}

.badge-destructive {
  background-color: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
  border-color: hsl(var(--destructive));
}

.badge-muted {
  background-color: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  border-color: hsl(var(--muted));
}

/* Source Badge Colors */
.badge-source-crossref {
  background-color: #dbeafe;
  color: #1e40af;
  border-color: #bfdbfe;
}

.badge-source-arxiv {
  background-color: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}

.badge-source-semantic-scholar {
  background-color: #e0e7ff;
  color: #3730a3;
  border-color: #c7d2fe;
}

.badge-source-dblp {
  background-color: #f3e8ff;
  color: #6b21a8;
  border-color: #e9d5ff;
}

.badge-source-pubmed {
  background-color: #e0f2fe;
  color: #075985;
  border-color: #bae6fd;
}

.badge-source-zenodo {
  background-color: #f3f4f6;
  color: #1f2937;
  border-color: #e5e7eb;
}

.badge-source-datacite {
  background-color: #f3f4f6;
  color: #1f2937;
  border-color: #e5e7eb;
}

.badge-source-openalex {
  background-color: #f3f4f6;
  color: #1f2937;
  border-color: #e5e7eb;
}

/* Status Badge Colors */
.badge-status-review {
  background-color: #dbeafe;
  color: #1e40af;
  border-color: #bfdbfe;
}

.badge-status-conflict {
  background-color: #ffedd5;
  color: #9a3412;
  border-color: #fed7aa;
}

.badge-status-different {
  background-color: #fef9c3;
  color: #854d0e;
  border-color: #fde047;
}

.badge-status-identical {
  background-color: #dcfce7;
  color: #166534;
  border-color: #bbf7d0;
}

.badge-status-accepted {
  background-color: #d1fae5;
  color: #065f46;
  border-color: #a7f3d0;
}

.badge-status-rejected {
  background-color: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}

.badge-status-local-only {
  background-color: #f3f4f6;
  color: #1f2937;
  border-color: #e5e7eb;
}

/* Dark mode support for badges */
[data-theme="dark"] .badge-source-crossref,
html.dark .badge-source-crossref {
  background-color: #1e3a8a;
  color: #dbeafe;
  border-color: #3b82f6;
}

[data-theme="dark"] .badge-source-arxiv,
html.dark .badge-source-arxiv {
  background-color: #7f1d1d;
  color: #fecaca;
  border-color: #ef4444;
}

[data-theme="dark"] .badge-source-semantic-scholar,
html.dark .badge-source-semantic-scholar {
  background-color: #312e81;
  color: #c7d2fe;
  border-color: #6366f1;
}

[data-theme="dark"] .badge-source-dblp,
html.dark .badge-source-dblp {
  background-color: #581c87;
  color: #e9d5ff;
  border-color: #a855f7;
}

[data-theme="dark"] .badge-source-pubmed,
html.dark .badge-source-pubmed {
  background-color: #0c4a6e;
  color: #bae6fd;
  border-color: #0ea5e9;
}

[data-theme="dark"] .badge-source-zenodo,
html.dark .badge-source-zenodo,
[data-theme="dark"] .badge-source-datacite,
html.dark .badge-source-datacite,
[data-theme="dark"] .badge-source-openalex,
html.dark .badge-source-openalex {
  background-color: #374151;
  color: #e5e7eb;
  border-color: #6b7280;
}

[data-theme="dark"] .badge-status-review,
html.dark .badge-status-review {
  background-color: #1e3a8a;
  color: #dbeafe;
  border-color: #3b82f6;
}

[data-theme="dark"] .badge-status-conflict,
html.dark .badge-status-conflict {
  background-color: #7c2d12;
  color: #fed7aa;
  border-color: #f97316;
}

[data-theme="dark"] .badge-status-different,
html.dark .badge-status-different {
  background-color: #713f12;
  color: #fde047;
  border-color: #eab308;
}

[data-theme="dark"] .badge-status-identical,
html.dark .badge-status-identical {
  background-color: #14532d;
  color: #bbf7d0;
  border-color: #22c55e;
}

[data-theme="dark"] .badge-status-accepted,
html.dark .badge-status-accepted {
  background-color: #064e3b;
  color: #a7f3d0;
  border-color: #10b981;
}

[data-theme="dark"] .badge-status-rejected,
html.dark .badge-status-rejected {
  background-color: #7f1d1d;
  color: #fecaca;
  border-color: #ef4444;
}

[data-theme="dark"] .badge-status-local-only,
html.dark .badge-status-local-only {
  background-color: #374151;
  color: #e5e7eb;
  border-color: #6b7280;
}

/* Pie chart visualization */
.pie-chart {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: inline-block;
  /* margin: 0.5rem; Removed for better flex alignment */
  position: relative;
}

.pie-chart::before {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: conic-gradient(
    #f87171 0% var(--pie-percentage, 0%),
    #e5e7eb var(--pie-percentage, 0%) 100%
  );
}

/* Button-like elements */
.btn,
button.sd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.875rem;
  font-weight: 500;
  height: 2.25rem;
  padding: 0 1rem;
  transition: all 0.2s;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-primary {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.btn-primary:hover {
  background-color: hsl(var(--primary) / 0.9);
}

.btn-secondary {
  background-color: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
  border-color: hsl(var(--border));
}

.btn-secondary:hover {
  background-color: hsl(var(--secondary) / 0.8);
}

/* Alert/Notice boxes */
.admonition,
.note,
.warning,
.danger,
.tip {
  border-radius: var(--radius);
  border-left: 4px solid;
  padding: 1rem;
  margin: 1rem 0;
  background-color: hsl(var(--muted) / 0.3);
}

.admonition-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

/* Table enhancements */
table.docutils,
table.longtable {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid hsl(var(--border));
}

table.docutils th,
table.longtable th {
  background-color: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  font-weight: 600;
  padding: 0.75rem;
}

table.docutils td,
table.longtable td {
  padding: 0.75rem;
  border-top: 1px solid hsl(var(--border));
}

/* Code block enhancements */
.highlight,
.literal-block {
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--muted) / 0.3);
  padding: 1rem;
}

/* Link styling */
a {
  color: hsl(var(--primary));
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: hsl(var(--primary) / 0.8);
  text-decoration: underline;
}

/* Custom animations */
@keyframes spin-slow {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.animate-spin-slow {
  animation: spin-slow 3s linear infinite;
}

/* Icon container */
.icon-container {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Responsive utilities */
@media (max-width: 768px) {
  .card,
  .sd-card {
    padding: 1rem;
  }
}

/* Integration with Shibuya theme */
.shibuya-sidebar,
.shibuya-content {
  font-family: "Inter", sans-serif;
}

/* Ensure compatibility with existing Shibuya styles */
.sd-card,
.sd-tabs,
.sd-tab-set {
  /* sphinx-design components should work with our variables */
}
