/* CONTATORE EFFETTO VETRO */

/* VARIABILI CSS GLOBALI */
:root {
  /* Colori */
  --color-positive: rgba(52, 168, 83, 0.9);
  --color-negative: rgba(251, 146, 160, 0.9);
  --color-neutral: rgba(71, 85, 105, 0.9);
  --color-accent: #4c63d2;
  
  /* Effetti Vetro */
  --glass-bg: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.25) 0%,
    rgba(255, 255, 255, 0.05) 30%,
    rgba(255, 255, 255, 0.1) 70%,
    rgba(255, 255, 255, 0.3) 100%
  );
  --glass-border: rgba(255, 255, 255, 0.3);
  --glass-border-highlight: rgba(255, 255, 255, 0.6);
  --glass-blur: blur(25px) saturate(180%);
  
  /* Ombre */
  --shadow-primary: 0 20px 60px rgba(0, 0, 0, 0.3);
  --shadow-secondary: 0 8px 32px rgba(255, 255, 255, 0.1);
  --shadow-inset-light: inset 0 2px 0 rgba(255, 255, 255, 0.4);
  --shadow-inset-dark: inset 0 -2px 0 rgba(255, 255, 255, 0.1);
  --shadow-btn: 0 8px 32px rgba(31, 38, 135, 0.37);
  
  /* Tipografia */
  --font-family: "Segoe UI", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-weight-bold: 700;
  --font-weight-medium: 500;
  
  /* Spaziature */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 2rem;
  --spacing-lg: 3.5rem;
  --spacing-xl: 4rem;
  
  /* Dimensioni */
  --diamond-size: 160px;
  --btn-size: 60px;
  --border-radius-sm: 20px;
  --border-radius-md: 30px;
  --border-radius-full: 50%;
  
  /* Transizioni */
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: all 0.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* RESET E STILI DI BASE */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #a8edea 100%);
  font-family: var(--font-family);
  font-display: swap;
  overflow: hidden;
}

/* LAYOUT PRINCIPALE */
.counter-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-xl);
  position: relative;
  z-index: 1;
}

.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-lg);
  position: relative;
}

.actions {
  display: flex;
  justify-content: center;
}

/* DISPLAY A DIAMANTE */
.diamond {
  position: relative;
  width: var(--diamond-size);
  height: var(--diamond-size);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-top: 2px solid var(--glass-border-highlight);
  border-left: 2px solid var(--glass-border-highlight);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius-sm);
  transform: rotate(45deg);
  transition: var(--transition-smooth);
  
  /* Ombre */
  box-shadow: 
    var(--shadow-primary),
    var(--shadow-secondary),
    var(--shadow-inset-light),
    var(--shadow-inset-dark),
    inset 2px 0 0 rgba(255, 255, 255, 0.2),
    inset -2px 0 0 rgba(255, 255, 255, 0.05);
  
  /* Allineamento Contenuto */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  
  /* Tipografia */
  font-family: var(--font-family);
  font-weight: var(--font-weight-bold);
  font-size: 3rem;
  color: var(--color-neutral);
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

/* Effetti Vetro del Diamante */
.diamond::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.4) 0%,
    rgba(255, 255, 255, 0.1) 50%,
    transparent 100%
  );
  border-radius: var(--border-radius-sm) var(--border-radius-sm) 0 0;
  pointer-events: none;
}

.diamond::after {
  content: "";
  position: absolute;
  top: 10%;
  left: 10%;
  width: 30%;
  height: 30%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.6) 0%,
    rgba(255, 255, 255, 0.2) 40%,
    transparent 70%
  );
  border-radius: var(--border-radius-full);
  filter: blur(1px);
  pointer-events: none;
}

/* Valore del Diamante */
.diamond__value {
  transform: rotate(-45deg);
  display: inline-block;
  width: 100%;
  text-align: center;
  transition: var(--transition-smooth);
  position: relative;
  z-index: 2;
}

/* PULSANTI */
.btn {
  position: relative;
  width: var(--btn-size);
  height: var(--btn-size);
  font-size: 1.5rem;
  font-weight: var(--font-weight-bold);
  font-family: var(--font-family);
  border-radius: var(--border-radius-full);
  border: none;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--color-accent);
  cursor: pointer;
  transition: var(--transition-smooth);
  user-select: none;
  
  /* Ombre */
  box-shadow: 
    var(--shadow-btn),
    0 2px 8px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  
  /* Allineamento Contenuto */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Varianti Pulsanti */
.btn--reset {
  width: auto;
  height: auto;
  padding: 12px 32px;
  border-radius: var(--border-radius-md);
  font-size: 1.1rem;
}

/* Contenuto Pulsanti */
.btn__symbol,
.btn__text {
  transition: var(--transition-bounce);
  position: relative;
  z-index: 2;
}

/* Stati Pulsanti (hover, active) */
.btn:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 
    0 12px 40px rgba(31, 38, 135, 0.4),
    0 4px 12px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.btn:active {
  transform: translateY(0);
  transition: var(--transition-bounce);
}

.btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* ANIMAZIONI */
@keyframes pulse-luxury {
  0% {
    transform: rotate(45deg) scale(1);
    filter: brightness(1) saturate(120%);
  }
  50% {
    transform: rotate(45deg) scale(1.05);
    filter: brightness(1.1) saturate(140%);
  }
  100% {
    transform: rotate(45deg) scale(1);
    filter: brightness(1) saturate(120%);
  }
}

.diamond--pulse {
  animation: pulse-luxury 0.3s cubic-bezier(0.4, 0, 0.6, 1);
}

/* ACCESSIBILITÀ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* DESIGN RESPONSIVE */
@media (max-width: 480px) {
  :root {
    --diamond-size: 120px;
    --btn-size: 50px;
    --spacing-lg: 2.5rem;
    --spacing-xl: 3rem;
  }
  
  .diamond {
    font-size: 2.5rem;
  }
  
  .btn {
    font-size: 1.25rem;
  }
}

/* NOTIFICHE TOAST */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  
  /* Effetto Vetro */
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.3) 0%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0.2) 100%
  );
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-top: 1px solid rgba(255, 255, 255, 0.6);
  
  /* Tipografia e Layout */
  color: rgba(255, 255, 255, 0.95);
  font-family: var(--font-family);
  font-weight: var(--font-weight-medium);
  font-size: 0.95rem;
  padding: 1rem 2rem;
  border-radius: 25px;
  
  /* Ombre */
  box-shadow: 
    0 12px 40px rgba(0, 0, 0, 0.2),
    0 4px 16px rgba(255, 255, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  
  /* Proprietà Animazione */
  opacity: 0;
  scale: 0.8;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 9999;
  pointer-events: none;
  
  /* Effetti Testo */
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.02em;
}

/* Stato Visibile del Toast */
.toast--show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  scale: 1;
  pointer-events: auto;
}

/* Animazione Uscita Toast */
.toast--hide {
  transform: translateX(-50%) translateY(-20px);
  opacity: 0;
  scale: 0.95;
  filter: blur(2px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.6, 1);
}

/* Variante Successo Toast */
.toast--success {
  background: linear-gradient(
    135deg,
    rgba(34, 197, 94, 0.3) 0%,
    rgba(34, 197, 94, 0.1) 50%,
    rgba(34, 197, 94, 0.2) 100%
  );
  border-color: rgba(34, 197, 94, 0.4);
  border-top-color: rgba(34, 197, 94, 0.6);
}

/* Toast Responsive */
@media (max-width: 480px) {
  .toast {
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    transform: translateY(100%);
    max-width: calc(100% - 2rem);
  }
  
  .toast--show {
    transform: translateY(0);
  }
  
  .toast--hide {
    transform: translateY(-20px);
  }
}

