/* styles.css - Sistema CSS Completo e Moderno per PetCard V3 */

/* ============================================================
   CSS CUSTOM PROPERTIES (Variabili)
   ============================================================ */
:root {
  --primary: #FFC200;
  --primary-dark: #1a1a1a;
  --primary-light: #FFF8E1;
  --accent: #e63329;
  --accent-dark: #c62828;
  --success: #4caf50;
  --warning: #ff9800;
  --danger: #e63329;
  --bg: #f5f5f5;
  --bg-dark: #1e1e2f;
  --card-bg: #ffffff;
  --card-dark: #2a2a40;
  --text-primary: #1a1a1a;
  --text-muted: #6b7280;
  --border-color: #e5e7eb;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   RESET E FONDAMENTI
   ============================================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 16px;
}

/* ============================================================
   TIPOGRAFIA
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.5em;
}

h1 {
  font-size: 2.5rem;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.5rem;
}

h4 {
  font-size: 1.25rem;
}

h5 {
  font-size: 1.1rem;
}

h6 {
  font-size: 1rem;
}

p {
  margin-bottom: 1em;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

small {
  font-size: 0.875rem;
  color: var(--text-muted);
}

code {
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 0.2em 0.4em;
  border-radius: var(--radius-sm);
  font-size: 0.9em;
}

/* ============================================================
   LAYOUT CONTAINER
   ============================================================ */
.wrap,
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

@media (max-width: 768px) {
  .wrap,
  .container {
    padding: 1rem;
  }
}

/* ============================================================
   FLEXBOX UTILITIES
   ============================================================ */
.flex {
  display: flex;
}

.flex-column {
  flex-direction: column;
}

.flex-center {
  justify-content: center;
  align-items: center;
}

.flex-between {
  justify-content: space-between;
  align-items: center;
}

.flex-start {
  justify-content: flex-start;
  align-items: center;
}

.flex-end {
  justify-content: flex-end;
  align-items: center;
}

.flex-wrap {
  flex-wrap: wrap;
}

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }

/* ============================================================
   GRID LAYOUT
   ============================================================ */
.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.grid-auto {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

@media (max-width: 768px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   HEADER / NAVIGAZIONE
   ============================================================ */
.site-header {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--text-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand:hover {
  color: var(--primary);
}

.logo {
  height: 40px;
  width: auto;
}

.main-nav {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.main-nav a {
  color: var(--text-muted);
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.main-nav a:hover {
  color: var(--primary);
  background: var(--primary-light);
  text-decoration: none;
}

@media (max-width: 768px) {
  .main-nav {
    gap: 1rem;
  }

  .main-nav a {
    padding: 0.25rem 0.5rem;
    font-size: 0.9rem;
  }
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-hover {
  cursor: pointer;
}

.card-hover:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.card-header {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.card-body {
  color: var(--text-muted);
}

.card-footer {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: white;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
  text-align: center;
}

.btn:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

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

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

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
}

.btn-secondary {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--primary-light);
  border-color: var(--primary-dark);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover:not(:disabled) {
  background: #c62828;
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover:not(:disabled) {
  background: #388e3c;
}

.btn-outline {
  background: transparent;
  border-color: var(--border-color);
  color: var(--text-primary);
}

.btn-outline:hover:not(:disabled) {
  background: var(--bg);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1.1rem;
}

.btn-block {
  width: 100%;
}

/* ============================================================
   FORMS
   ============================================================ */
.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

input[type='text'],
input[type='email'],
input[type='password'],
input[type='number'],
input[type='date'],
input[type='time'],
textarea,
select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  background: var(--card-bg);
  color: var(--text-primary);
  transition: var(--transition);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 194, 0, 0.2);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

input[type='checkbox'],
input[type='radio'] {
  margin-right: 0.5rem;
  cursor: pointer;
}

/* ============================================================
   BADGES E PILLS
   ============================================================ */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--primary-light);
  color: var(--primary-dark);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-primary {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.badge-success {
  background: #e8f5e9;
  color: #2e7d32;
}

.badge-warning {
  background: #fff3e0;
  color: #e65100;
}

.badge-danger {
  background: #ffebee;
  color: #c62828;
}

.badge-muted {
  background: #f5f5f5;
  color: #757575;
}

.pill {
  border-radius: 999px;
  padding: 0.5rem 1rem;
}

/* ============================================================
   TABELLE
   ============================================================ */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

thead {
  background: var(--primary);
  color: white;
}

th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.875rem;
  letter-spacing: 0.5px;
}

td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
}

tbody tr:hover {
  background: var(--bg);
}

tbody tr:last-child td {
  border-bottom: none;
}

/* ============================================================
   ALERT / NOTIFICHE
   ============================================================ */
.alert {
  padding: 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  border-left: 4px solid transparent;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.alert-primary {
  background: #e3f2fd;
  border-color: var(--primary);
  color: var(--primary-dark);
}

.alert-success {
  background: #e8f5e9;
  border-color: var(--success);
  color: #2e7d32;
}

.alert-warning {
  background: #fff3e0;
  border-color: var(--warning);
  color: #e65100;
}

.alert-danger {
  background: #ffebee;
  border-color: var(--danger);
  color: #c62828;
}

/* ============================================================
   LOADING STATES
   ============================================================ */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--border-color);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================================
   DASHBOARD SPECIFIC
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  text-align: center;
  border-bottom: 4px solid var(--primary);
}

.stat-card h3 {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.875rem;
  text-transform: uppercase;
  font-weight: 600;
}

.stat-card .number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-top: 1rem;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ============================================================
   PET CARDS
   ============================================================ */
.pet-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.pet-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.pet-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.pet-info {
  padding: 1.5rem;
}

.pet-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.pet-breed {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* ============================================================
   RESPONSIVE DESIGN
   ============================================================ */
@media (max-width: 1024px) {
  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }
}

@media (max-width: 768px) {
  body {
    font-size: 15px;
  }

  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  .grid,
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .main-nav {
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
  }

  .main-nav a {
    width: 100%;
  }

  .dashboard-header {
    flex-direction: column;
    align-items: stretch;
  }

  table {
    font-size: 0.85rem;
  }

  th,
  td {
    padding: 0.75rem;
  }

  .btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .wrap,
  .container {
    padding: 1rem;
  }

  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.1rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .btn-block {
    width: 100%;
  }

  input[type='text'],
  input[type='email'],
  input[type='password'],
  textarea,
  select {
    padding: 0.6rem;
  }

  table {
    font-size: 0.75rem;
  }

  th,
  td {
    padding: 0.5rem;
  }
}

/* Dark mode rimosso intenzionalmente: il sito usa solo tema chiaro */

/* ============================================================
   ARCAPLANET THEME OVERRIDES
   ============================================================ */

/* Bottoni: giallo + testo nero; hover: nero + testo bianco */
.btn {
  color: #1a1a1a;
  font-weight: 700;
}

.btn:hover:not(:disabled) {
  background: #1a1a1a;
  color: #ffffff;
}

.btn-primary {
  background: var(--primary);
  color: #1a1a1a;
}

.btn-primary:hover:not(:disabled) {
  background: #1a1a1a;
  color: #ffffff;
}

.btn-secondary {
  background: transparent;
  color: #1a1a1a;
  border-color: #1a1a1a;
}

.btn-secondary:hover:not(:disabled) {
  background: #1a1a1a;
  color: #ffffff;
}

/* Tabella: header nero invece di giallo */
thead {
  background: #1a1a1a;
  color: #ffffff;
}

/* Stat card: numero nero, bordo giallo */
.stat-card .number {
  color: #1a1a1a;
}

/* Badge primary: giallo + testo nero */
.badge-primary {
  background: var(--primary);
  color: #1a1a1a;
}

.badge {
  background: var(--primary);
  color: #1a1a1a;
}

/* Link: nero invece di viola */
a {
  color: #1a1a1a;
}

a:hover {
  color: var(--primary-dark);
}

/* Nav: hover giallo */
.main-nav a:hover {
  color: #1a1a1a;
  background: var(--primary);
}

/* Alert primary: bordo giallo */
.alert-primary {
  background: var(--primary-light);
  border-color: var(--primary);
  color: #1a1a1a;
}

/* Code: giallo chiaro */
code {
  background: var(--primary-light);
  color: #1a1a1a;
}

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
  body {
    background: white;
  }

  .site-header,
  .btn,
  button,
  nav {
    display: none;
  }

  .card,
  table {
    box-shadow: none;
    border: 1px solid #000;
    page-break-inside: avoid;
  }
}
