/* 
   style.css - Premium Medical Design System for Gastroenterologia
   Dott. Domenico Catarella
*/

/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  /* Color Palette */
  --primary-color: #69c014;      /* Deep Medical Burgundy */
  --primary-hover: #58a010;
  --secondary-color: #00b4e9;    /* Trustful Slate Blue */
  --secondary-light: #e6ebf4;
  --accent-color: #d97706;       /* Warm Amber/Gold */
  --text-dark: #1e293b;          /* Charcoal */
  --text-muted: #64748b;         /* Slate Grey */
  --bg-light: #f8fafc;           /* Ultra Light Grey */
  --bg-white: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.85);
  
  /* Font Families */
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  /* Borders and Shadows */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.03);
  --glass-bg: rgba(255, 255, 255, 0.8);
  --glass-border: rgba(255, 255, 255, 0.4);
  
  /* Transitions */
  --transition-fast: all 0.2s ease;
  --transition-normal: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset and Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  color: var(--text-dark);
  background-color: var(--bg-light);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--secondary-color);
  font-weight: 700;
  line-height: 1.25;
}

p {
  margin-bottom: 1rem;
}

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

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.animate-fade-in {
  animation: fadeIn 0.8s ease forwards;
}

.animate-up {
  animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Sticky Header and Glassmorphic Navigation */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-normal);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-img {
  height: 50px;
  width: auto;
  border-radius: var(--radius-sm);
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary-color);
  line-height: 1;
  letter-spacing: -0.5px;
}

.logo-sub {
  font-size: 0.75rem;
  color: var(--secondary-color);
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 1.5rem;
  align-items: center;
}

.nav-link {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  color: var(--secondary-color);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background-color: var(--primary-color);
  transition: var(--transition-fast);
  transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 80%;
}

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

.nav-cta {
  background-color: var(--primary-color);
  color: var(--bg-white) !important;
  font-weight: 600;
  border-radius: var(--radius-md) !important;
  box-shadow: 0 4px 6px rgba(140, 17, 29, 0.2);
}

.nav-cta:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(140, 17, 29, 0.3);
}

/* Hero Section */
.hero {
  padding: 5rem 2rem;
  background: radial-gradient(circle at 10% 20%, rgba(26, 54, 93, 0.05) 0%, rgba(140, 17, 29, 0.02) 90%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.hero-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.hero-text h1 {
  font-size: 3rem;
  line-height: 1.15;
  margin-bottom: 1.5rem;
  letter-spacing: -1px;
}

.hero-text h1 span {
  color: var(--primary-color);
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-weight: 400;
}

.hero-buttons {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.btn {
  display: inline-block;
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-normal);
}

.btn-primary {
  background-color: var(--primary-color);
  color: var(--bg-white);
  box-shadow: 0 4px 10px rgba(140, 17, 29, 0.25);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-3px);
  box-shadow: 0 8px 16px rgba(140, 17, 29, 0.35);
  color: var(--bg-white);
}

.btn-secondary {
  background-color: var(--bg-white);
  color: var(--secondary-color);
  border: 1px solid rgba(26, 54, 93, 0.15);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background-color: var(--secondary-light);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.hero-image-wrapper {
  position: relative;
}

.hero-image {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 4px solid var(--bg-white);
  transition: var(--transition-normal);
}

.hero-image:hover {
  transform: scale(1.02);
}

.hero-badge {
  position: absolute;
  bottom: -20px;
  right: -20px;
  background: var(--bg-white);
  padding: 1.25rem 1.75rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  border-left: 5px solid var(--primary-color);
}

.badge-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--secondary-color);
  font-family: var(--font-heading);
}

.badge-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Quote Section */
.quote-section {
  background-color: var(--secondary-color);
  color: var(--bg-white);
  padding: 4rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.quote-container {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.quote-text {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 600;
  font-style: italic;
  line-height: 1.4;
  margin-bottom: 1.5rem;
}

.quote-author {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.7);
}

/* Core Content Sections */
section.main-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 5rem 2rem;
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-header h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  position: relative;
  display: inline-block;
  padding-bottom: 0.75rem;
}

.section-header h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 60px;
  height: 4px;
  background-color: var(--primary-color);
  border-radius: 2px;
  transform: translateX(-50%);
}

.section-header p {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 700px;
  margin: 0 auto;
}

/* Grids and Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2.5rem;
}

.card {
  background-color: var(--bg-white);
  border-radius: var(--radius-md);
  padding: 2.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0, 0, 0, 0.02);
  transition: var(--transition-normal);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(140, 17, 29, 0.1);
}

.card-icon {
  background-color: rgba(140, 17, 29, 0.08);
  color: var(--primary-color);
  width: 60px;
  height: 60px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
}

.card h3 {
  font-size: 1.35rem;
  margin-bottom: 1rem;
  color: var(--secondary-color);
}

.card p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  flex-grow: 1;
}

.card-link {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-link:hover {
  gap: 0.75rem;
}

.home-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

/* Diet and PDF Download Section */
.diet-section {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 4rem 3rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 5rem;
}

.diet-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1.5rem;
  margin-top: 3rem;
}

.diet-button {
  background-color: var(--bg-light);
  border: 1px solid rgba(140, 17, 29, 0.1);
  border-radius: var(--radius-md);
  padding: 1.5rem 1rem;
  text-align: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--primary-color) !important;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  transition: var(--transition-normal);
}

.diet-button::before {
  content: '📄';
  font-size: 2rem;
}

.diet-button:hover {
  background-color: var(--primary-color);
  color: var(--bg-white) !important;
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-hover);
}

/* Competenze Bio & Details Layout */
.bio-wrapper {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 4rem;
  margin-bottom: 4rem;
  align-items: start;
}

.bio-card {
  background-color: var(--bg-white);
  padding: 2rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  border-top: 5px solid var(--primary-color);
}

.bio-right {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.bio-card img {
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
}

.bio-profile-image {
  width: 100%;
  height: 360px;
  object-fit: cover;
  object-position: 58% 24%;
}

.bio-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  text-align: center;
}

.bio-card p.title,
.bio-text p.title {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: center;
  margin-bottom: 1.5rem;
  font-weight: 600;
}

.bio-info-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.bio-info-list li {
  font-size: 0.9rem;
}

.bio-text {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-dark);
}

.bio-text p {
  margin-bottom: 1.5rem;
  text-align: justify;
}

.bio-text strong {
  color: var(--secondary-color);
}

/* Modern Tables styling (Prestazioni & Tariffe) */
.table-container {
  background-color: var(--bg-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  margin-bottom: 4rem;
  border: 1px solid rgba(0, 0, 0, 0.03);
}

.table-header-block {
  background-color: var(--secondary-color);
  color: var(--bg-white);
  padding: 1.5rem 2rem;
}

.table-header-block h3 {
  color: var(--bg-white);
  font-size: 1.5rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th, td {
  padding: 1.25rem 2rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

th {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--secondary-color);
  background-color: #f1f5f9;
}

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

tr:nth-child(even) td {
  background-color: rgba(26, 54, 93, 0.015);
}

tr:hover td {
  background-color: rgba(140, 17, 29, 0.02);
}

.price {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--primary-color);
  font-size: 1.15rem;
}

/* Premium Contact styling */
.contact-section {
  max-width: 820px;
  background-color: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  margin: 4rem auto 0;
}

.contact-info-panel {
  background-color: var(--secondary-color);
  color: var(--bg-white);
  padding: 5rem 4rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.contact-info-panel h3 {
  color: var(--bg-white);
  font-size: 2.25rem;
  margin-bottom: 1.5rem;
}

.contact-info-panel p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.05rem;
  margin-bottom: 3rem;
}

.contact-detail-items {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.contact-detail-item {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}

.contact-detail-icon {
  background-color: rgba(255, 255, 255, 0.1);
  width: 50px;
  height: 50px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.contact-detail-text h4 {
  color: var(--bg-white);
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.contact-detail-text p {
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 0;
  font-size: 0.95rem;
}

/* Footer Section */
footer {
  background-color: var(--secondary-color);
  color: rgba(255, 255, 255, 0.8);
  padding: 4rem 2rem 2rem 2rem;
  border-top: 5px solid var(--primary-color);
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 4rem;
  margin-bottom: 3rem;
}

.footer-brand h3 {
  color: var(--bg-white);
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.footer-brand p {
  font-size: 0.95rem;
  max-width: 320px;
  line-height: 1.7;
}

.footer-links h4 {
  color: var(--bg-white);
  font-size: 1.1rem;
  margin-bottom: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.footer-links ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
}

.footer-links a:hover {
  color: var(--bg-white);
  padding-left: 4px;
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.footer-bottom p {
  margin-bottom: 0;
}

/* Hamburger Button */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.hamburger:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--secondary-color);
  border-radius: 2px;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
  transform-origin: center;
}

/* Hamburger → X animation */
.hamburger.is-active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger.is-active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.hamburger.is-active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
  .hero-container {
    gap: 2rem;
  }
  .hero-text h1 {
    font-size: 2.5rem;
  }
}

@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .nav-container {
    flex-direction: row;
    flex-wrap: wrap;
    padding: 0.75rem 1.25rem;
    position: relative;
  }

  #main-nav {
    width: 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    opacity: 0;
  }

  #main-nav.nav-open {
    max-height: 400px;
    opacity: 1;
  }

  nav ul {
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 0 1rem;
    align-items: stretch;
  }

  nav ul li {
    border-top: 1px solid rgba(0, 0, 0, 0.04);
  }

  .nav-link {
    display: block;
    padding: 0.85rem 0.75rem;
    font-size: 1rem;
    border-radius: 0;
  }

  .nav-link::after {
    display: none;
  }

  .nav-cta {
    margin: 0.75rem 0 0.25rem;
    border-radius: var(--radius-md) !important;
    text-align: center;
    padding: 0.85rem 1rem;
  }

  .hero-container {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 3rem;
  }
  
  .hero-buttons {
    justify-content: center;
  }
  
  .hero-badge {
    right: 10px;
    bottom: 10px;
    padding: 0.75rem 1rem;
  }
  
  .bio-wrapper {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .card-grid, .home-grid-2 {
    grid-template-columns: 1fr;
  }

  .home-grid-2-img {
    order: -1;
  }
  
  .contact-info-panel {
    padding: 3rem 2rem;
  }
  
  .footer-container {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  
  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

@media (max-width: 600px) {
  .hero {
    padding: 3rem 1rem;
  }

  .hero-text h1,
  .section-header h2 {
    font-size: 2rem;
    letter-spacing: 0;
  }

  .section-header h2 {
    display: block;
    max-width: 100%;
  }

  .hero-buttons {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  section.main-section {
    padding: 3rem 1rem;
  }

  .diet-grid {
    grid-template-columns: 1fr;
  }

  .card,
  .diet-section {
    padding: 2rem 1.25rem;
  }

  .table-header-block {
    padding: 1.25rem 1rem;
  }

  .table-header-block h3 {
    font-size: 1.25rem;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
    width: 100%;
  }

  thead {
    display: none;
  }

  tr {
    padding: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  }

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

  th,
  td {
    padding: 0;
    border-bottom: none;
  }

  td.price {
    margin-top: 0.5rem;
    text-align: left !important;
    font-size: 1.05rem;
  }

  .contact-info-panel {
    padding: 2.5rem 1.25rem;
  }

  .contact-info-panel h3 {
    font-size: 1.85rem;
  }
}