/* Custom styles for VegaVolley CMS */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --primary-color: #004aad;
  --secondary-color: #004aad;
  --accent-color: #004aad;
  --text-color: #1f2937;
  --bg-color: #ffffff;
  --border-color: #e5e7eb;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text-color);
  line-height: 1.6;
  background-color: var(--bg-color);
  scroll-behavior: smooth;
}

/* Accessibility improvements */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary-color);
  color: white;
  padding: 8px 16px;
  text-decoration: none;
  z-index: 100;
  border-radius: 0 0 4px 0;
}

.skip-link:focus {
  top: 0;
}

/* Animations */
@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scale-in {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
  }
  50% {
    box-shadow: 0 0 40px rgba(99, 102, 241, 0.8), 0 0 60px rgba(139, 92, 246, 0.4);
  }
}

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.animate-fade-in {
  animation: fade-in 0.8s ease-out;
}

.animate-fade-in-delay {
  animation: fade-in 0.8s ease-out 0.2s both;
}

.animate-fade-in-delay-2 {
  animation: fade-in 0.8s ease-out 0.4s both;
}

.animate-slide-in {
  animation: slide-in 0.6s ease-out;
}

.animate-scale-in {
  animation: scale-in 0.5s ease-out;
}

.float-animation {
  animation: float 6s ease-in-out infinite;
}

.pulse-glow {
  animation: pulse-glow 3s ease-in-out infinite;
}

.shimmer {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  background-size: 1000px 100%;
  animation: shimmer 2s infinite;
}

/* Line clamp utility */
.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Header */
header {
  background: white;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background-color: rgba(255, 255, 255, 0.95);
}

/* Footer */
footer {
  background: linear-gradient(135deg, #1f2937 0%, #111827 50%, #1f2937 100%);
  color: white;
  padding: 3rem 1rem;
  margin-top: 5rem;
}

footer a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: color 0.2s;
}

footer a:hover {
  color: white;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.875rem 1.75rem;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  text-decoration: none;
  border-radius: 0.75rem;
  font-weight: 600;
  transition: all 0.3s;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.btn:focus {
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
}

/* Cards */
.card {
  background: white;
  border-radius: 1rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: all 0.3s;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Glassmorphism effect */
.glass {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-color);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.875rem;
  border: 2px solid var(--border-color);
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: all 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Admin styles */
.admin-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

/* Admin background pattern */
.admin-bg-pattern {
  background-image: 
    radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 40% 20%, rgba(99, 102, 241, 0.03) 0%, transparent 50%);
}

/* Admin card hover effects */
.admin-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.admin-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Gradient text */
.gradient-text {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Loading spinner */
.spinner {
  border: 3px solid rgba(99, 102, 241, 0.1);
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .admin-container {
    padding: 1rem;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.75rem;
  }
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border-radius: 5px;
}

/* Admin background pattern with yellow colors */
.admin-bg-pattern {
  background-image: 
    radial-gradient(circle at 20% 50%, rgba(37, 99, 235, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(234, 179, 8, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 40% 20%, rgba(37, 99, 235, 0.03) 0%, transparent 50%);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--secondary-color);
}

/* Admin table enhancements */
.admin-table {
  border-collapse: separate;
  border-spacing: 0;
}

.admin-table thead th {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
  backdrop-filter: blur(10px);
}

.admin-table tbody tr {
  transition: all 0.2s;
}

.admin-table tbody tr:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(139, 92, 246, 0.05));
  transform: scale(1.01);
}

/* Badge styles */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  transition: all 0.2s;
}

.badge:hover {
  transform: scale(1.05);
}

/* Input focus effects */
.input-focus:focus {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.3);
}

/* Button hover effects */
.btn-hover {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-hover:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Card entrance animation */
.card-entrance {
  animation: scale-in 0.5s ease-out;
}

/* Stagger animation for lists */
.stagger-item {
  opacity: 0;
  animation: fade-in 0.6s ease-out forwards;
}

.stagger-item:nth-child(1) { animation-delay: 0.1s; }
.stagger-item:nth-child(2) { animation-delay: 0.2s; }
.stagger-item:nth-child(3) { animation-delay: 0.3s; }
.stagger-item:nth-child(4) { animation-delay: 0.4s; }
.stagger-item:nth-child(5) { animation-delay: 0.5s; }
.stagger-item:nth-child(6) { animation-delay: 0.6s; }

/* Menu icon styles - rimuove quadrati e effetti indesiderati */
header nav .menu-icon,
header nav a .menu-icon,
header nav a i[class*="fa-"] {
  outline: none !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  display: inline-block !important;
  line-height: 1 !important;
  text-align: center !important;
  width: auto !important;
  height: auto !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
}

header nav a:hover .menu-icon,
header nav a:hover i[class*="fa-"],
header nav a:focus .menu-icon,
header nav a:focus i[class*="fa-"] {
  outline: none !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* Assicura che le icone non abbiano effetti di focus quadrati */
header nav a:focus {
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
  border-radius: 0.75rem;
}

header nav a:focus .menu-icon,
header nav a:focus i[class*="fa-"] {
  outline: none !important;
}

/* Cookie Consent Banner Styles - GDPR Compliant */
.cookie-consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #ffffff;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  z-index: 10000;
  padding: 0;
  transform: translateY(100%);
  transition: transform 0.3s ease-in-out;
  max-height: 90vh;
  overflow-y: auto;
  border-top: 3px solid var(--primary-color);
}

/* Overlay background rimosso per migliorare la leggibilità */
/* Il banner è già ben visibile in fondo alla pagina senza bisogno di overlay */

.cookie-consent-banner-visible {
  transform: translateY(0);
}

.cookie-consent-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}

.cookie-consent-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.cookie-consent-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-color);
  margin: 0;
}

.cookie-icon {
  width: 24px;
  height: 24px;
  color: var(--primary-color);
  flex-shrink: 0;
}

.cookie-consent-close {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--text-color);
  opacity: 0.7;
  transition: all 0.2s;
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cookie-consent-close:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.05);
}

.cookie-consent-close:focus {
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
}

.cookie-consent-description {
  color: #4b5563;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.cookie-consent-link {
  color: var(--primary-color);
  text-decoration: underline;
  font-weight: 500;
  transition: color 0.2s;
}

.cookie-consent-link:hover {
  color: var(--secondary-color);
}

.cookie-consent-link:focus {
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
  border-radius: 2px;
}

.cookie-consent-options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.cookie-option {
  padding: 1rem;
  background: #f9fafb;
  border-radius: 0.5rem;
  border: 1px solid var(--border-color);
  transition: all 0.2s;
}

.cookie-option:hover {
  background: #f3f4f6;
  border-color: var(--primary-color);
}

.cookie-option-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
  margin: 0;
}

.cookie-checkbox {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  cursor: pointer;
  accent-color: var(--primary-color);
  flex-shrink: 0;
}

.cookie-checkbox:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.cookie-checkbox:focus {
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
  border-radius: 2px;
}

.cookie-option-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.cookie-option-text strong {
  color: var(--text-color);
  font-size: 0.95rem;
  font-weight: 600;
}

.cookie-option-text small {
  color: #6b7280;
  font-size: 0.875rem;
  line-height: 1.5;
}

.cookie-consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
}

.cookie-btn {
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 140px;
}

.cookie-btn-primary {
  background: var(--primary-color);
  color: white;
  box-shadow: 0 2px 4px rgba(0, 74, 173, 0.2);
}

.cookie-btn-primary:hover {
  background: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 74, 173, 0.3);
}

.cookie-btn-primary:focus {
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
}

.cookie-btn-secondary {
  background: #f3f4f6;
  color: var(--text-color);
  border: 1px solid var(--border-color);
}

.cookie-btn-secondary:hover {
  background: #e5e7eb;
  border-color: var(--primary-color);
  transform: translateY(-2px);
}

.cookie-btn-secondary:focus {
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
}

.cookie-btn:active {
  transform: translateY(0);
}

/* Settings mode (for privacy policy page) - only when explicitly needed */
.cookie-consent-banner-settings {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  transform: translateY(0) !important;
  margin: 0 !important;
  border-radius: 0;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
}

/* Responsive Design */
@media (max-width: 768px) {
  .cookie-consent-content {
    padding: 1rem;
  }

  .cookie-consent-title {
    font-size: 1.1rem;
  }

  .cookie-consent-description {
    font-size: 0.9rem;
  }

  .cookie-consent-actions {
    flex-direction: column;
  }

  .cookie-btn {
    width: 100%;
    min-width: unset;
  }

  .cookie-consent-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .cookie-consent-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
  }
}

@media (max-width: 480px) {
  .cookie-consent-banner {
    max-height: 95vh;
  }

  .cookie-option {
    padding: 0.75rem;
  }

  .cookie-option-text strong {
    font-size: 0.9rem;
  }

  .cookie-option-text small {
    font-size: 0.8rem;
  }
}

/* Print styles - hide banner when printing */
@media print {
  .cookie-consent-banner {
    display: none !important;
  }
}