@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --blue-50: #eff6ff;
  --blue-100: #dbeafe;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --blue-800: #1e40af;
  --blue-900: #1e3a5f;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);
  --bg-primary: #ffffff;
  --bg-secondary: var(--gray-50);
  --text-primary: var(--gray-900);
  --text-secondary: var(--gray-500);
  --border-color: var(--gray-200);
  --card-bg: #ffffff;
  --navbar-bg: var(--blue-700);
  --footer-bg: var(--gray-900);
  --input-bg: #ffffff;
  --input-text: var(--gray-900);
  --canvas-bg: #ffffff;
}

[data-bs-theme="dark"] {
  --bg-primary: #0f1117;
  --bg-secondary: #1a1d27;
  --text-primary: #e5e7eb;
  --text-secondary: #9ca3af;
  --border-color: #2d3348;
  --card-bg: #1a1d27;
  --navbar-bg: #111827;
  --footer-bg: #0a0c10;
  --input-bg: #1f2335;
  --input-text: #e5e7eb;
  --canvas-bg: #1a1d27;
}

* { box-sizing: border-box; }

html {
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  padding-top: 62px;
  transition: background-color 0.3s, color 0.3s;
  letter-spacing: -0.01em;
}

@media (min-width: 992px) {
  body { padding-top: 64px; }
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-main);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--text-primary);
}

h1 { font-size: 2.2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.15rem; }

p, li, td, th, label, input, select, textarea, button, a, span, div, font {
  font-family: var(--font-main);
}

a {
  color: var(--blue-600);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover {
  color: var(--blue-800);
}

/* ==================== NAVBAR ==================== */
.navbar {
  background: var(--navbar-bg) !important;
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.navbar-brand {
  font-weight: 700 !important;
  font-size: 1rem !important;
  letter-spacing: -0.02em;
}

.bottoneMenu {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.1);
  color: #fff !important;
  margin: 3px;
  padding: 6px 14px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0;
  text-decoration: none;
  transition: all 0.2s;
  box-shadow: none;
  width: auto;
}
.bottoneMenu:hover {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.3);
  color: #fff !important;
  transform: translateY(-1px);
}
.bottoneMenu i {
  font-size: 0.85rem;
}

#top-menu a:link, #top-menu a:visited { color: rgba(255,255,255,0.85); }
#top-menu a:hover { color: #fff; }
#top-menu a:active { color: #fff; }
.activePage a { font-weight: 600; color: #fff !important; }

/* ==================== CARDS ==================== */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: transform 0.2s, box-shadow 0.2s;
  overflow: hidden;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.card-body {
  padding: 1.5rem;
  font-size: 0.95rem;
  color: var(--text-secondary);
}
.card-footer {
  background: transparent;
  border-top: 1px solid var(--border-color);
  padding: 1rem 1.5rem;
}

/* ==================== FORMS ==================== */
.form-control, .form-select {
  font-family: var(--font-main);
  font-size: 0.9rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
  background: var(--input-bg);
  color: var(--input-text);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
  outline: none;
}
.form-control::placeholder {
  color: var(--gray-400);
  font-weight: 400;
}

.form-signin {
  max-width: 360px;
  padding: 20px;
  margin: 0 auto;
}
.form-signin .form-control {
  margin-bottom: 0.75rem;
  border-radius: var(--radius-sm);
}
.form-signin input[type="text"],
.form-signin input[type="password"] {
  border-radius: var(--radius-sm);
}

.account-wall {
  margin-top: 20px;
  padding: 2rem 1.5rem;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

/* ==================== BUTTONS ==================== */
.btn {
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: var(--radius-sm);
  padding: 0.5rem 1.25rem;
  transition: all 0.2s;
  letter-spacing: 0;
}
.btn-primary {
  background: var(--blue-600);
  border-color: var(--blue-600);
  box-shadow: 0 1px 2px rgba(37,99,235,0.2);
}
.btn-primary:hover {
  background: var(--blue-700);
  border-color: var(--blue-700);
  box-shadow: 0 4px 12px rgba(37,99,235,0.25);
  transform: translateY(-1px);
}
.btn-lg {
  padding: 0.65rem 1.75rem;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
}

/* ==================== TABLES ==================== */
.table {
  font-size: 0.875rem;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md) !important;
  border: none !important;
}
.table th, .table td {
  padding: 0.75rem 1rem;
  vertical-align: middle;
  border: none;
  border-bottom: 1px solid var(--border-color);
}
.table-striped > tbody > tr:nth-of-type(odd) {
  background: var(--bg-secondary);
}
.table-striped > tbody > tr:hover {
  background: var(--blue-50);
}
[data-bs-theme="dark"] .table-striped > tbody > tr:hover {
  background: rgba(59,130,246,0.08);
}

td[style*="background:#0099ff"],
.adminHead {
  font-family: var(--font-main) !important;
  font-weight: 600 !important;
  color: #fff !important;
  background: var(--blue-700) !important;
  text-align: center;
  font-size: 0.85rem;
  letter-spacing: 0;
  padding: 0.75rem 1rem;
}

.adminRow { font-family: var(--font-main); }
.adminFoot { font-family: var(--font-main); background: var(--gray-100); }

/* ==================== FOOTER ==================== */
footer {
  position: relative;
  bottom: auto;
  width: 100%;
  color: rgba(255,255,255,0.7);
  font-size: 0.8rem;
}
footer a { color: rgba(255,255,255,0.6); }
footer a:hover { color: #fff; }
footer.bg-dark {
  background: var(--footer-bg) !important;
}

/* ==================== SOCIAL ==================== */
.icon-circle i {
  font-size: 1rem;
  color: rgba(255,255,255,0.8);
  height: 32px;
  width: 32px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.3);
  line-height: 32px;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
}
.icon-circle i:hover {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.5);
  color: #fff;
  transform: scale(1.1);
}

/* ==================== DARK MODE TOGGLE ==================== */
.dark-mode-toggle {
  cursor: pointer;
  background: none;
  border: 1.5px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.8);
  transition: all 0.2s;
  padding: 0;
}
.dark-mode-toggle:hover {
  border-color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.1);
  color: #fff;
}

/* ==================== HERO (Homepage) ==================== */
.hero-gradient {
  background: linear-gradient(135deg, var(--blue-800) 0%, var(--blue-600) 50%, #0ea5e9 100%);
}

/* ==================== MODELER FOOTER ==================== */
footer.bg-dark.card {
  border: none;
  border-radius: 0;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.8rem;
}
footer .form-group label {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.7;
}
footer .form-control {
  font-size: 0.8rem;
  padding: 0.35rem 0.6rem;
  border-radius: 4px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
}
footer .form-control:focus {
  background: rgba(255,255,255,0.12);
  border-color: var(--blue-500);
  color: #fff;
}

/* ==================== DARK MODE OVERRIDES ==================== */
[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .account-wall {
  background-color: var(--card-bg) !important;
  border-color: var(--border-color) !important;
  color: var(--text-primary);
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
  background-color: var(--input-bg);
  color: var(--input-text);
  border-color: var(--border-color);
}

[data-bs-theme="dark"] .navbar {
  background-color: var(--navbar-bg) !important;
}

[data-bs-theme="dark"] #canvas {
  background-color: var(--canvas-bg);
}

[data-bs-theme="dark"] .table {
  color: var(--text-primary);
}

[data-bs-theme="dark"] .bg-secondary {
  background-color: var(--bg-secondary) !important;
}

/* ==================== BADGES ==================== */
.badge {
  font-family: var(--font-main);
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: var(--radius-sm);
}

/* ==================== ALERTS ==================== */
.alert {
  font-family: var(--font-main);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
}

/* ==================== PRINT ==================== */
@media print {
  .navbar, .no-print, .no-print * { display: none !important; }
  footer { display: none !important; }
  @page { size: auto; }
  body { padding-top: 0; }
}

/* ==================== MISC ==================== */
.login-title { color: var(--text-secondary); font-size: 1rem; font-weight: 500; }
.profile-img { width: 96px; height: 96px; margin: 0 auto 10px; display: block; border-radius: 50%; }

div.ruota {
  width: 500px;
  height: 250px;
  transform: rotate(90deg);
}

.text-shadow { text-shadow: none; }

font[size] { font-size: inherit !important; }
font[face] { font-family: var(--font-main) !important; }
font[color="white"] { color: #fff !important; }

.well {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
}

/* Smooth scrolling */
html { scroll-behavior: smooth; }

/* Selection color */
::selection {
  background: var(--blue-500);
  color: #fff;
}
