/* ============================================
   realgar.ch — Custom Gitea Styling
   Clean. Sharp. Next level.
   ============================================ */

/* --- Typography: Inter for that modern SaaS feel --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --fonts-proportional: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --fonts-monospace: 'JetBrains Mono', 'SF Mono', 'Cascadia Code', monospace;
  --glow-primary: 0 0 20px rgba(212, 115, 74, 0.15);
  --glow-primary-intense: 0 0 30px rgba(212, 115, 74, 0.25);
  --transition-smooth: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-layered: 0 1px 2px rgba(0, 0, 0, 0.1), 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-elevated: 0 2px 4px rgba(0, 0, 0, 0.12), 0 8px 24px rgba(0, 0, 0, 0.15);
  --border-subtle: 1px solid rgba(48, 54, 61, 0.5);
  --color-logo: #d4734a !important;
}

/* --- Smooth scrolling & selection --- */
html {
  scroll-behavior: smooth;
}

::selection {
  background: rgba(212, 115, 74, 0.3);
  color: #e6edf3;
}

/* --- Custom scrollbar --- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: rgba(139, 148, 158, 0.25);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(139, 148, 158, 0.45);
}

/* --- Navbar: solid with fine bottom border --- */
.ui.secondary.pointing.menu,
nav.navbar,
#navbar,
.navbar {
  border-bottom: 1px solid rgba(48, 54, 61, 0.5) !important;
}

/* --- Cards & boxes: layered shadows, no harsh borders --- */
.ui.segment,
.ui.attached.segment {
  border: var(--border-subtle) !important;
  border-radius: 10px !important;
  box-shadow: var(--shadow-layered);
  transition: var(--transition-smooth);
}

.ui.segment:hover {
  box-shadow: var(--shadow-elevated);
}

/* --- Repo list items: left accent on hover --- */
.flex-item {
  transition: var(--transition-smooth);
  border-radius: 8px;
  padding: 12px !important;
  border-left: 3px solid transparent;
}

.flex-item:hover {
  background: rgba(212, 115, 74, 0.03);
  border-left-color: var(--color-primary);
}

/* --- Buttons: clean with subtle depth --- */
.ui.primary.button,
.ui.button.primary {
  border-radius: 8px !important;
  font-weight: 600 !important;
  letter-spacing: 0.01em;
  transition: var(--transition-smooth);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.ui.primary.button:hover,
.ui.button.primary:hover {
  box-shadow: var(--glow-primary-intense), 0 4px 12px rgba(0, 0, 0, 0.2);
  transform: translateY(-1px);
}

.ui.primary.button:active,
.ui.button.primary:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.ui.basic.button,
.ui.button {
  border-radius: 8px !important;
  transition: var(--transition-smooth);
}

/* --- Input fields: clean focus ring --- */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="search"],
input[type="url"],
textarea,
.ui.input > input,
.ui.form input,
.ui.form textarea {
  border-radius: 8px !important;
  transition: var(--transition-smooth);
  border: 1px solid rgba(48, 54, 61, 0.6) !important;
}

input:focus,
textarea:focus,
.ui.input > input:focus,
.ui.form input:focus,
.ui.form textarea:focus {
  border-color: rgba(212, 115, 74, 0.5) !important;
  box-shadow: 0 0 0 3px rgba(212, 115, 74, 0.08) !important;
  outline: none !important;
}

/* --- Links: smooth color transition --- */
a {
  transition: color 0.15s ease;
}

a:hover {
  text-decoration: none;
}

/* --- Code blocks: refined with left accent --- */
.code-view,
pre,
code,
.highlight {
  border-radius: 8px !important;
}

.code-view {
  border: var(--border-subtle) !important;
}

.markup code,
code {
  border-radius: 4px !important;
  padding: 2px 6px !important;
}

.markup pre {
  border-left: 3px solid var(--color-primary) !important;
}

/* --- Diff view: grouped with spacing --- */
.diff-file-box {
  border-radius: 10px !important;
  overflow: hidden;
  border: var(--border-subtle) !important;
  margin-bottom: 16px !important;
  box-shadow: var(--shadow-layered);
}

/* --- Labels & badges: pill style --- */
.ui.label,
.label {
  border-radius: 20px !important;
  font-weight: 500 !important;
  letter-spacing: 0.02em;
}

/* --- Dropdown menus: elevated card --- */
.ui.dropdown .menu,
.tippy-box,
.ui.popup {
  border-radius: 10px !important;
  border: var(--border-subtle) !important;
  box-shadow: var(--shadow-elevated), 0 0 0 1px rgba(48, 54, 61, 0.2) !important;
  overflow: hidden;
}

.ui.dropdown .menu > .item {
  transition: var(--transition-smooth);
  border-radius: 6px !important;
  margin: 2px 4px !important;
}

.ui.dropdown .menu > .item:hover {
  background: rgba(212, 115, 74, 0.06) !important;
}

/* --- Tabs: underline indicator --- */
.ui.tabular.menu .item {
  border-radius: 6px 6px 0 0 !important;
  transition: var(--transition-smooth);
}

.ui.tabular.menu .active.item {
  border-bottom: 2px solid var(--color-primary) !important;
}

/* --- Avatar: subtle ring on hover --- */
.avatar,
.ui.avatar.image,
img.avatar {
  border-radius: 50% !important;
  border: 2px solid transparent;
  transition: var(--transition-smooth);
}

.avatar:hover,
.ui.avatar.image:hover,
img.avatar:hover {
  border-color: var(--color-primary);
}

/* --- Repo header: breathing room --- */
.repository .repo-header {
  padding: 20px !important;
  margin-bottom: 16px !important;
  border-radius: 10px !important;
}

/* --- Activity heatmap: rounder cells --- */
.heatmap rect {
  rx: 3;
  ry: 3;
}

/* --- Tables: refined headers --- */
.ui.table {
  border-radius: 10px !important;
  overflow: hidden;
  border: 1px solid rgba(48, 54, 61, 0.4) !important;
}

.ui.table thead th {
  font-weight: 600 !important;
  text-transform: uppercase;
  font-size: 0.72em !important;
  letter-spacing: 0.06em;
  color: var(--color-text-light-2) !important;
}

.ui.table tr {
  transition: var(--transition-smooth);
}

.ui.table tbody tr:hover {
  background: rgba(212, 115, 74, 0.03) !important;
}

/* --- Milestone progress bars: gradient --- */
.ui.progress .bar {
  border-radius: 6px !important;
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-dark-2)) !important;
}

.ui.progress {
  border-radius: 6px !important;
}

/* --- Toast notifications --- */
.ui.toast-container .toast-box {
  border-radius: 10px !important;
  border: var(--border-subtle) !important;
  box-shadow: var(--shadow-elevated) !important;
}

/* --- Modal: elevated card --- */
.ui.dimmer {
  background: rgba(1, 4, 9, 0.7) !important;
}

.ui.modal {
  border-radius: 12px !important;
  border: var(--border-subtle) !important;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35) !important;
}

/* --- File tree: left accent hover --- */
#repo-files-table .repo-file-item {
  transition: var(--transition-smooth);
  border-left: 2px solid transparent;
}

#repo-files-table .repo-file-item:hover {
  background: rgba(212, 115, 74, 0.03);
  border-left-color: var(--color-primary);
}

/* --- Commit list --- */
#commits-table .commits-table-cell {
  transition: var(--transition-smooth);
}

#commits-table .commits-table-cell:hover {
  background: rgba(212, 115, 74, 0.03);
}

/* --- Branch/tag selector --- */
.ui.compact.label {
  border-radius: 6px !important;
}

/* --- Footer --- */
.page-footer {
  border-top: 1px solid rgba(48, 54, 61, 0.3) !important;
}

/* --- Actions console --- */
.action-view-left .job-step-container {
  border-radius: 8px !important;
}

/* --- Markdown rendering: accent details --- */
.markup h1,
.markup h2 {
  border-bottom-color: rgba(48, 54, 61, 0.3) !important;
  padding-bottom: 0.3em !important;
}

.markup h1::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 0.8em;
  background: var(--color-primary);
  border-radius: 2px;
  margin-right: 10px;
  vertical-align: middle;
}

.markup blockquote {
  border-left: 3px solid var(--color-primary) !important;
  border-radius: 0 6px 6px 0 !important;
  background: rgba(212, 115, 74, 0.03) !important;
  padding: 8px 16px !important;
}

.markup table {
  border-radius: 8px !important;
  overflow: hidden;
}

/* --- Pagination --- */
.ui.pagination.menu .item {
  border-radius: 6px !important;
  margin: 0 2px !important;
  transition: var(--transition-smooth);
}

.ui.pagination.menu .active.item {
  background: var(--color-primary) !important;
  color: white !important;
}

/* --- Sign-in page --- */
.page-content.user.signin .ui.container {
  max-width: 420px !important;
}

.page-content.user.signin .ui.segment {
  padding: 32px !important;
  border-radius: 14px !important;
  box-shadow: var(--shadow-elevated) !important;
  border: var(--border-subtle) !important;
}

/* --- Logo: hover glow --- */
.logo {
  transition: var(--transition-smooth);
}

.logo:hover {
  filter: drop-shadow(0 0 8px rgba(212, 115, 74, 0.35));
}

/* --- Keyboard shortcuts --- */
kbd {
  border-radius: 4px !important;
  font-family: var(--fonts-monospace) !important;
  font-size: 0.85em;
  border: 1px solid rgba(48, 54, 61, 0.6);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

/* --- Focus states --- */
*:focus-visible {
  outline: 2px solid rgba(212, 115, 74, 0.4) !important;
  outline-offset: 2px;
}

/* --- Page load: subtle fade --- */
.page-content {
  animation: fadeIn 0.15s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Repo stats bar (stars, forks, watches): monospaced numbers --- */
.repo-buttons .ui.label {
  font-family: var(--fonts-monospace) !important;
  font-size: 0.8em !important;
}

/* --- Issue/PR state labels: tighter --- */
.issue-state-label {
  border-radius: 20px !important;
  font-weight: 600 !important;
  font-size: 0.8em !important;
  letter-spacing: 0.03em;
}

/* --- Empty state: more presence --- */
.empty-placeholder {
  opacity: 0.6;
  padding: 48px 0 !important;
}

/* --- Dashboard feed: clean cards --- */
.dashboard .news .flex-item {
  border-left: 2px solid transparent;
  border-radius: 0 8px 8px 0;
}

.dashboard .news .flex-item:hover {
  border-left-color: var(--color-primary);
  background: rgba(212, 115, 74, 0.02);
}

/* --- Notification dot: pulse animation --- */
.notification_count {
  animation: pulse 2s ease-in-out infinite;
}

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

/* --- Sidebar labels in repo: tighter grid --- */
.repository .sidebar .ui.labels .label {
  margin: 2px !important;
}

/* ============================================
   Landing page customization
   ============================================ */

/* --- Hero section: replace default Gitea logo with custom --- */
.page-content.home .hero img[alt="Logo"] {
  content: url('/assets/img/logo.svg');
  max-height: 120px !important;
  width: auto !important;
}

/* --- Hero text: warm tones --- */
.page-content.home .hero h1 {
  font-weight: 700 !important;
  letter-spacing: -0.02em;
}

.page-content.home .hero h2 {
  color: var(--color-text-light) !important;
  font-weight: 400 !important;
}

/* --- Feature icons: override green to warm accent --- */
.page-content.home .svg.octicon-flame,
.page-content.home .svg.octicon-device-desktop,
.page-content.home .svg.octicon-rocket,
.page-content.home .svg.octicon-code,
.home .octicon {
  color: #d4734a !important;
}

/* --- Feature cards: subtle card treatment --- */
.page-content.home .hero > div:nth-child(n+2) > div {
  padding: 24px;
  border-radius: 10px;
  border: 1px solid rgba(48, 54, 61, 0.3);
  transition: var(--transition-smooth);
}

.page-content.home .hero > div:nth-child(n+2) > div:hover {
  border-color: rgba(212, 115, 74, 0.3);
  box-shadow: var(--shadow-layered);
}

/* --- Feature headings: no accent bar on landing --- */
.page-content.home h1::before {
  display: none !important;
}
