/* Dark Mode Improvements for alterBIT */

/* Dark mode styles for service cards */
[data-theme="dark"] .service-card,
[data-theme="dark"] section#servizi .container > div > div[style*="background: white"] {
    background: #1e293b !important;
    color: #f1f5f9 !important;
    border: 1px solid #334155 !important;
}

[data-theme="dark"] section#servizi .container > div > div h3,
[data-theme="dark"] section#servizi .container > div > div span {
    color: #f1f5f9 !important;
}

[data-theme="dark"] section#servizi .container > div > div p {
    color: #cbd5e1 !important;
}

[data-theme="dark"] section#servizi .container > div > div ul li {
    color: #cbd5e1 !important;
}

[data-theme="dark"] section#servizi .container > div > div a {
    color: #60a5fa !important;
}

/* Dark mode for partner cards */
[data-theme="dark"] section#partners .container > div > div[style*="background: white"] {
    background: #1e293b !important;
    color: #f1f5f9 !important;
    border: 1px solid #334155 !important;
}

[data-theme="dark"] section#partners .container > div > div h3 {
    color: #f1f5f9 !important;
}

[data-theme="dark"] section#partners .container > div > div p {
    color: #cbd5e1 !important;
}

[data-theme="dark"] section#partners .container > div > div span[style*="background: #f0f0f0"] {
    background: #334155 !important;
    color: #f1f5f9 !important;
}

[data-theme="dark"] section#partners .container > div > div a {
    color: #60a5fa !important;
}

/* Dark mode for service section background */
[data-theme="dark"] section#servizi {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.5), rgba(51, 65, 85, 0.5)) !important;
}

/* Dark mode for section titles */
[data-theme="dark"] .section-title,
[data-theme="dark"] section h2 {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .section-subtitle,
[data-theme="dark"] section p {
    color: #cbd5e1 !important;
}

/* Dark mode for hero section text */
[data-theme="dark"] .hero-microsoft h1 {
    color: white !important;
}

[data-theme="dark"] .hero-microsoft p {
    color: rgba(255, 255, 255, 0.95) !important;
}

/* Dark mode for partner section background */
[data-theme="dark"] section#partners > div[style*="background: linear-gradient"] {
    background: linear-gradient(rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.95)), url('images/office-handshake.webp') center/cover no-repeat fixed !important;
}

/* Dark mode for border-left accent in service cards */
[data-theme="dark"] section#servizi ul[style*="border-left: 3px solid #0078d4"] {
    border-left-color: #60a5fa !important;
}

/* Dark mode for CTA section */
[data-theme="dark"] section[style*="background: linear-gradient(135deg, #1a1a1a"] {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
}

/* Improve contrast for images in dark mode */
[data-theme="dark"] img[src*="Microsoft"],
[data-theme="dark"] img[src*="zucchetti"],
[data-theme="dark"] img[src*="Fluida"] {
    filter: brightness(1.1);
}

/* Secondary navigation in dark mode */
[data-theme="dark"] nav#secondary-nav {
    background: rgba(30, 41, 59, 0.95) !important;
    backdrop-filter: blur(10px);
}

[data-theme="dark"] nav#secondary-nav a {
    color: #cbd5e1 !important;
}

[data-theme="dark"] nav#secondary-nav a:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    color: white !important;
}

/* Container backgrounds in dark mode */
[data-theme="dark"] .container {
    color: #f1f5f9;
}

/* Fix text visibility in hero with gradient background */
[data-theme="dark"] .hero-microsoft div[style*="color: white"] h1,
[data-theme="dark"] .hero-microsoft div[style*="color: white"] p {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Better button contrast in dark mode */
[data-theme="dark"] a[style*="background: #0078d4"] {
    background: #3b82f6 !important;
}

[data-theme="dark"] a[style*="background: #0078d4"]:hover {
    background: #60a5fa !important;
}

[data-theme="dark"] a[style*="border: 2px solid #0078d4"] {
    border-color: #60a5fa !important;
    color: #60a5fa !important;
}

/* Dark mode with alterBIT brand colors */
[data-theme="dark"] a:not(.logo):not(.skip-link):hover {
    color: #E63946 !important;
}

[data-theme="dark"] .navbar nav ul li a:hover,
[data-theme="dark"] .navbar nav ul li a.active {
    color: #E63946 !important;
}

[data-theme="dark"] nav#secondary-nav a:hover {
    color: #E63946 !important;
}

[data-theme="dark"] nav#secondary-nav a.active {
    color: #C41E3A !important;
    border-bottom: 3px solid #C41E3A !important;
}

[data-theme="dark"] section#servizi .container > div > div:hover {
    border-left: 4px solid #E63946 !important;
    box-shadow: 0 8px 24px rgba(230, 57, 70, 0.2);
}

[data-theme="dark"] section#partners .container > div > div:hover {
    border-top: 4px solid #E63946 !important;
    box-shadow: 0 8px 24px rgba(230, 57, 70, 0.2);
}

[data-theme="dark"] .theme-toggle:hover {
    background: #C41E3A !important;
}

[data-theme="dark"] .footer a:hover {
    color: #E63946 !important;
}

[data-theme="dark"] section h2::after {
    background: linear-gradient(90deg, #C41E3A, #E63946) !important;
}

[data-theme="dark"] section#servizi .container > div > div span[style*="color: #0078d4"] {
    color: #E63946 !important;
}

[data-theme="dark"] section#servizi ul[style*="border-left: 3px solid #0078d4"] {
    border-left-color: #E63946 !important;
}

/* Dark mode for Mago4 ERP and BI version cards */
[data-theme="dark"] section#servizi .container > div > div > div[style*="background: #f8f9fa"] {
    background: #334155 !important;
    color: #f1f5f9 !important;
    border-left-color: #C41E3A !important;
}

[data-theme="dark"] section#servizi .container > div > div > div[style*="background: #f8f9fa"] div {
    color: #f1f5f9 !important;
}

[data-theme="dark"] section#servizi .container > div > div > div[style*="background: #f8f9fa"] div + div > div:last-child {
    color: #cbd5e1 !important;
}

/* Dark mode for Chi Siamo page - Storia section */
[data-theme="dark"] section#storia {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.3), rgba(51, 65, 85, 0.3)) !important;
}

[data-theme="dark"] section#storia h2 {
    color: #f1f5f9 !important;
}

[data-theme="dark"] section#storia .container > div > div[style*="background: white"] {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
}

[data-theme="dark"] section#storia .container > div > div p {
    color: #cbd5e1 !important;
}

[data-theme="dark"] section#storia .container > div > div strong {
    color: #f1f5f9 !important;
}

/* Dark mode for Team section */
[data-theme="dark"] section#team {
    background: #0f172a !important;
}

[data-theme="dark"] section#team h2 {
    color: #f1f5f9 !important;
}

[data-theme="dark"] section#team > div > div > p {
    color: #cbd5e1 !important;
}

/* Dark mode for team cards */
[data-theme="dark"] section#team .container > div > div[style*="background: white"] {
    background: #1e293b !important;
    color: #f1f5f9 !important;
    border: 1px solid #334155 !important;
}

[data-theme="dark"] section#team .container > div > div h3 {
    color: #E63946 !important;
}

[data-theme="dark"] section#team .container > div > div p {
    color: #cbd5e1 !important;
}

/* Dark mode for team photo borders */
[data-theme="dark"] section#team .container > div > div > div[style*="border: 3px solid #C41E3A"] {
    border-color: #E63946 !important;
}

/* Hover effect for team cards in dark mode */
[data-theme="dark"] section#team .container > div > div:hover {
    box-shadow: 0 8px 30px rgba(230, 57, 70, 0.25) !important;
}

/* Dark mode for logo box in hero section */
[data-theme="dark"] .hero-microsoft div[style*="background: white"] {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
}

/* Dark mode for Contatti page */
[data-theme="dark"] section#contatti {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.3), rgba(51, 65, 85, 0.3)) !important;
}

[data-theme="dark"] section#contatti .container > div > div > div[style*="background: white"] {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
}

[data-theme="dark"] section#contatti h3 {
    color: #f1f5f9 !important;
}

[data-theme="dark"] section#contatti p {
    color: #cbd5e1 !important;
}

[data-theme="dark"] section#contatti a[href^="mailto"],
[data-theme="dark"] section#contatti a[href^="tel"],
[data-theme="dark"] section#contatti a[href^="https"] {
    color: #E63946 !important;
}

[data-theme="dark"] section#contatti div[style*="background: #f8f9fa"] {
    background: #334155 !important;
    border-left-color: #E63946 !important;
}

[data-theme="dark"] section#contatti div[style*="background: #f8f9fa"] h4 {
    color: #f1f5f9 !important;
}

[data-theme="dark"] section#contatti div[style*="background: #f8f9fa"] strong {
    color: #f1f5f9 !important;
}

/* Dark mode for Office Location section - sede principale con mappa */
[data-theme="dark"] section#contatti > div > div > div[style*="background: white"][style*="padding: 3rem"] {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
}

[data-theme="dark"] section#contatti > div > div > div[style*="background: white"] h3 {
    color: #f1f5f9 !important;
}

[data-theme="dark"] section#contatti > div > div > div[style*="background: white"] h4 {
    color: #f1f5f9 !important;
}

[data-theme="dark"] section#contatti > div > div > div[style*="background: white"] p {
    color: #cbd5e1 !important;
}

[data-theme="dark"] section#contatti > div > div > div[style*="background: white"] strong {
    color: #f1f5f9 !important;
}

/* Dark mode for CTA Demo section */
[data-theme="dark"] section#demo {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.3), rgba(51, 65, 85, 0.3)) !important;
}

[data-theme="dark"] section#demo h2 {
    color: #f1f5f9 !important;
}

[data-theme="dark"] section#demo p {
    color: #cbd5e1 !important;
}

/* Dark mode for Supporto section */
[data-theme="dark"] section#supporto {
    background: #0f172a !important;
}

[data-theme="dark"] section#supporto h2,
[data-theme="dark"] section#supporto h3 {
    color: #f1f5f9 !important;
}

[data-theme="dark"] section#supporto > div > div > p {
    color: #cbd5e1 !important;
}

[data-theme="dark"] section#supporto .container > div:last-child > div[style*="background: white"] {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
}

/* Dark mode for Prodotti (Products) page */
[data-theme="dark"] section#prodotti-core,
[data-theme="dark"] section#erp-produzione,
[data-theme="dark"] section#hr-documentale,
[data-theme="dark"] section#strumenti {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.3), rgba(51, 65, 85, 0.3)) !important;
}

[data-theme="dark"] section#prodotti-core h2,
[data-theme="dark"] section#erp-produzione h2,
[data-theme="dark"] section#hr-documentale h2,
[data-theme="dark"] section#strumenti h2 {
    color: #f1f5f9 !important;
}

[data-theme="dark"] section#prodotti-core > div > p,
[data-theme="dark"] section#erp-produzione > div > p,
[data-theme="dark"] section#hr-documentale > div > p,
[data-theme="dark"] section#strumenti > div > p {
    color: #cbd5e1 !important;
}

/* Dark mode for product cards */
[data-theme="dark"] section#prodotti-core .container > div > div[style*="background: white"],
[data-theme="dark"] section#erp-produzione .container > div > div[style*="background: white"],
[data-theme="dark"] section#hr-documentale .container > div > div[style*="background: white"],
[data-theme="dark"] section#strumenti .container > div > div[style*="background: white"] {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
}

[data-theme="dark"] section#prodotti-core .container > div > div h3,
[data-theme="dark"] section#erp-produzione .container > div > div h3,
[data-theme="dark"] section#hr-documentale .container > div > div h3,
[data-theme="dark"] section#strumenti .container > div > div h3 {
    color: #f1f5f9 !important;
}

[data-theme="dark"] section#prodotti-core .container > div > div p,
[data-theme="dark"] section#erp-produzione .container > div > div p,
[data-theme="dark"] section#hr-documentale .container > div > div p,
[data-theme="dark"] section#strumenti .container > div > div p {
    color: #cbd5e1 !important;
}

/* Dark mode for product links */
[data-theme="dark"] section#prodotti-core .container > div > div a,
[data-theme="dark"] section#erp-produzione .container > div > div a,
[data-theme="dark"] section#hr-documentale .container > div > div a,
[data-theme="dark"] section#strumenti .container > div > div a {
    color: #E63946 !important;
}

/* Dark mode for category badges */
[data-theme="dark"] section#prodotti-core div[style*="background: #f0f0f0"],
[data-theme="dark"] section#erp-produzione div[style*="background: #f0f0f0"],
[data-theme="dark"] section#hr-documentale div[style*="background: #f0f0f0"],
[data-theme="dark"] section#strumenti div[style*="background: #f0f0f0"] {
    background: #334155 !important;
    color: #f1f5f9 !important;
}

/* Dark mode for feature badges */
[data-theme="dark"] section#prodotti-core span[style*="background: #e8f5e9"],
[data-theme="dark"] section#prodotti-core span[style*="background: #e3f2fd"],
[data-theme="dark"] section#prodotti-core span[style*="background: #f3e5f5"],
[data-theme="dark"] section#prodotti-core span[style*="background: #fff3e0"],
[data-theme="dark"] section#erp-produzione span[style*="background: #e8f5e9"],
[data-theme="dark"] section#erp-produzione span[style*="background: #e3f2fd"],
[data-theme="dark"] section#erp-produzione span[style*="background: #f3e5f5"],
[data-theme="dark"] section#hr-documentale span[style*="background: #e8f5e9"],
[data-theme="dark"] section#hr-documentale span[style*="background: #e3f2fd"],
[data-theme="dark"] section#hr-documentale span[style*="background: #f3e5f5"],
[data-theme="dark"] section#strumenti span[style*="background: #e8f5e9"],
[data-theme="dark"] section#strumenti span[style*="background: #e3f2fd"],
[data-theme="dark"] section#strumenti span[style*="background: #f3e5f5"] {
    filter: brightness(0.8);
}

/* Hover effects for product cards in dark mode */
[data-theme="dark"] section#prodotti-core .container > div > div:hover,
[data-theme="dark"] section#erp-produzione .container > div > div:hover,
[data-theme="dark"] section#hr-documentale .container > div > div:hover,
[data-theme="dark"] section#strumenti .container > div > div:hover {
    box-shadow: 0 8px 30px rgba(230, 57, 70, 0.25) !important;
}

/* Dark mode for Products CTA section */
[data-theme="dark"] section[style*="padding: 5rem 0"][style*="text-align: center"] {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.5), rgba(51, 65, 85, 0.5)) !important;
}

/* Dark mode for Mago4 Product Page */
[data-theme="dark"] section#funzionalita,
[data-theme="dark"] section#vantaggi {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.3), rgba(51, 65, 85, 0.3)) !important;
}

[data-theme="dark"] section#aree-operative,
[data-theme="dark"] section#versioni {
    background: #0f172a !important;
}

[data-theme="dark"] section#funzionalita h2,
[data-theme="dark"] section#aree-operative h2,
[data-theme="dark"] section#vantaggi h2,
[data-theme="dark"] section#versioni h2 {
    color: #f1f5f9 !important;
}

[data-theme="dark"] section#funzionalita > div > div > p,
[data-theme="dark"] section#aree-operative > div > div > p,
[data-theme="dark"] section#vantaggi > div > div > p,
[data-theme="dark"] section#versioni > div > div > p {
    color: #cbd5e1 !important;
}

/* Dark mode for feature cards */
[data-theme="dark"] section#funzionalita .container > div > div[style*="background: white"],
[data-theme="dark"] section#vantaggi .container > div > div[style*="background: white"],
[data-theme="dark"] section#versioni .container > div > div[style*="background: white"] {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
}

[data-theme="dark"] section#funzionalita .container > div > div h3,
[data-theme="dark"] section#vantaggi .container > div > div h3,
[data-theme="dark"] section#versioni .container > div > div h3 {
    color: #f1f5f9 !important;
}

[data-theme="dark"] section#funzionalita .container > div > div p,
[data-theme="dark"] section#vantaggi .container > div > div p,
[data-theme="dark"] section#versioni .container > div > div p,
[data-theme="dark"] section#funzionalita .container > div > div ul li,
[data-theme="dark"] section#versioni .container > div > div ul li {
    color: #cbd5e1 !important;
}

/* Dark mode for aree operative cards */
[data-theme="dark"] section#aree-operative > div > div > div h3 {
    color: #f1f5f9 !important;
}

[data-theme="dark"] section#aree-operative > div > div > div p {
    color: #cbd5e1 !important;
}

/* Dark mode for comparison note */
[data-theme="dark"] section#versioni div[style*="background: linear-gradient(135deg, rgba(0, 120, 212, 0.05)"] {
    background: #334155 !important;
    border-left-color: #60a5fa !important;
}

[data-theme="dark"] section#versioni div[style*="background: linear-gradient(135deg, rgba(0, 120, 212, 0.05)"] h4 {
    color: #f1f5f9 !important;
}

[data-theme="dark"] section#versioni div[style*="background: linear-gradient(135deg, rgba(0, 120, 212, 0.05)"] strong {
    color: #60a5fa !important;
}

[data-theme="dark"] section#versioni div[style*="background: linear-gradient(135deg, rgba(0, 120, 212, 0.05)"] p {
    color: #cbd5e1 !important;
}

/* Dark mode for version badges */
[data-theme="dark"] section#versioni div[style*="background: #f0f0f0"] {
    background: #334155 !important;
    color: #f1f5f9 !important;
}

/* Dark mode for xboard.AI Product Page */
[data-theme="dark"] section#ai-features {
    background: #0f172a !important;
}

[data-theme="dark"] section#hub-integration {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.3), rgba(51, 65, 85, 0.3)) !important;
}

[data-theme="dark"] section#plugin {
    background: #0f172a !important;
}

[data-theme="dark"] section#ai-features h2,
[data-theme="dark"] section#hub-integration h2,
[data-theme="dark"] section#plugin h2 {
    color: #f1f5f9 !important;
}

[data-theme="dark"] section#ai-features > div > div > p,
[data-theme="dark"] section#hub-integration > div > div > p,
[data-theme="dark"] section#plugin > div > div > p {
    color: #cbd5e1 !important;
}

/* Dark mode for xboard.AI feature cards */
[data-theme="dark"] section#ai-features > div > div > div h3,
[data-theme="dark"] section#ai-features > div > div > div p {
    color: #cbd5e1 !important;
}

/* Dark mode for Hub Integration cards */
[data-theme="dark"] section#hub-integration div[style*="background: white"] {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
}

[data-theme="dark"] section#hub-integration div[style*="background: white"] strong {
    color: #f1f5f9 !important;
}

[data-theme="dark"] section#hub-integration div[style*="background: white"] p {
    color: #94a3b8 !important;
}

/* Dark mode for Plugin cards */
[data-theme="dark"] section#plugin div[style*="background: linear-gradient"] {
    background: #1e293b !important;
    border-left-color: inherit !important;
}

[data-theme="dark"] section#plugin div[style*="background: linear-gradient"] h3 {
    color: #f1f5f9 !important;
}

[data-theme="dark"] section#plugin div[style*="background: linear-gradient"] p {
    color: #cbd5e1 !important;
}

/* Dark mode for Mago4 Moduli e Documentazione section */
[data-theme="dark"] section#moduli {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.3), rgba(51, 65, 85, 0.3)) !important;
}

[data-theme="dark"] section#moduli h2 {
    color: #f1f5f9 !important;
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

[data-theme="dark"] section#moduli > div > div > p {
    color: #cbd5e1 !important;
}

/* Dark mode for module cards */
[data-theme="dark"] section#moduli .container > div > div[style*="background: white"] {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
}

[data-theme="dark"] section#moduli .container > div > div h3 {
    color: #f1f5f9 !important;
}

/* Dark mode for module download links */
[data-theme="dark"] section#moduli .container > div > div ul li a {
    color: #60a5fa !important;
}

[data-theme="dark"] section#moduli .container > div > div ul li a:hover {
    background: rgba(96, 165, 250, 0.1) !important;
}

[data-theme="dark"] section#moduli .container > div > div ul li a span {
    color: #cbd5e1 !important;
}

/* Dark mode for PDF icons in module section */
[data-theme="dark"] section#moduli .container > div > div ul li a i.fa-file-pdf {
    color: #ef4444 !important;
}

/* Dark mode for download icons */
[data-theme="dark"] section#moduli .container > div > div ul li a i.fa-download {
    color: #94a3b8 !important;
}

/* Dark mode for Funzionalità section background with inline styles */
[data-theme="dark"] section#funzionalita[style*="background: linear-gradient"] {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.3), rgba(51, 65, 85, 0.3)) !important;
}

/* Dark mode for feature cards in Funzionalità section */
[data-theme="dark"] section#funzionalita .container > div > div > div[style*="background: white"] {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
}

[data-theme="dark"] section#funzionalita .container > div > div > div[style*="background: white"] h3 {
    color: #f1f5f9 !important;
}

[data-theme="dark"] section#funzionalita .container > div > div > div[style*="background: white"] p {
    color: #cbd5e1 !important;
}

[data-theme="dark"] section#funzionalita .container > div > div > div[style*="background: white"] a {
    color: #60a5fa !important;
}

/* Dark mode for icon backgrounds in feature cards */
[data-theme="dark"] section#funzionalita div[style*="background: #f0f8ff"],
[data-theme="dark"] section#funzionalita div[style*="background: #e6f7ff"],
[data-theme="dark"] section#funzionalita div[style*="background: #f9f0ff"],
[data-theme="dark"] section#funzionalita div[style*="background: #fff0f6"],
[data-theme="dark"] section#funzionalita div[style*="background: #e6fafe"],
[data-theme="dark"] section#funzionalita div[style*="background: #f3e5f5"] {
    background: rgba(96, 165, 250, 0.1) !important;
}

/* Dark mode for sidebar sticky card */
[data-theme="dark"] section#funzionalita > div > div > div[style*="background: linear-gradient(135deg, #1e293b"] {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%) !important;
}

[data-theme="dark"] section#funzionalita > div > div > div[style*="background: linear-gradient(135deg, #1e293b"] h2 {
    color: white !important;
}

[data-theme="dark"] section#funzionalita > div > div > div[style*="background: linear-gradient(135deg, #1e293b"] p {
    color: rgba(255, 255, 255, 0.9) !important;
}

[data-theme="dark"] section#funzionalita > div > div > div[style*="background: linear-gradient(135deg, #1e293b"] a {
    background: white !important;
    color: #1e293b !important;
}

/* Dark mode for Moduli section inline background */
[data-theme="dark"] section#moduli[style*="background: linear-gradient(135deg, #f8f9fa"] {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.3), rgba(51, 65, 85, 0.3)) !important;
}

/* Dark mode for Moduli section paragraph colors */
[data-theme="dark"] section#moduli p[style*="color: #666"] {
    color: #cbd5e1 !important;
}

/* Dark mode for border-bottom in module cards */
[data-theme="dark"] section#moduli div[style*="border-bottom: 3px solid"] {
    border-bottom-color: #475569 !important;
}

/* Dark mode for icon gradient backgrounds in module section */
[data-theme="dark"] section#moduli div[style*="background: linear-gradient(135deg, #0078d4"],
[data-theme="dark"] section#moduli div[style*="background: linear-gradient(135deg, #00a4ef"],
[data-theme="dark"] section#moduli div[style*="background: linear-gradient(135deg, #00b294"],
[data-theme="dark"] section#moduli div[style*="background: linear-gradient(135deg, #8661c5"],
[data-theme="dark"] section#moduli div[style*="background: linear-gradient(135deg, #ff8c00"] {
    background: linear-gradient(135deg, #334155 0%, #475569 100%) !important;
}

/* Dark mode for module section hover state on links */
[data-theme="dark"] section#moduli a[onmouseover*="#f0f8ff"] {
    transition: all 0.2s;
}

[data-theme="dark"] section#moduli a:hover[onmouseover*="#f0f8ff"] {
    background: rgba(96, 165, 250, 0.1) !important;
}

/* Dark mode for Hero section "Richiedi Demo" button */
[data-theme="dark"] .hero-microsoft a[style*="background: white"] {
    background: rgba(255, 255, 255, 0.15) !important;
    color: white !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
}

[data-theme="dark"] .hero-microsoft a[style*="background: white"]:hover {
    background: rgba(255, 255, 255, 0.25) !important;
}

/* Dark mode for secondary navigation */
[data-theme="dark"] nav#secondary-nav[style*="background: rgba(30, 58, 138"] {
    background: rgba(30, 41, 59, 0.95) !important;
}

/* ============================================================
   DARK MODE FOR PRODUCTS PAGE (/prodotti)
   ============================================================ */

/* Products page - Core products section */
[data-theme="dark"] section#prodotti-core[style*="background: white"] {
    background: #0f172a !important;
}

/* Products page - Product card backgrounds */
[data-theme="dark"] section#prodotti-core div[style*="background: white; padding: 2.5rem"] {
    background: #1e293b !important;
    border-color: #334155 !important;
}

/* Products page - Product titles */
[data-theme="dark"] section#prodotti-core h3[style*="color: #1a1a1a"] {
    color: #f1f5f9 !important;
}

/* Products page - Product descriptions */
[data-theme="dark"] section#prodotti-core p[style*="color: #666"] {
    color: #cbd5e1 !important;
}

/* Products page - Section headers */
[data-theme="dark"] section h2[style*="color: #1a1a1a"] {
    color: #f1f5f9 !important;
}

[data-theme="dark"] section p[style*="color: #666"] {
    color: #cbd5e1 !important;
}

/* ERP & Produzione section */
[data-theme="dark"] section#erp-produzione[style*="background: linear-gradient"] {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.3), rgba(51, 65, 85, 0.3)) !important;
}

[data-theme="dark"] section#erp-produzione div[style*="background: white; padding: 2.5rem"] {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
}

[data-theme="dark"] section#erp-produzione h3[style*="color: #1a1a1a"] {
    color: #f1f5f9 !important;
}

[data-theme="dark"] section#erp-produzione p[style*="color: #666"] {
    color: #cbd5e1 !important;
}

/* HR & Documentale section */
[data-theme="dark"] section#hr-documentale[style*="background: white"] {
    background: #0f172a !important;
}

[data-theme="dark"] section#hr-documentale div[style*="background: white; padding: 2.5rem"] {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
}

[data-theme="dark"] section#hr-documentale h3[style*="color: #1a1a1a"] {
    color: #f1f5f9 !important;
}

[data-theme="dark"] section#hr-documentale p[style*="color: #666"] {
    color: #cbd5e1 !important;
}

/* Strumenti section */
[data-theme="dark"] section#strumenti[style*="background: linear-gradient"] {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.3), rgba(51, 65, 85, 0.3)) !important;
}

[data-theme="dark"] section#strumenti div[style*="background: white; padding: 2rem"] {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
}

[data-theme="dark"] section#strumenti h3[style*="color: #1a1a1a"] {
    color: #f1f5f9 !important;
}

[data-theme="dark"] section#strumenti p[style*="color: #666"] {
    color: #cbd5e1 !important;
}

/* Product links in all sections */
[data-theme="dark"] section a[style*="color: #C41E3A"],
[data-theme="dark"] section a[style*="color: #0078d4"],
[data-theme="dark"] section a[style*="color: #6a1b9a"],
[data-theme="dark"] section a[style*="color: #00a4ef"],
[data-theme="dark"] section a[style*="color: #00bcf2"],
[data-theme="dark"] section a[style*="color: #10b981"],
[data-theme="dark"] section a[style*="color: #2e7d32"],
[data-theme="dark"] section a[style*="color: #f57c00"],
[data-theme="dark"] section a[style*="color: #d84315"],
[data-theme="dark"] section a[style*="color: #f97316"] {
    color: #60a5fa !important;
}

[data-theme="dark"] section a[style*="color: #C41E3A"]:hover,
[data-theme="dark"] section a[style*="color: #0078d4"]:hover,
[data-theme="dark"] section a[style*="color: #6a1b9a"]:hover,
[data-theme="dark"] section a[style*="color: #00a4ef"]:hover,
[data-theme="dark"] section a[style*="color: #00bcf2"]:hover,
[data-theme="dark"] section a[style*="color: #10b981"]:hover,
[data-theme="dark"] section a[style*="color: #2e7d32"]:hover,
[data-theme="dark"] section a[style*="color: #f57c00"]:hover,
[data-theme="dark"] section a[style*="color: #d84315"]:hover,
[data-theme="dark"] section a[style*="color: #f97316"]:hover {
    color: #3b82f6 !important;
}

/* Product badges - keep existing colors but slightly adjusted for dark mode */
[data-theme="dark"] section div[style*="background: #f0f0f0"] {
    background: #334155 !important;
    color: #cbd5e1 !important;
}

[data-theme="dark"] section div[style*="background: #e3f2fd"] {
    background: rgba(59, 130, 246, 0.2) !important;
    color: #93c5fd !important;
}

[data-theme="dark"] section div[style*="background: #f3e5f5"] {
    background: rgba(168, 85, 247, 0.2) !important;
    color: #c4b5fd !important;
}

/* CTA section is already dark, so minimal changes needed */
[data-theme="dark"] section[style*="background: linear-gradient(135deg, #1a1a1a"] p[style*="color: rgba(255,255,255,0.9)"] {
    color: #cbd5e1 !important;
}

/* Dark mode for accordion elements in production section */
[data-theme="dark"] section#erp-produzione div[style*="background: white; border-radius: 12px; box-shadow: 0 2px 12px"] {
    background: #1e293b !important;
    border-color: #334155 !important;
}

[data-theme="dark"] section#erp-produzione h4[style*="color: #1a1a1a"] {
    color: #f1f5f9 !important;
}

[data-theme="dark"] section#erp-produzione div[style*="border-top: 1px solid #f0f0f0"] {
    border-top-color: #334155 !important;
}

/* ============================================================
   DARK MODE FOR PRIVACY PAGE (/privacy)
   ============================================================ */

/* Privacy page - Statistics section background */
[data-theme="dark"] section[style*="background: linear-gradient(135deg, rgba(135, 206, 235, 0.2)"] {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.3), rgba(51, 65, 85, 0.3)) !important;
}

/* Privacy page - Statistics cards */
[data-theme="dark"] section[style*="background: linear-gradient(135deg, rgba(135, 206, 235, 0.2)"] > div > div > div[style*="background: white"] {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
}

[data-theme="dark"] section[style*="background: linear-gradient(135deg, rgba(135, 206, 235, 0.2)"] h3[style*="color: #1a1a1a"] {
    color: #f1f5f9 !important;
}

[data-theme="dark"] section[style*="background: linear-gradient(135deg, rgba(135, 206, 235, 0.2)"] p[style*="color: #666"] {
    color: #cbd5e1 !important;
}

/* Privacy page - Main content section */
[data-theme="dark"] main#privacy-content {
    background: #0f172a !important;
}

[data-theme="dark"] main#privacy-content h2[style*="color: #1a1a1a"] {
    color: #f1f5f9 !important;
}

[data-theme="dark"] main#privacy-content p[style*="color: #666"] {
    color: #cbd5e1 !important;
}

/* Privacy page - White content box */
[data-theme="dark"] main#privacy-content div[style*="background: white; padding: 3rem"] {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
}

/* Privacy page - Section headings with border-bottom */
[data-theme="dark"] main#privacy-content section h2[style*="border-bottom: 3px solid #0078d4"] {
    color: #f1f5f9 !important;
    border-bottom-color: #60a5fa !important;
}

/* Privacy page - Paragraph text */
[data-theme="dark"] main#privacy-content section p[style*="color: #444"] {
    color: #cbd5e1 !important;
}

/* Privacy page - Links */
[data-theme="dark"] main#privacy-content a[style*="color: #0078d4"] {
    color: #60a5fa !important;
}

/* Privacy page - List items */
[data-theme="dark"] main#privacy-content ul[style*="color: #444"] {
    color: #cbd5e1 !important;
}

[data-theme="dark"] main#privacy-content ul li[style*="color: #444"] {
    color: #cbd5e1 !important;
}

/* Privacy page - Hero section buttons */
[data-theme="dark"] section[style*="padding: 4rem 0 5rem 0"] a[style*="background: white; color: #0078d4"] {
    background: rgba(255, 255, 255, 0.15) !important;
    color: white !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
}

[data-theme="dark"] section[style*="padding: 4rem 0 5rem 0"] a[style*="background: transparent; color: white"] {
    border-color: rgba(255, 255, 255, 0.6) !important;
}

/* ============================================================
   DARK MODE FOR ACCESSIBILITY PAGE (/accessibilita)
   ============================================================ */

/* Accessibility page - Statistics section */
[data-theme="dark"] section[id*="accessibility"] ~ section[style*="background: linear-gradient(135deg, rgba(135, 206, 235, 0.2)"] {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.3), rgba(51, 65, 85, 0.3)) !important;
}

/* Accessibility page - Main content */
[data-theme="dark"] main#accessibility-content {
    background: #0f172a !important;
}

[data-theme="dark"] main#accessibility-content h2[style*="color: #1a1a1a"] {
    color: #f1f5f9 !important;
}

[data-theme="dark"] main#accessibility-content h3[style*="color: #1a1a1a"] {
    color: #f1f5f9 !important;
}

[data-theme="dark"] main#accessibility-content p[style*="color: #666"] {
    color: #cbd5e1 !important;
}

/* Accessibility page - White content box */
[data-theme="dark"] main#accessibility-content div[style*="background: white; padding: 3rem"] {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
}

/* Accessibility page - Section headings with border-bottom */
[data-theme="dark"] main#accessibility-content section h2[style*="border-bottom: 3px solid #0078d4"] {
    color: #f1f5f9 !important;
    border-bottom-color: #60a5fa !important;
}

[data-theme="dark"] main#accessibility-content section h3[style*="color: #1a1a1a"] {
    color: #f1f5f9 !important;
}

/* Accessibility page - Paragraph text */
[data-theme="dark"] main#accessibility-content section p[style*="color: #444"] {
    color: #cbd5e1 !important;
}

/* Accessibility page - Links */
[data-theme="dark"] main#accessibility-content a[style*="color: #0078d4"] {
    color: #60a5fa !important;
}

/* Accessibility page - List items */
[data-theme="dark"] main#accessibility-content ul[style*="color: #444"] {
    color: #cbd5e1 !important;
}

[data-theme="dark"] main#accessibility-content ul li[style*="color: #444"] {
    color: #cbd5e1 !important;
}

/* Accessibility page - Info boxes with blue background */
[data-theme="dark"] main#accessibility-content div[style*="background: rgba(0, 120, 212, 0.05)"] {
    background: rgba(96, 165, 250, 0.1) !important;
    border-left-color: #60a5fa !important;
}

[data-theme="dark"] main#accessibility-content div[style*="background: rgba(0, 120, 212, 0.05)"] p[style*="color: #444"] {
    color: #cbd5e1 !important;
}

[data-theme="dark"] main#accessibility-content div[style*="background: rgba(0, 120, 212, 0.05)"] strong {
    color: #f1f5f9 !important;
}

/* Accessibility page - Icon colors */
[data-theme="dark"] main#accessibility-content i[style*="color: #0078d4"] {
    color: #60a5fa !important;
}

/* Green checkmark icons should stay green */
[data-theme="dark"] main#accessibility-content i[style*="color: #10b981"] {
    color: #34d399 !important;
}

/* CTA Section for both pages */
[data-theme="dark"] section[style*="background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%)"] {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
}

[data-theme="dark"] section[style*="background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%)"] h2[style*="color: white"] {
    color: #f1f5f9 !important;
}

[data-theme="dark"] section[style*="background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%)"] p[style*="color: rgba(255,255,255,0.9)"] {
    color: #cbd5e1 !important;
}

[data-theme="dark"] section[style*="background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%)"] a[style*="background: #0078d4"] {
    background: #3b82f6 !important;
}

[data-theme="dark"] section[style*="background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%)"] a[style*="background: transparent"] {
    border-color: #cbd5e1 !important;
}

/* ============================================================
   DARK MODE FOR FOOTER
   ============================================================ */

/* Footer already has good dark colors, but ensure links have proper hover effects */
[data-theme="dark"] .footer a {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .footer a:hover {
    color: #22d3ee !important;
}

[data-theme="dark"] .footer h3,
[data-theme="dark"] .footer h4 {
    color: #f1f5f9 !important;
}

/* Footer gradient in dark mode - slightly darker */
[data-theme="dark"] .footer {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
}
