/* ============================================
   VMDProject Base CSS
   Sistema di design unificato per tutto il sito
   ============================================ */

/* CSS VARIABLES - Colori e Spacing */
:root {
  /* Colori Primari */
  --primary-blue: #2563eb;
  --primary-purple: #7c3aed;
  --primary-indigo: #1e40af;
  --primary-navy: #1e3a8a;
  
  /* Colori Secondari */
  --secondary-red: #ef4444;
  --secondary-pink: #ec4899;
  --secondary-green: #10b981;
  --secondary-emerald: #059669;
  --secondary-orange: #f97316;
  --secondary-yellow: #eab308;
  
  /* Gradienti */
  --gradient-primary: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  --gradient-hero: linear-gradient(135deg, #1e3a8a 0%, #7c3aed 50%, #1e40af 100%);
  --gradient-red: linear-gradient(135deg, #ef4444 0%, #ec4899 100%);
  --gradient-blue: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
  --gradient-green: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --gradient-orange: linear-gradient(135deg, #eab308 0%, #f97316 100%);
  --gradient-purple: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --gradient-gray: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
  
  /* Grigi e Neutri */
  --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;
  
  /* Spacing System */
  --spacing-xs: 0.25rem;   /* 4px */
  --spacing-sm: 0.5rem;    /* 8px */
  --spacing-md: 1rem;      /* 16px */
  --spacing-lg: 1.5rem;    /* 24px */
  --spacing-xl: 2rem;      /* 32px */
  --spacing-2xl: 3rem;     /* 48px */
  --spacing-3xl: 4rem;     /* 64px */
  --spacing-4xl: 5rem;     /* 80px */
  
  /* Typography */
  --font-family: 'system-ui', '-apple-system', 'sans-serif';
  --font-size-xs: 0.75rem;    /* 12px */
  --font-size-sm: 0.875rem;   /* 14px */
  --font-size-base: 1rem;     /* 16px */
  --font-size-lg: 1.125rem;   /* 18px */
  --font-size-xl: 1.25rem;    /* 20px */
  --font-size-2xl: 1.5rem;    /* 24px */
  --font-size-3xl: 2rem;      /* 32px */
  --font-size-4xl: 2.5rem;    /* 40px */
  --font-size-5xl: 3rem;      /* 48px */
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.15);
  --shadow-2xl: 0 25px 50px rgba(0, 0, 0, 0.25);
  
  /* Border Radius */
  --radius-sm: 0.25rem;     /* 4px */
  --radius-md: 0.5rem;      /* 8px */
  --radius-lg: 1rem;        /* 16px */
  --radius-xl: 1.5rem;      /* 24px */
  --radius-full: 50%;
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* ============================================
   RESET CSS & BASE STYLES
   ============================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  line-height: 1.6;
  color: var(--gray-700);
  background-color: white;
  overflow-x: hidden;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  font-weight: bold;
  line-height: 1.2;
  margin-bottom: var(--spacing-md);
  color: var(--gray-900);
}

h1 {
  font-size: clamp(2.5rem, 8vw, 4.5rem);
}

h2 {
  font-size: clamp(2rem, 6vw, 3rem);
}

h3 {
  font-size: var(--font-size-2xl);
}

h4 {
  font-size: var(--font-size-xl);
}

p {
  margin-bottom: var(--spacing-md);
  line-height: 1.7;
}

/* Gradient Text Utility */
.gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

/* ============================================
   LAYOUT UTILITIES
   ============================================ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

.section {
  padding: var(--spacing-4xl) var(--spacing-md);
}

.section-alt {
  background-color: var(--gray-50);
}

.text-center {
  text-align: center;
}

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

.grid {
  display: grid;
  gap: var(--spacing-xl);
}

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

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

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 25px;
  border: none;
  font-size: var(--font-size-base);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-normal);
  text-decoration: none;
  text-align: center;
  line-height: 1.2;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
  transform: translateY(-2px);
}

.btn-secondary {
  background: transparent;
  border: 2px solid white;
  color: white;
}

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

.btn-red {
  background: var(--gradient-red);
  color: white;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.btn-blue {
  background: var(--gradient-blue);
  color: white;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: var(--font-size-lg);
}

.btn-full {
  width: 100%;
}

/* ============================================
   CARDS
   ============================================ */
.card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  transition: var(--transition-normal);
  border: 1px solid #f1f5f9;
  overflow: hidden;
}

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

.card-header {
  padding: var(--spacing-xl);
  border-bottom: 1px solid var(--gray-200);
}

.card-body {
  padding: var(--spacing-xl);
}

.card-footer {
  padding: var(--spacing-lg) var(--spacing-xl);
  background: var(--gray-50);
  border-top: 1px solid var(--gray-200);
}

/* Project Cards */
.project-card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transition: var(--transition-slow);
}

.project-card:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-8px);
}

.project-hero {
  height: 16rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.project-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.2);
}

.project-content {
  position: relative;
  z-index: 10;
  color: white;
  text-align: center;
}

.project-letter {
  font-size: 4rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.project-subtitle {
  font-size: var(--font-size-sm);
  opacity: 0.9;
}

/* ============================================
   NAVIGATION
   ============================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-md);
  z-index: 1000;
  transition: var(--transition-normal);
}

.navbar-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: bold;
  cursor: pointer;
  transition: var(--transition-normal);
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: var(--spacing-xl);
  list-style: none;
}

.nav-link {
  padding: 0.5rem var(--spacing-md);
  font-size: var(--font-size-sm);
  font-weight: 500;
  border: none;
  background: none;
  cursor: pointer;
  transition: var(--transition-normal);
  color: var(--gray-700);
  text-decoration: none;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary-blue);
}

.nav-link.active {
  border-bottom: 2px solid var(--primary-blue);
}

/* Mobile Menu */
.mobile-menu-toggle {
  display: none;
  padding: var(--spacing-sm);
  border: none;
  background: none;
  cursor: pointer;
  color: var(--gray-700);
}

.mobile-menu {
  background: white;
  border-top: 1px solid var(--gray-200);
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: var(--transition-normal);
}

.mobile-menu.open {
  max-height: 400px;
  opacity: 1;
}

.mobile-menu-items {
  padding: var(--spacing-sm) var(--spacing-md);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.mobile-nav-link {
  width: 100%;
  text-align: left;
  padding: 0.75rem var(--spacing-md);
  font-size: var(--font-size-base);
  font-weight: 500;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition-normal);
  color: var(--gray-700);
}

.mobile-nav-link:hover {
  color: var(--primary-blue);
  background: #eff6ff;
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
  margin-bottom: var(--spacing-lg);
}

.form-label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: var(--spacing-sm);
}

.form-input {
  width: 100%;
  padding: 0.75rem var(--spacing-md);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  transition: var(--transition-normal);
  outline: none;
}

.form-input:focus {
  border-color: var(--primary-blue);
}

.form-textarea {
  resize: none;
  min-height: 120px;
}

.form-select {
  background: white;
  cursor: pointer;
}

/* ============================================
   SKILLS/PROGRESS BARS
   ============================================ */
.skill-item {
  margin-bottom: var(--spacing-xl);
}

.skill-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.skill-name {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--gray-900);
  transition: var(--transition-normal);
}

.skill-percentage {
  color: var(--primary-blue);
  font-weight: bold;
  font-size: var(--font-size-lg);
}

.skill-bar {
  height: var(--spacing-md);
  border-radius: var(--radius-md);
  overflow: hidden;
  background-color: var(--gray-200);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.skill-progress {
  height: 100%;
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  transition: all 1s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.skill-progress::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.4) 50%, transparent 100%);
  opacity: 0.3;
  animation: shimmer 2s infinite;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
  min-height: 100vh;
  background: var(--gradient-hero);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0.1;
  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.3'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-content {
  position: relative;
  z-index: 10;
  text-align: center;
  color: white;
  width: 100%;
}

.hero-title {
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: bold;
  margin-bottom: 1.5rem;
  animation: pulse 2s infinite;
}

.hero-subtitle {
  font-size: clamp(1.125rem, 4vw, 1.5rem);
  color: #bfdbfe;
  margin-bottom: 2rem;
  max-width: 48rem;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.hero-buttons {
  display: flex;
  gap: var(--spacing-md);
  justify-content: center;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.hero-projects {
  display: flex;
  gap: var(--spacing-md);
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

/* Scroll Indicator */
.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  cursor: pointer;
  animation: bounce 2s infinite;
}

.scroll-mouse {
  width: 24px;
  height: 40px;
  border: 2px solid white;
  border-radius: 20px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 8px;
}

.scroll-dot {
  width: 4px;
  height: 12px;
  background: white;
  border-radius: 2px;
  animation: pulse 2s infinite;
}

/* ============================================
   SCROLL TO TOP BUTTON
   ============================================ */
.scroll-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--gradient-primary);
  color: white;
  padding: var(--spacing-md);
  border-radius: var(--radius-full);
  border: none;
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.4);
  cursor: pointer;
  transition: var(--transition-normal);
  z-index: 1000;
  width: 3.5rem;
  height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-xl);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-to-top:hover {
  box-shadow: 0 6px 25px rgba(37, 99, 235, 0.6);
  transform: scale(1.1);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Hover Effects */
.hover-scale {
  transition: var(--transition-normal);
}

.hover-scale:hover {
  transform: scale(1.05);
}

.hover-shadow:hover {
  box-shadow: var(--shadow-xl);
}

.hover-lift:hover {
  transform: translateY(-5px);
}

/* Loading Spinner */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-hero);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-content {
  text-align: center;
  color: white;
}

.loading-spinner {
  width: 64px;
  height: 64px;
  border: 4px solid white;
  border-top: 4px solid transparent;
  border-radius: var(--radius-full);
  animation: spin 1s linear infinite;
  margin: 0 auto var(--spacing-md);
}

.loading-title {
  font-size: var(--font-size-xl);
  font-weight: 600;
}

.loading-subtitle {
  color: #bfdbfe;
  font-size: var(--font-size-sm);
  margin-top: var(--spacing-sm);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* Animation Classes */
.animate-bounce {
  animation: bounce 2s infinite;
}

.animate-pulse {
  animation: pulse 2s infinite;
}

.animate-fadeInUp {
  animation: fadeInUp 0.8s ease-out;
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
  .navbar-nav {
    display: none;
  }
  
  .mobile-menu-toggle {
    display: block;
  }
  
  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .hero-projects {
    flex-direction: column;
  }
  
  .grid-2 {
    grid-template-columns: 1fr;
  }
  
  .section {
    padding: var(--spacing-2xl) var(--spacing-md);
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 var(--spacing-sm);
  }
  
  .card-body {
    padding: var(--spacing-md);
  }
  
  .btn {
    padding: 0.75rem 1.5rem;
    font-size: var(--font-size-sm);
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  .navbar,
  .scroll-to-top,
  .loading-screen {
    display: none !important;
  }
  
  .hero {
    min-height: auto;
    padding: var(--spacing-xl) 0;
  }
  
  * {
    box-shadow: none !important;
  }
}