/* ==========================================================
   RESPONSIVE GLOBAL PATCH - V-Manager Series
   Sovrascrive/aggiusta stili per mobile / tablet
   ========================================================== */

/* Fix generali */
* { box-sizing: border-box; }
html, body { overflow-x: hidden; max-width: 100%; }
img, video { max-width: 100%; height: auto; }
table { width: 100%; }

/* Container fluido anche su desktop */
.main-content, .container-fluid { max-width: 100%; }

/* --- TABLET E SOTTO (<= 992px) --- */
@media (max-width: 992px) {
    /* Sidebar slide-in già gestita da sidebar.php */
    .main-content {
        margin-left: 0 !important;
        padding: 70px 14px 30px !important;
    }
    /* Tabelle scroll orizzontale */
    .table-responsive { -webkit-overflow-scrolling: touch; }
    table { font-size: 0.82rem; }
    table th, table td { padding: 8px 6px; white-space: nowrap; }
    /* Card grid diventano stacked */
    .row > [class*="col-md-"]:not(.col-md-12) { margin-bottom: 12px; }
    /* Btn più grandi per touch */
    .btn { padding: 10px 16px; min-height: 40px; }
    /* Navbar padding */
    .landing-nav .container, .public-nav .container { padding: 0 14px; }
    /* Form controls più touch-friendly */
    input, select, textarea, .form-control, .form-select { font-size: 16px !important; min-height: 42px; }
    textarea { min-height: 80px !important; }
}

/* --- MOBILE (<= 768px) --- */
@media (max-width: 768px) {
    h1 { font-size: clamp(1.8rem, 6vw, 2.4rem) !important; }
    h2 { font-size: clamp(1.5rem, 5vw, 2rem) !important; }
    h3 { font-size: clamp(1.15rem, 4vw, 1.5rem) !important; }
    .section-title { font-size: clamp(1.7rem, 5vw, 2.2rem) !important; }

    /* Dashboard stats rows */
    .stat-item { padding: 10px 4px !important; }
    .stat-number { font-size: clamp(1.8rem, 6vw, 2.5rem) !important; }
    .stat-label { font-size: 0.65rem !important; letter-spacing: 1px !important; }

    /* Bottoni CTA stacked */
    .hero-cta, .d-flex.gap-3.flex-wrap { flex-direction: column !important; width: 100%; }
    .hero-cta .btn-neon, .hero-cta .btn-outline-neon,
    .hero-cta a { width: 100%; text-align: center; justify-content: center; }

    /* Navbar: logo più piccolo e compatto */
    .landing-nav, .public-nav { padding: 10px 0 !important; }
    .site-brand, .site-brand-landing { font-size: 1rem !important; }
    .site-brand img { height: 26px !important; }

    /* Sections padding ridotto */
    section { padding: 50px 0 !important; }
    .hero { padding: 90px 16px 40px !important; min-height: auto !important; }
    .hero-mockup { padding: 12px !important; margin-top: 30px !important; }
    .mockup-row { padding: 8px 10px !important; font-size: 0.8rem !important; }

    /* Card grid */
    .feature-card, .testi-card, .step-item { padding: 20px 18px !important; }
    .feature-icon { width: 44px !important; height: 44px !important; font-size: 1.2rem !important; }
    .step-number { width: 38px !important; height: 38px !important; font-size: 1.1rem !important; }

    /* Contact form */
    .contact-form-wrap { padding: 22px 18px !important; }

    /* Dashboard card */
    .dashboard-card, .card-box, .section-card { padding: 18px 16px !important; }

    /* Container-fluid reduced padding */
    .container-fluid { padding-left: 14px; padding-right: 14px; }
    .page-wrap, .content-container { padding-left: 12px !important; padding-right: 12px !important; }

    /* Tabelle: font ancora più piccolo */
    table th, table td { font-size: 0.75rem; padding: 6px 4px; }
    .badge { font-size: 0.6rem !important; }

    /* Admin sidebar collapse mobile hamburger - header icons smaller */
    .sidebar-header .team-name-sidebar { font-size: 0.65rem !important; }
    .sidebar-header .team-logo-sidebar { width: 26px !important; height: 26px !important; }

    /* CTA final */
    .cta-final { padding: 40px 20px !important; }

    /* Save bar mobile */
    .save-bar { flex-direction: column !important; align-items: stretch !important; gap: 10px !important; }
    .save-bar .btn, .save-bar button, .save-bar a { width: 100% !important; text-align: center !important; }
    .save-bar .d-flex { flex-direction: column; width: 100%; gap: 8px !important; }

    /* Sponsor grid */
    .sponsor-footer-grid, .sponsor-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
    .sponsor-item { padding: 14px !important; min-height: 64px !important; }
    .sponsor-item img { max-height: 38px !important; }

    /* Admin lang tabs stacked */
    .lang-tabs, .lang-pills { gap: 6px; }
    .lang-tab, .lang-pill, .tab-item { font-size: 0.7rem !important; padding: 6px 10px !important; }
    .tab-item { padding: 8px 12px !important; font-size: 0.72rem !important; }

    /* Section-card admin */
    .section-card h5 { font-size: 0.78rem !important; }

    /* Testimonials auth */
    .testi-author { padding-top: 14px !important; }
    .testi-avatar, .testi-avatar-fallback { width: 40px !important; height: 40px !important; }

    /* Form contatti labels */
    .privacy-label { font-size: 0.78rem !important; }

    /* FAQ/Regolamento hero */
    .hero-faq, .reg-hero, .priv-hero { padding: 40px 20px !important; margin-bottom: 28px !important; }
    .faq-q, .reg-head { padding: 16px 18px !important; font-size: 0.88rem !important; }
    .reg-body .inner { font-size: 0.85rem !important; }
    .reg-toc ul { grid-template-columns: 1fr !important; }
    .priv-body { padding: 24px 20px !important; }

    /* Toc links mobile */
    .reg-toc { padding: 16px 18px !important; }
    .reg-toc a { font-size: 0.82rem !important; }
}

/* --- MOBILE PICCOLO (<= 480px) --- */
@media (max-width: 480px) {
    .hero h1, h1 { font-size: 1.6rem !important; }
    .hero-badge { font-size: 0.65rem !important; padding: 4px 10px !important; }
    .btn-neon, .btn-outline-neon { font-size: 0.75rem !important; padding: 10px 16px !important; }
    .hero-cta a { padding: 12px 20px !important; font-size: 0.8rem !important; }
    .landing-nav .site-brand { font-size: 0.9rem !important; }
    .footer-links a { font-size: 0.75rem !important; margin: 0 6px !important; }
    .landing-footer { padding: 30px 0 20px !important; }
    .sponsor-grid, .sponsor-footer-grid { grid-template-columns: 1fr 1fr !important; }
}

/* Accessibility touch targets */
@media (hover: none) and (pointer: coarse) {
    a, button, input[type="submit"], input[type="button"], .btn, .nav-link-custom, .nav-link-admin {
        min-height: 40px;
    }
}
