/* Main Styles for Stampapertutti */

/* Global variables */
:root {
  --primary: #0f54b0;
  --accent: #0884ff;
  --text-dark: #333333;
  --text-light: #ffffff;
  --bg-light: #f8fafc;
  --bg-dark: #0f54b0;
  --font-sans: 'Open Sans', sans-serif;
  --font-heading: 'Montserrat', sans-serif;
  --clr-primary: #0056b3;
  --clr-primary-dark: #003d80;
  --clr-primary-light: #e6f0ff;
  --clr-accent: #ff6b00;
  --clr-font-main: hsla(0 0% 20% / 100);
  --clr-font-light: #f5f5f5;
  --clr-background-light: #f5f5f5;
  --clr-background-dark: #333333;
}

/* Base Typography */
html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--clr-font-main);
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
}

/* Animation Utilities */
.reveal-text {
  position: relative;
  display: inline-block;
}

.reveal-text::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--clr-primary);
  transition: width 0.6s ease-out;
  animation: line-reveal 1.5s ease-out 0.5s forwards;
}

@keyframes line-reveal {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

.fade-in {
  opacity: 0;
  animation: fade-in 1s ease-out forwards;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Component Styles */
.card {
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Button Styles */
.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 0.375rem;
  font-weight: 600;
  transition: all 0.3s ease;
  display: inline-block;
  text-align: center;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
}

.btn-primary:hover {
  background-color: var(--accent);
}

.btn-donate {
  --btn-bg-1: hsla(194 100% 69% / 1);
  --btn-bg-2: hsla(217 100% 56% / 1);
  --btn-bg-color: hsla(360 100% 100% / 1);
  --radii: 0.5em;
  cursor: pointer;
  padding: 0.9em 1.4em;
  min-width: 120px;
  min-height: 44px;
  font-size: var(--size, 1rem);
  font-family: var(--font-sans);
  font-weight: 500;
  transition: 0.8s;
  background-size: 280% auto;
  background-image: linear-gradient(
    325deg,
    var(--btn-bg-2) 0%,
    var(--btn-bg-1) 55%,
    var(--btn-bg-2) 90%
  );
  border: none;
  border-radius: var(--radii);
  color: var(--btn-bg-color);
  box-shadow:
    0px 0px 20px rgba(71, 184, 255, 0.5),
    0px 5px 5px -1px rgba(58, 125, 233, 0.25),
    inset 4px 4px 8px rgba(175, 230, 255, 0.5),
    inset -4px -4px 8px rgba(19, 95, 216, 0.35);
  display: inline-block;
  text-align: center;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn-donate:hover {
  background-position: right top;
  transform: translateY(-3px);
}

.btn-donate:not(.btn-header) {
  animation: button-glow 2s infinite alternate;
}

@keyframes button-glow {
  0% {
    box-shadow:
      0px 0px 15px rgba(71, 184, 255, 0.4),
      0px 5px 5px -1px rgba(58, 125, 233, 0.25),
      inset 4px 4px 8px rgba(175, 230, 255, 0.5),
      inset -4px -4px 8px rgba(19, 95, 216, 0.35);
  }
  100% {
    box-shadow:
      0px 0px 25px rgba(71, 184, 255, 0.6),
      0px 5px 10px -1px rgba(58, 125, 233, 0.35),
      inset 4px 4px 8px rgba(175, 230, 255, 0.5),
      inset -4px -4px 8px rgba(19, 95, 216, 0.35);
  }
}

/* Utility Classes */
.shadow-custom {
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.transition-all {
  transition: all 0.3s ease;
}

/* Section Styles */
section {
  padding: 4rem 0;
}

.section-title {
  font-size: 2.25rem;
  margin-bottom: 2rem;
  position: relative;
}

.section-title:after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 100px;
  height: 3px;
  background-color: var(--accent);
}

/* Footer Styles */
footer {
  background-color: var(--bg-dark);
  color: var(--text-light);
  padding: 3rem 0;
}

.site-footer {
  background-color: var(--clr-primary-dark);
  color: var(--clr-font-light);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  section {
    padding: 2.5rem 0;
  }
  
  .section-title {
    font-size: 1.75rem;
  }
  
  .hero-content h1 {
    font-size: 2.5rem;
  }
}

@media (max-width: 576px) {
  .hero-content h1 {
    font-size: 2rem;
  }
}

/* Wave and Water Effect Styles */
/* Already included in the index.php inline styles */

/* Background pattern */
.bg-pattern {
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.2'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* Wave card styles */
.e-card {
  background: transparent;
  box-shadow: 0px 8px 28px -9px rgba(0,0,0,0.45);
  position: relative;
  height: 480px;
  border-radius: 16px;
  overflow: hidden;
  width: 100%;
  transition: all 0.3s ease;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

.e-card:hover {
  transform: translateY(-10px);
  box-shadow: 0px 15px 35px -5px rgba(0,0,0,0.5);
}

.wave {
  position: absolute;
  width: 540px;
  height: 700px;
  opacity: 0.6;
  left: 0;
  top: 0;
  margin-left: -50%;
  margin-top: -70%;
  background: linear-gradient(744deg,#105cdb,#3c89ef 60%,#00ddeb);
  z-index: 1;
  will-change: transform;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* Form styles */
.form-input {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  line-height: 1.5;
  color: #495057;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-input:focus {
  color: #495057;
  background-color: #fff;
  border-color: var(--clr-primary);
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--clr-font-main);
}

.form-group {
  margin-bottom: 1rem;
}

/* Header and footer styles */
.site-header {
  background-color: var(--clr-primary);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.site-header.scrolled {
  background-color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Back to top button */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 3rem;
  height: 3rem;
  background-color: var(--clr-primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
  z-index: 99;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

/* Miglioramenti per la compatibilità cross-browser e la visualizzazione */

/* Fix per backdrop-filter su browser meno recenti */
@supports not (backdrop-filter: blur(10px)) {
  .bg-white\/15 {
    background: rgba(255, 255, 255, 0.95) !important;
  }
}

/* Miglioramenti per le wave cards */
.e-card {
  /* Fallback per flexbox */
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  
  /* Fix per border-radius su Safari */
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

/* Fix per transform su iOS */
.trust-badge:hover,
.e-card:hover {
  -webkit-transform: translateY(-8px);
  -ms-transform: translateY(-8px);
  transform: translateY(-8px);
}

/* Miglioramenti per la visibilità del testo */
.trust-badge-text {
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

/* Fix per le wave animations */
.wave {
  will-change: transform;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* Miglioramenti per i gradient */
.bg-gradient-to-b {
  background: -webkit-linear-gradient(top, rgba(15, 84, 176, 0.1), #f1f5f9);
  background: linear-gradient(to bottom, rgba(15, 84, 176, 0.1), #f1f5f9);
}

/* Fix specifici per i problemi di layout evidenziati */

/* Miglioramenti per il flex layout dei trust badges */
.flex.flex-col.sm\:flex-row {
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
}

/* Fix per gap support su browser meno recenti */
@supports not (gap: 1rem) {
  .flex.flex-col.sm\:flex-row > * + * {
    margin-top: 1rem;
  }
  
  @media (min-width: 640px) {
    .flex.flex-col.sm\:flex-row > * + * {
      margin-top: 0;
      margin-left: 1.5rem;
    }
  }
}

/* Miglioramenti per le card responsive */
@media (max-width: 768px) {
  .trust-badge {
    min-height: 60px;
    justify-content: center;
    text-align: center;
  }
  
  .e-card {
    height: auto;
    min-height: 320px;
  }
}

/* Fix per problemi di overflow */
.overflow-hidden {
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  mask-image: radial-gradient(white, black);
}
