/* Project ATLAS - Site #9: Convertitore di Unità (Italian) */
:root {
  --bg-primary: #0a0f1d;
  --bg-surface: #111827;
  --bg-card: #1f293d;
  --border-subtle: #334155;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --accent-amber: #f59e0b;
  --accent-amber-hover: #d97706;
  --accent-blue: #38bdf8;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Ubuntu, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 1050px;
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}

/* Header */
header {
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(17, 24, 39, 0.85);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.nav-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 4rem;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 800;
  font-size: 1.25rem;
}

.logo-icon {
  width: 2rem;
  height: 2rem;
  color: var(--accent-amber);
}

nav ul {
  display: flex;
  list-style: none;
  gap: 1.5rem;
}

nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.15s ease;
}

nav a:hover {
  color: var(--accent-amber);
}

/* Tool Section */
.tool-section {
  padding: 3rem 0;
  background: radial-gradient(circle at 50% 20%, rgba(245, 158, 11, 0.08) 0%, transparent 60%);
}

.tool-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 1.5rem;
  padding: 2.5rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

/* Category Bar */
.category-bar {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  margin-bottom: 2rem;
  scrollbar-width: thin;
}

.cat-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.6rem 1.25rem;
  border-radius: 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.cat-btn:hover {
  border-color: var(--accent-amber);
  color: #fff;
}

.cat-btn.active {
  background: var(--accent-amber);
  color: #451a03;
  font-weight: 700;
  border-color: var(--accent-amber);
}

/* Converter Inputs Grid */
.converter-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1.5rem;
  align-items: center;
}

@media (max-width: 768px) {
  .converter-grid {
    grid-template-columns: 1fr;
  }
}

.converter-box {
  background: #090e1a;
  border: 1px solid var(--border-subtle);
  border-radius: 1rem;
  padding: 1.5rem;
}

.converter-box label {
  display: block;
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.unit-select {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: #fff;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 1rem;
  margin-bottom: 1rem;
  cursor: pointer;
}

.unit-select:focus {
  outline: none;
  border-color: var(--accent-amber);
}

.unit-input {
  width: 100%;
  background: transparent;
  border: none;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 700;
  outline: none;
}

.btn-swap {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--accent-amber);
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.3rem;
  transition: all 0.2s ease;
  margin: 0 auto;
}

.btn-swap:hover {
  transform: rotate(180deg);
  background: var(--accent-amber);
  color: #000;
}

/* Formula & Details Box */
.formula-card {
  margin-top: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 0.75rem;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
}

.formula-text {
  color: #cbd5e1;
  font-family: var(--font-mono);
}

/* Quick Values Table */
.quick-table-section {
  margin-top: 2.5rem;
}

.quick-table-section h3 {
  font-size: 1.2rem;
  color: #fff;
  margin-bottom: 1rem;
}

.units-table {
  width: 100%;
  border-collapse: collapse;
  background: #090e1a;
  border: 1px solid var(--border-subtle);
  border-radius: 0.75rem;
  overflow: hidden;
}

.units-table th, .units-table td {
  padding: 0.75rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid rgba(51, 65, 85, 0.4);
}

.units-table th {
  background: #0e1526;
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-transform: uppercase;
}

.units-table td {
  font-family: var(--font-mono);
  color: #cbd5e1;
}

/* Editorial Section */
.content-section {
  padding: 4rem 0;
}

.editorial-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 1.25rem;
  padding: 2.5rem;
  margin-bottom: 2.5rem;
}

.editorial-card h2 {
  font-size: 1.75rem;
  color: #fff;
  margin-bottom: 1.25rem;
}

.editorial-card h3 {
  font-size: 1.3rem;
  color: var(--accent-amber);
  margin: 1.75rem 0 0.75rem;
}

.editorial-card p, .editorial-card li {
  color: #cbd5e1;
  font-size: 1.05rem;
  margin-bottom: 1rem;
}

.editorial-card ul, .editorial-card ol {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.feature-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 0.75rem;
  padding: 1.25rem;
}

.feature-box h4 {
  color: #fff;
  margin-bottom: 0.5rem;
}

/* Footer */
footer {
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  padding: 3rem 0;
  margin-top: auto;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2.5rem;
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--accent-amber);
}
