/* Palette and Variables */
:root {
    --bg-main: #1A1D23; /* Very Dark Grey */
    --bg-darker: #121212; /* Soft Black for specific sections */
    --bg-card: #2C2F36;   /* Dark Grey for cards and elements */
    --text-primary: #F0F0F0; /* Off-White */
    --text-secondary: #A0A0A0; /* Light Grey */
    --text-secondary-lighter: #CCCCCC; /* Even Lighter Grey for better contrast on dark backgrounds */
    --text-signature: #E0E0E0; /* Specific very light grey for signatures on dark cards, even lighter */
    --accent-primary: #00D1FF; /* Bright Cyan */
    --accent-secondary: #9370DB; /* Medium Purple (optional) */
    --accent-success: #76FF03; /* Green for other agents or tags */
    --border-color: #444953; /* Color for thin borders */
}

/* Global Styles */
body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Open Sans', sans-serif;
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    color: var(--text-primary);
    font-weight: 700; /* Default bold for headings */
}

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

a:hover {
    color: #40eaff; /* Lighter cyan on hover */
    text-decoration: underline;
}

.link-custom {
    color: var(--accent-primary);
    font-weight: bold;
}
.link-custom:hover {
    color: #40eaff;
}

.small-text {
    font-size: 0.9rem;
    color: var(--text-secondary); /* Original for most small text */
}

/* Make .text-muted (Bootstrap class) more legible on our custom dark backgrounds */
.bg-dark-custom .text-muted,
.bg-darker-custom .text-muted,
.bg-card-custom .text-muted,
.footer-custom .text-muted { /* Added footer for consistency */
    color: var(--text-secondary-lighter) !important; /* Use a lighter grey, override Bootstrap if needed */
}

.text-accent {
    color: var(--accent-primary) !important;
}
.text-secondary-custom { 
    color: var(--text-secondary);
}


/* Header / Navbar */
.bg-dark-custom {
    background-color: #171a1f !important; 
    border-bottom: 1px solid var(--border-color);
}
.navbar-brand {
    color: var(--accent-primary) !important;
    font-size: 1.8rem;
    font-weight: 900; 
}
.nav-link {
    color: var(--text-primary) !important;
    margin-left: 10px;
    margin-right: 10px;
    transition: color 0.3s ease;
    font-weight: 600; 
}
.nav-link:hover, .nav-link.active {
    color: var(--accent-primary) !important;
}
.dropdown-menu-dark {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
}
.dropdown-item {
    color: var(--text-primary);
    font-weight: 600;
}
.dropdown-item:hover {
    background-color: #3a3f48;
    color: var(--accent-primary);
}
.lang-switcher-container { 
    /* No specific styles needed if nav-link classes suffice */
}
.lang-selector {
    font-size: 0.85rem; 
    font-weight: 600;
    padding: 0.25rem 0.35rem !important; 
    color: var(--text-secondary) !important;
}
.lang-selector.active-lang {
    color: var(--accent-primary) !important;
    text-decoration: none; 
    border-bottom: 2px solid var(--accent-primary); 
}
.lang-selector:hover {
    color: var(--text-primary) !important;
    text-decoration: none;
}
.navbar-nav .nav-link.disabled.lang-separator { 
    color: var(--border-color) !important;
}


/* Hero Section */
.hero-section {
    background-color: var(--bg-main);
    padding-top: 5rem;
    padding-bottom: 5rem;
}
.hero-section h1 {
    font-size: 2.8rem;
    font-weight: 900;
    text-shadow: 0 0 10px rgba(0, 209, 255, 0.3);
}
.hero-section .lead {
    color: var(--text-secondary);
    font-size: 1.2rem;
    max-width: 750px;
    margin-left: auto;
    margin-right: auto;
}
.btn-primary-custom {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #121212; 
    font-weight: bold;
    padding: 0.75rem 1.5rem;
    transition: background-color 0.3s ease, transform 0.2s ease;
}
.btn-primary-custom:hover {
    background-color: #00b8e6;
    border-color: #00b8e6;
    color: #121212;
    transform: translateY(-2px);
}
.btn-secondary-custom { 
    background-color: var(--bg-card); 
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    font-weight: bold;
    padding: 0.75rem 1.5rem;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease, border-color 0.3s ease;
}
.btn-secondary-custom:hover {
    background-color: #3a3f48;
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: translateY(-2px);
}
.btn-outline-primary-custom { 
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    font-weight: bold;
    padding: 0.75rem 1.5rem;
     transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
}
.btn-outline-primary-custom:hover {
    background-color: var(--accent-primary);
    color: #121212; 
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}


/* Assaggio ChatPNT Live Section */
.bg-darker-custom {
    background-color: var(--bg-darker);
}
.chat-assaggio-container {
    background-color: var(--bg-card);
    border-radius: 8px;
    padding: 20px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 15px rgba(0, 209, 255, 0.1);
}
.chat-assaggio-messages {
    height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 10px;
    background-color: #22252a; 
}
.message {
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 15px;
    max-width: 80%;
    word-wrap: break-word;
}
.message p {
    margin-bottom: 0;
    font-size: 0.95rem;
}
.user-message {
    background-color: var(--accent-primary);
    color: var(--bg-main); 
    margin-left: auto;
    border-bottom-right-radius: 3px;
    text-align: right;
}
.ai-message {
    background-color: #3b4049; 
    color: var(--text-primary);
    margin-right: auto;
    border-bottom-left-radius: 3px;
}
.form-control-dark-custom {
    background-color: #22252a;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}
.form-control-dark-custom::placeholder {
    color: var(--text-secondary);
}
.form-control-dark-custom:focus {
    background-color: #22252a;
    color: var(--text-primary);
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 0.25rem rgba(0, 209, 255, 0.25);
}


/* Innovazioni Section */
.innovazioni-section {
    background-color: var(--bg-main);
}
.bg-card-custom { 
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.bg-card-custom:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 209, 255, 0.15);
}
.card-title {
    color: var(--text-primary);
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}
.card-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Page Hero Section (per showcase, pagine prodotto, etc.) */
.page-hero-section { 
    background-color: var(--bg-main);
    padding: 3rem 0;
}
.page-hero-section h1 {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--text-primary); /* Ensures correct color */
}
.page-hero-section .lead { 
    color: var(--text-secondary);
    font-size: 1.15rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* Showcase Agents Section */
.showcase-agents-section {
    /* bg-darker-custom already applied in HTML */
}
.showcase-category .category-title {
    font-weight: 900;
    font-size: 1.8rem;
    position: relative;
    display: inline-block;
    padding-bottom: 0.5rem;
    color: var(--text-primary);
}
.showcase-category .category-title span {
    position: relative;
    z-index: 1;
}
.showcase-category .category-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--accent-primary);
    border-radius: 2px;
}

.agent-showcase-card .card-body {
    padding: 1.5rem;
}
.agent-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-left: auto;
    margin-right: auto;
    border: 3px solid var(--border-color);
}
.agent-showcase-card .tags .badge {
    font-size: 0.75rem;
    margin: 0.15rem;
    font-weight: 600; 
}
.bg-accent-tag {
    background-color: var(--accent-primary) !important; 
    color: var(--bg-main) !important;
}
.bg-secondary-tag {
    background-color: var(--accent-secondary) !important;
    color: var(--text-primary) !important;
}
.bg-success-tag { 
    background-color: var(--accent-success) !important;
    color: var(--bg-main) !important;
}


/* Features Detailed Section (used in chatpnt.html and filosofia.html) */
.features-detailed-section {
    /* bg-darker-custom already applied in HTML if needed */
}
.feature-card { 
    background-color: var(--bg-card);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center; 
    text-align: center; 
}
.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 209, 255, 0.15);
}
.feature-icon {
    font-size: 2.5rem; 
    color: var(--accent-primary);
    margin-bottom: 1rem;
}
.feature-card h4 { 
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
    color: var(--text-primary); 
}
.feature-card p { 
    font-size: 0.9rem;
    color: var(--text-secondary);
    flex-grow: 1; 
}

/* Visual Action Section (placeholder video/screenshot in chatpnt.html) */
.visual-action-section .lead {
    color: var(--text-secondary);
}


/* DevPNT Problem/Solution & Story Section */
.devpnt-problem-solution p, .devpnt-solution p, 
.devpnt-story-section p:not(.text-primary):not(.text-muted) { /* Added :not(.text-muted) */
    font-size: 1.05rem; 
    line-height: 1.7; 
    color: var(--text-secondary-lighter); /* Using the lighter grey for these paragraphs */
}
.devpnt-problem-solution h2, .devpnt-solution h2, .devpnt-story-section h2 { 
    color: var(--text-primary); 
}
.devpnt-story-section .lead.text-primary { 
    color: var(--text-primary) !important; 
}
.devpnt-story-section .card { 
    background-color: var(--bg-card) !important; 
}
/* Paragraphs within DevPNT testimonial card */
.devpnt-story-section .card p:not(.text-primary):not(.text-muted) {
    color: var(--text-secondary-lighter); /* Using lighter grey here as well */
}
.devpnt-story-section .card p.text-primary { 
    color: var(--text-primary) !important;
}
/* The .devpnt-story-section .card small.text-muted is handled by the general .bg-card-custom .text-muted rule,
   but we can make it more specific if needed for even better contrast using --text-signature */
.devpnt-story-section .card small.text-muted {
    color: var(--text-signature) !important; /* Explicitly use signature color for this specific case */
    font-size: 0.87rem; /* Slightly increase size if it was too small */
}


.devpnt-features-list { 
    padding-left: 0;
    list-style: none;
}
.devpnt-features-list li { 
    margin-bottom: 0.75rem; 
    font-size: 1.05rem;
    display: flex; 
    align-items: flex-start;
    color: var(--text-primary); 
}
.devpnt-features-list li strong {
    color: var(--text-primary); 
}
.devpnt-features-list i {
    margin-top: 0.2rem; 
    margin-right: 0.5rem; 
}

/* DevPNT Case Study Section (Separated for clarity) */
.devpnt-case-study .card { 
    /* .bg-card-custom is already applied via HTML */
}
.devpnt-case-study .card-body { 
    text-align: left; 
    color: var(--text-primary); 
}
.devpnt-case-study .card-body p, 
.devpnt-case-study .card-body ul li {
    color: var(--text-secondary-lighter); /* Using lighter grey here too */
}
.devpnt-case-study .card-body p strong {
    color: var(--text-primary); 
}
.card-title-case-study { 
    color: var(--text-primary) !important;
    font-weight: 700;
    margin-bottom: 1rem;
}
.case-study-visual { 
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background-color: #22252a; 
    border-radius: 6px;
    min-height: 150px; 
}
.case-study-icon {
    font-size: 3.5rem !important; 
}
.case-study-visual .summary-line { 
    font-family: 'Courier New', Courier, monospace; 
    font-size: 0.9rem;
    color: var(--text-secondary);
    background-color: var(--bg-darker);
    padding: 0.35rem 0.6rem; 
    border-radius: 4px;
    margin-top: 1rem; 
    display: inline-block;
    word-break: break-all; 
}
.case-study-visual .summary-line span { 
     color: var(--accent-success); 
}


/* About PNTSoft Section (now Philosophy Section) */
.about-pntsoft-section h2 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    font-weight: 900; 
}
.about-pntsoft-section p:not(.text-muted) { /* Apply to paragraphs not already muted */
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-secondary-lighter); /* Using lighter grey */
}
.about-pntsoft-section .lead.text-primary { 
    color: var(--text-primary) !important;
    font-weight: 600;
    font-size: 1.3rem;
}
.border-bottom-custom { 
    border-bottom: 1px solid var(--border-color) !important; 
}
.about-pntsoft-section .display-1 { 
    font-size: 4rem; 
}
.about-pntsoft-section .text-center .display-6 { 
    font-weight: 900;
}
/* The signature in filosofia.html is specifically targeted if it has text-muted */
.about-pntsoft-section .text-center p.text-muted.small-text {
    color: var(--text-signature) !important; /* Use specific signature color */
}
.about-pntsoft-section .feature-card { 
    align-items: center;
    text-align: center;
}


/* Contact Form Section */
.contact-form-section .form-label {
    color: var(--text-secondary);
    font-weight: 600;
}
.alert-success-custom { 
    color: #0f5132; 
    background-color: #d1e7dd; 
    border-color: #badbcc; 
    padding: 0.75rem 1rem; 
    margin-top: 1rem; 
    border-radius: .25rem; 
}
.alert-danger-custom { 
    color: #842029; 
    background-color: #f8d7da; 
    border-color: #f5c2c7; 
    padding: 0.75rem 1rem; 
    margin-top: 1rem; 
    border-radius: .25rem; 
}


/* CTA Section (used in multiple pages) */
.cta-section {
    /* bg-darker-custom often applied in HTML */
}
.cta-section h2 {
    font-weight: 900;
    color: var(--text-primary);
}
.cta-section .lead {
    color: var(--text-secondary);
}

/* Footer */
.footer-custom {
    background-color: #171a1f; 
    color: var(--text-secondary); /* Default footer text color */
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
}
.footer-custom p { /* Ensure all p in footer use a more legible color if needed */
    color: var(--text-secondary-lighter); /* Using lighter grey for better contrast */
}


/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-darker);
}
::-webkit-scrollbar-thumb {
    background: #4f545e;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}


/* Modal Styles */
.modal-content.bg-card-custom {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary); 
}
.modal-content.bg-card-custom .small-text {
    color: var(--text-secondary); /* This should be fine for modals, or use --text-secondary-lighter if needed */
}
.modal-header.border-0, .modal-footer.border-0 {
    border: none;
}
.btn-close-white {
    filter: invert(1) grayscale(100%) brightness(200%); 
}


/* Responsiveness */
@media (max-width: 992px) {
    .hero-section h1 {
        font-size: 2.5rem;
    }
     .page-hero-section h1 {
        font-size: 2.2rem;
    }
}

@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2.2rem;
    }
    .hero-section .lead {
        font-size: 1.1rem;
    }
    .page-hero-section h1 {
        font-size: 2rem;
    }
    .btn-lg {
        font-size: 1rem;
        padding: 0.6rem 1.2rem;
    }
    .chat-assaggio-messages {
        height: 250px;
    }
    .hero-section .btn-lg {
        display: block;
        margin-left: auto;
        margin-right: auto;
        max-width: 300px; 
    }
     .hero-section .btn-lg + .btn-lg { 
        margin-top: 1rem;
    }
}
@media (max-width: 576px) {
    .hero-section h1 {
        font-size: 1.8rem;
    }
    .hero-section .lead {
        font-size: 1rem;
    }
    .page-hero-section h1 {
        font-size: 1.8rem;
    }
    .nav-link {
        margin-left: 0;
        margin-right: 0;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
    .navbar-nav {
        text-align: center;
    }
    .feature-card, .agent-showcase-card .card-body { 
        padding: 1.25rem;
    }
    .devpnt-case-study .card-body { 
        padding: 1.25rem;
    }
    .case-study-visual .summary-line {
        font-size: 0.8rem; 
    }
}