/* --- VARIABILI & COLORI --- */
:root {
  --bg-sky-start: #DCE9F5;
  --bg-sky-end: #F2DAE3;
  --text-dark: #2A3240;
  --accent-gold: #C5A065;
  --glass-surface: rgba(255, 255, 255, 0.40);
  --glass-border: rgba(255, 255, 255, 0.6);
}

* { margin: 0; padding: 0; box-sizing: border-box; scroll-behavior: smooth; }

body {
  font-family: 'Mulish', sans-serif;
  color: var(--text-dark);
  background: linear-gradient(135deg, var(--bg-sky-start) 0%, var(--bg-sky-end) 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

/* --- TIPOGRAFIA --- */
h1, h2, h3, .logo { font-family: 'Cormorant Garamond', serif; }

.logo {
  font-size: 1.75rem;
  text-decoration: none;
  text-transform: none !important;
  color: var(--text-dark);
  letter-spacing: -0.02em;
}

.logo:hover { color: #9b779d !important; }
.logo span { font-style: italic; color: #C5A065; }

.logoo img { height: 3.25rem; width: auto; }
.logoo img:hover { filter: invert(5%); }

/* --- LAYOUT & NAV --- */
.container { max-width: 1200px; margin: 0 auto; padding: 10px 20px; }

.navbar-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  transition: all 0.4s ease;
  background: transparent;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 30px 0;
  transition: padding 0.4s ease;
}

.navbar-container.scrolled {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
}

.navbar-container.scrolled nav { padding: 15px 0; }
nav ul { list-style: none; display: flex; gap: 40px; }
nav a { text-decoration: none; color: var(--text-dark); text-transform: uppercase; font-size: 0.9rem; letter-spacing: 1px; transition: 0.3s; }
nav a:hover { color: var(--accent-gold); }

/* --- HERO SECTION --- */
.hero {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  padding-top: 60px;
  overflow: hidden;
  background-color: var(--bg-dark);
}

.hero-bg-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
  opacity: 0.35;
  transform: scale(1.08);
  transform-origin: center center;
  will-change: transform;
}

#overlay-intro {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #0F172A;
  z-index: 99999;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.8s ease;
}

.content-intro { text-align: center; color: white; font-family: 'Cormorant Garamond', serif; }
.logo-intro { font-size: 4rem; margin-bottom: 20px; }
.logo-intro span { font-style: italic; color: #C5A065; }

#btn-entra {
  padding: 15px 40px;
  background: transparent;
  border: 1px solid #C5A065;
  color: #C5A065;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 20px;
}

#btn-entra:hover { background: #C5A065; color: white; }

.hero h1 {
  font-size: 5rem;
  line-height: 1;
  margin-bottom: 20px;
  background: linear-gradient(45deg, var(--text-dark), #6b7280);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p { font-size: 1.3rem; margin-bottom: 40px; font-style: italic; opacity: 0.8; }

/* --- COMPONENTI --- */
.btn-gold {
  padding: 15px 45px;
  background: var(--accent-gold);
  color: white;
  text-decoration: none;
  border-radius: 50px;
  font-weight: 600;
  box-shadow: 0 10px 20px rgba(197, 160, 101, 0.25);
  transition: transform 0.3s, box-shadow 0.3s;
  display: inline-block;
}
.btn-gold:hover { transform: translateY(-3px); box-shadow: 0 15px 30px rgba(197, 160, 101, 0.4); }

.glass-panel {
  background: var(--glass-surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.05);
}

/* --- SERVIZI --- */
.services { padding: 100px 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; margin-top: 50px; }
.card { padding: 40px; transition: transform 0.3s; }
.card:hover { transform: translateY(-10px); }
.card h3 { font-size: 2rem; margin-bottom: 15px; }
.icon-line { width: 40px; height: 2px; background: var(--accent-gold); margin-bottom: 20px; }

/* --- CONTATTI & FOOTER --- */
.contact-section { padding: 50px 0 100px 0; text-align: center; }
.contact-box { padding: 60px; max-width: 700px; margin: 0 auto; }
.contact-box h2 { font-size: 3rem; margin-bottom: 20px; }
.contact-box p { margin-bottom: 30px; font-size: 1.1rem; }

footer { text-align: center; padding: 40px; opacity: 0.5; font-size: 0.8rem; }
.footer-iubenda { margin-bottom: 10px; }

/* --- ANIMAZIONI --- */
.scroll-reveal { opacity: 0; transform: translateY(30px); transition: all 0.8s ease-out; }
.scroll-reveal.active { opacity: 1; transform: translateY(0); }
.fade-in { animation: fadeIn 1.5s ease-out forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* --- BURGER MENU & HEADER ACTIONS --- */
.burger-menu { display: none; cursor: pointer; flex-direction: column; gap: 5px; z-index: 2000; }
.burger-menu .bar { width: 25px; height: 3px; background-color: var(--text-dark); transition: all 0.3s ease; border-radius: 5px; }

.nav-actions { display: flex; align-items: center; gap: 30px; }
.header-audio-btn { background: transparent; border: none; cursor: pointer; padding: 5px; display: flex; align-items: center; justify-content: center; transition: transform 0.3s ease; }
.header-audio-btn:hover { transform: scale(1.1); }
.header-audio-btn img { height: 35px; width: auto; filter: drop-shadow(0 0 5px rgba(197, 160, 101, 0.5)); }

.scroll-lock { overflow: hidden; height: 100vh; }

/* --- TESTIMONIALS SECTION --- */
#testimonials { padding: 100px 0; text-align: center; }
.section-title { font-size: 3rem; margin-bottom: 60px; color: var(--text-dark); }
.testimonials-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 40px; text-align: left; }
.testimonial-card { padding: 30px; height: 100%; display: flex; flex-direction: column; justify-content: space-between; }
.testimonial-card .quote { font-family: 'Mulish', sans-serif; font-size: 1.1rem; line-height: 1.6; margin-bottom: 25px; font-style: italic; color: var(--text-dark); }
.testimonial-card h4 { font-family: 'Cormorant Garamond', serif; font-size: 1.5rem; color: var(--accent-gold); margin-bottom: 5px; font-weight: 600; }
.testimonial-card .role { font-family: 'Mulish', sans-serif; font-size: 0.9rem; opacity: 0.7; }
.testimonial-card a { color: rebeccapurple !important; text-decoration: none !important; }
.testimonial-card a:hover { opacity: 0.7 !important; }

/* --- SEZIONE PORTFOLIO SHOWCASE --- */
.portfolio-section { padding: 100px 24px; }
.portfolio-header { display: flex; flex-direction: column; justify-content: space-between; margin-bottom: 40px; }

@media (min-width: 768px) {
  .portfolio-header { flex-direction: row; align-items: flex-end; }
}

.section-tag { color: var(--accent-gold); font-size: 0.8rem; letter-spacing: 2px; font-weight: 600; margin-bottom: 8px; }
.portfolio-subtext { color: var(--text-dark); max-width: 100%; font-size: 0.95rem; margin-top: 16px; text-align: left; opacity: 0.8; }

.portfolio-filters { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 48px; }
.filter-btn {
  background: var(--glass-surface);
  border: 1px solid var(--glass-border);
  color: var(--text-dark);
  padding: 10px 22px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}
.filter-btn:hover, .filter-btn.active { background: var(--accent-gold); color: #fff; border-color: var(--accent-gold); }

.portfolio-grid { display: grid; grid-template-columns: 1fr; gap: 40px; transition: all 0.4s ease; }
@media (min-width: 992px) { .portfolio-grid { grid-template-columns: repeat(2, 1fr); } }
.portfolio-grid.grid-full { grid-template-columns: 1fr !important; }

.mockup-card { padding: 12px; border-radius: 20px; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; }
.browser-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.25);
  padding: 10px 16px;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 8px;
}

.browser-dots { display: flex; gap: 6px; }
.browser-dots .dot { width: 10px; height: 10px; border-radius: 50%; }
.dot.red { background-color: #ff5f56; }
.dot.yellow { background-color: #ffbd2e; }
.dot.green { background-color: #27c93f; }

.browser-url {
  color: var(--text-dark);
  font-family: monospace;
  font-size: 0.75rem;
  text-decoration: none;
  transition: color 0.2s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 50%;
  opacity: 0.8;
}
.browser-url:hover { color: var(--accent-gold); }

.btn-external { color: var(--text-dark); font-size: 0.75rem; font-weight: bold; text-decoration: none; letter-spacing: 1px; }
.btn-external:hover { text-decoration: underline; color: var(--accent-gold); }

.iframe-container { position: relative; height: 480px; width: 100%; border-bottom-left-radius: 12px; border-bottom-right-radius: 12px; overflow: hidden; background-color: #000; }
.iframe-container iframe { width: 100%; height: 100%; border: none; }

.project-info { margin-top: 16px; display: flex; justify-content: space-between; align-items: flex-start; }
.project-info h4 { font-size: 1.5rem; color: var(--text-dark); }
.project-info p { color: var(--text-dark); font-size: 0.85rem; opacity: 0.8; }

.badge-gold {
  background: rgba(197, 160, 101, 0.15);
  color: var(--accent-gold);
  border: 1px solid rgba(197, 160, 101, 0.4);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.badge-gold.pulse { animation: goldPulse 2s infinite; }
@keyframes goldPulse { 0% { box-shadow: 0 0 0 0 rgba(197, 160, 101, 0.4); } 70% { box-shadow: 0 0 0 10px rgba(197, 160, 101, 0); } 100% { box-shadow: 0 0 0 0 rgba(197, 160, 101, 0); } }

/* --- STILI BASE MOCKUP POWER BI & SQL (DESKTOP) --- */
.bi-mockup-body, .sql-mockup-body {
  background: rgba(15, 23, 42, 0.95);
  border-radius: 12px;
  padding: 20px;
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.bi-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.bi-header h5 { font-size: 1rem; font-weight: 600; color: #fff; }
.bi-tag { background: rgba(39, 201, 63, 0.2); color: #4ade80; font-size: 0.65rem; padding: 2px 8px; border-radius: 12px; font-weight: bold; }

.bi-kpi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.kpi-card { background: rgba(255, 255, 255, 0.05); padding: 12px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.05); }
.kpi-label { display: block; font-size: 0.7rem; color: #94a3b8; margin-bottom: 4px; }
.kpi-value { display: block; font-size: 1.1rem; font-weight: bold; color: #fff; }
.kpi-trend { font-size: 0.7rem; font-weight: 600; }
.kpi-trend.positive { color: #4ade80; }
.kpi-trend.negative { color: #f87171; }

.bi-chart-placeholder { display: flex; align-items: flex-end; justify-content: space-between; height: 120px; padding-top: 10px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.bar-group { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; width: 12%; }
.bar-group .bar { width: 100%; background: linear-gradient(180deg, var(--accent-gold) 0%, rgba(197, 160, 101, 0.2) 100%); border-radius: 4px 4px 0 0; }
.bar-group span { font-size: 0.65rem; color: #64748b; }

.code-block {
  background: #090d16;
  padding: 14px;
  border-radius: 8px;
  font-family: monospace;
  font-size: 0.75rem;
  line-height: 1.5;
  color: #e2e8f0;
  overflow-x: auto;
  margin-bottom: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.code-block .kwd { color: #f472b6; font-weight: bold; }
.code-block .str { color: #38bdf8; }

.sql-result-table { display: flex; flex-direction: column; gap: 4px; font-size: 0.75rem; }
.sql-row { display: grid; grid-template-columns: 1fr 2fr 1fr 1fr; padding: 8px 10px; background: rgba(255, 255, 255, 0.03); border-radius: 4px; align-items: center; }
.sql-row.header { background: rgba(255, 255, 255, 0.08); font-weight: bold; color: var(--accent-gold); }

/* --- INTEGRATION FLOW COMPONENTS --- */
.integration-flow-container {
  background: #111827;
  border-radius: 12px;
  padding: 24px 16px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 12px;
  width: 100%;
}

.node-box {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #fff;
  flex: 1;
  min-width: 0;
}

.core-node { border-color: var(--accent-gold); background: rgba(197, 160, 101, 0.12); }
.node-icon { font-size: 1.5rem; margin-bottom: 6px; }
.node-box span { font-weight: bold; font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.node-box small { font-size: 0.7rem; color: #9ca3af; margin-top: 4px; }
.flow-arrow { color: var(--accent-gold); font-size: 0.75rem; display: flex; flex-direction: column; align-items: center; gap: 2px; font-weight: bold; text-align: center; }
.flow-arrow .arrow-symbol { font-size: 1.1rem; line-height: 1; }

/* ==========================================================================
   MEDIA QUERIES & MOBILE FIXES (< 768px)
   ========================================================================== */
@media screen and (min-width: 769px) and (max-width: 1024px) {
  .navbar-container.scrolled nav, nav { padding: 15px 50px !important; }
  .testimonials-grid { gap: 20px; padding: 0px 25px; }
}

@media screen and (max-width: 768px) {
  #overlay-intro, .navbar-container { width: 100% !important; max-width: 100% !important; }
  
  .navbar-container.scrolled nav { padding: 20px 20px; }
  .burger-menu { display: flex; }
  
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    height: 100vh;
    width: 100%;
    background: rgba(255, 255, 255, 1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: right 0.5s ease;
    z-index: 1500;
    gap: 40px;
  }
  .nav-links.nav-active { right: 0; }
  .nav-links li a { font-size: 1.5rem; font-family: 'Cormorant Garamond', serif; }

  .toggle .bar:nth-child(1) { transform: rotate(-45deg) translate(-5px, 6px); }
  .toggle .bar:nth-child(2) { opacity: 0; }
  .toggle .bar:nth-child(3) { transform: rotate(45deg) translate(-5px, -6px); }

  .nav-actions { gap: 20px; }
  .header-audio-btn img { height: 30px; }
  .hero h1 { font-size: 4rem; }
  .testimonials-grid { gap: 40px; padding: 0px 20px; }

  /* Grid & Portfolio Item Fixes */
  .portfolio-item, .mockup-card, .glass-panel {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .project-info { flex-direction: column; align-items: flex-start; gap: 12px; margin-top: 14px; width: 100%; }
  .project-info h4 { font-size: 1.25rem; line-height: 1.3; margin-bottom: 4px; }
  .project-info p { font-size: 0.88rem; line-height: 1.4; opacity: 0.85; }
  .project-info .badge-gold { align-self: flex-start; font-size: 0.65rem; padding: 5px 12px; }

  .browser-header { flex-wrap: wrap; gap: 6px; padding: 8px 10px; }
  .browser-url { font-size: 0.65rem; max-width: 120px; }

  /* Power BI Mobile */
  .bi-mockup-body, .sql-mockup-body { padding: 12px !important; }
  .bi-kpi-grid { grid-template-columns: 1fr !important; gap: 8px !important; }
  .kpi-card { display: flex !important; justify-content: space-between !important; align-items: center !important; padding: 8px 12px !important; }
  .kpi-label { margin-bottom: 0 !important; }
  .kpi-value { font-size: 0.95rem !important; }
  .bi-chart-placeholder { height: 90px !important; }

  /* SQL Mobile */
  .code-block { font-size: 0.68rem !important; white-space: pre-wrap !important; word-break: break-word !important; padding: 10px !important; }
  .sql-mockup-body { overflow-x: auto !important; }
  .sql-result-table { min-width: 280px !important; }
  .sql-row { grid-template-columns: 0.8fr 1.8fr 0.8fr 1fr !important; padding: 6px 8px !important; font-size: 0.68rem !important; }

  /* Integration Flow Mobile */
  .integration-flow-container { flex-direction: column; align-items: stretch; gap: 8px; padding: 16px; }
  .node-box { width: 100%; flex-direction: row; justify-content: flex-start; text-align: left; padding: 12px 16px; gap: 14px; }
  .node-icon { margin-bottom: 0; font-size: 1.6rem; }
  .node-box-content { display: flex; flex-direction: column; }
  .node-box span { font-size: 0.9rem; white-space: normal; }
  .flow-arrow { flex-direction: row; justify-content: center; padding: 4px 0; gap: 6px; }
  .flow-arrow .arrow-symbol { transform: rotate(90deg); }
}

/* --- FOOTER WHATSAPP BUTTON --- */

.whatsapp-float {
  position: fixed;
  bottom: 80px; /* Posizionato a 80px dal fondo per stare sopra Iubenda */
  right: 10px;  /* Allineato a destra */
  width: 55px;
  height: 55px;
  background-color: #25d366;
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  z-index: 9999; /* Sta sopra tutti gli elementi */
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  text-decoration: none;
}

.whatsapp-float svg {
  fill: #ffffff;
  width: 28px;
  height: 28px;
}

/* Effetto Hover */
.whatsapp-float:hover {
  background-color: #20ba5a;
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

/* Regolazione per Mobile */
@media screen and (max-width: 768px) {
  .whatsapp-float {
    bottom: 75px; /* Ajusta se il banner/badge Iubenda su mobile ha un'altezza diversa */
    right: 10px;
    width: 50px;
    height: 50px;
  }
  
  .whatsapp-float svg {
    width: 25px;
    height: 25px;
  }
}