/* ==========================================================================
   Variabili CSS & Reset
   ========================================================================== */
:root {
    --bg-color: #0a0a0f;
    --bg-surface: rgba(20, 20, 28, 0.6);
    --bg-surface-hover: rgba(30, 30, 42, 0.8);

    --accent-primary: #00d4ff;
    --accent-secondary: #0077ff;
    --text-primary: #f8f9fa;
    --text-secondary: #a0a0b0;
    --text-muted: #6c757d;

    --border-color: rgba(255, 255, 255, 0.12);
    --border-glow: rgba(0, 212, 255, 0.4);

    --hover-border: var(--border-glow);
    --hover-shadow: 0 8px 30px rgba(0, 212, 255, 0.15);

    --tag-border: rgba(255, 255, 255, 0.35);
    --tag-bg: rgba(255, 255, 255, 0.07);
    --tag-bg-hover: rgba(0, 212, 255, 0.1);

    --font-sans: 'Inter', system-ui, -apple-system, 'BlinkMacSystemFont', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-heading: 'Inter', system-ui, -apple-system, 'BlinkMacSystemFont', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

[data-theme="light"] {
    --bg-color: #f0f2f5;
    --bg-surface: rgba(255, 255, 255, 0.8);
    --bg-surface-hover: rgba(255, 255, 255, 1);

    --accent-primary: #0066cc;
    --accent-secondary: #004499;
    --text-primary: #1a1a24;
    --text-secondary: #4a4a5a;
    --text-muted: #6c757d;

    --border-color: rgba(0, 0, 0, 0.1);
    --border-glow: rgba(0, 102, 204, 0.3);

    --hover-border: var(--border-glow);
    --hover-shadow: 0 8px 30px rgba(0, 102, 204, 0.15);

    --tag-border: rgba(0, 0, 0, 0.35);
    --tag-bg: rgba(0, 0, 0, 0.06);
    --tag-bg-hover: rgba(0, 102, 204, 0.12);
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    text-decoration: none;
    color: inherit;
}

h1,
h2,
h3,
h4,
h5,
h6,
.logo {
    font-family: var(--font-heading);
}

/* ==========================================================================
   Accessibilità
   ========================================================================== */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent-primary);
    color: #fff;
    padding: 8px 16px;
    min-width: 170px;
    box-sizing: border-box;
    text-align: center;
    z-index: 9999;
    transition: top 0.3s;
}

.skip-to-content:focus {
    top: 0;
}

:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* ==========================================================================
   Effetti di Sfondo
   ========================================================================== */
.background-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: -2;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.1) 100%);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.1) 100%);
}

.top-glow {
    position: fixed;
    top: -150px;
    left: 50%;
    transform: translateX(-50%);
    width: 80vw;
    height: 300px;
    background: radial-gradient(ellipse at center, rgba(0, 119, 255, 0.2) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
}

/* ==========================================================================
   Navigazione
   ========================================================================== */
.navbar {
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
}

/* ==========================================================================
   Cambio Lingua (i18n in tempo reale)
   ========================================================================== */
html[lang="it"] .lang-en {
    display: none !important;
}

html[lang="en"] .lang-it {
    display: none !important;
}

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

.logo {
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 2px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.lang-switch {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-surface);
    padding: 0.3rem 0.6rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.lang-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    transition: var(--transition);
}

.lang-btn:hover {
    color: var(--text-primary);
}

.lang-btn.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent-primary);
}

.separator {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.theme-btn {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.theme-btn:hover {
    color: var(--accent-primary);
    border-color: var(--border-color);
    transform: scale(1.05);
}

[data-theme="light"] .navbar {
    background: rgba(240, 242, 245, 0.85);
}

[data-theme="light"] .top-glow {
    background: radial-gradient(ellipse at center, rgba(0, 102, 204, 0.1) 0%, transparent 70%);
}

[data-theme="light"] .lang-btn.active {
    background: rgba(0, 102, 204, 0.1);
}

[data-theme="light"] .background-grid {
    background-image:
        linear-gradient(to right, rgba(0, 0, 0, 0.05) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0, 0, 0, 0.05) 1px, transparent 1px);
}

[data-theme="light"] .chat-input-area {
    background: rgba(255, 255, 255, 0.5);
}

[data-theme="light"] #chat-input {
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] #chat-input:focus {
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .ai-message {
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .chat-header {
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] #chat-send {
    color: #ffffff;
}

[data-theme="light"] .tech-tag {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .tech-tag:hover {
    background: rgba(0, 102, 204, 0.1);
    border-color: rgba(0, 102, 204, 0.3);
}

/* ==========================================================================
   Layout Principale
   ========================================================================== */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 4rem 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

/* Componente: Badge di Sezione */
.section-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 30px;
    color: var(--accent-primary);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
}

/* Componente: Riga Header Sezione (badge + rss inline) */
.section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.section-header .section-badge,
.section-header .newsletter-badge {
    margin-bottom: 0;
}

.section-header .newsletter-badge {
    margin-left: auto;
}

/* Componente: Badge Newsletter/RSS */
.newsletter-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.9rem;
    background: rgba(255, 140, 0, 0.08);
    border: 1px solid rgba(255, 140, 0, 0.3);
    border-radius: 30px;
    color: #ff9100;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-decoration: none;
    transition: var(--transition);
}

.newsletter-badge i {
    color: #ff9100;
    font-size: 0.75rem;
}

.newsletter-badge:hover {
    background: rgba(255, 140, 0, 0.15);
    border-color: #ff9100;
    color: #ffb84d;
    box-shadow: 0 4px 12px rgba(255, 140, 0, 0.2);
}


/* ==========================================================================
   Sezione Hero
   ========================================================================== */
.hero-section {
    display: flex;
    align-items: center;
    gap: 2.5rem;
}

.avatar-container {
    position: relative;
    width: 120px;
    height: 120px;
    flex-shrink: 0;
}

.avatar-glow {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 50%;
    filter: blur(20px);
    opacity: 0.5;
    animation: pulse 4s infinite alternate;
}

@keyframes pulse {
    0% {
        opacity: 0.3;
        transform: scale(0.95);
    }

    100% {
        opacity: 0.6;
        transform: scale(1.05);
    }
}

.avatar {
    position: relative;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.avatar::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    padding: 2px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
}

.initials {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff, #aaa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    filter: grayscale(20%) brightness(0.9) contrast(1.1);
    transition: var(--transition);
}

.avatar-container:hover .profile-img {
    filter: grayscale(0%) brightness(1) contrast(1);
}

.hero-text {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.name {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.5px;
}

.role {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--accent-primary);
}

.company {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 1rem;
    margin-top: 0.5rem;
}

/* ==========================================================================
   Sezione Bio
   ========================================================================== */
.bio-card {
    position: relative;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    transition: var(--transition);
}

[data-theme="light"] .bio-card {
    box-shadow: none;
}

.bio-card:hover {
    transform: translateY(-4px);
    border-color: var(--hover-border);
    box-shadow: var(--hover-shadow);
}

[data-theme="light"] .bio-card:hover {
    border-color: var(--hover-border);
    box-shadow: var(--hover-shadow);
}

.bio-accent-bar {
    width: 6px;
    background: linear-gradient(to bottom, var(--accent-primary), var(--accent-secondary));
    flex-shrink: 0;
}

.bio-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.bio-content p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    text-align: justify;
    hyphens: auto;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.tech-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--text-primary);
    transition: var(--transition);
}

.tech-tag:hover {
    background: rgba(0, 212, 255, 0.1);
    border-color: rgba(0, 212, 255, 0.3);
    color: var(--accent-primary);
    transform: translateY(-2px);
}

.tech-svg {
    vertical-align: middle;
    margin-top: -2px;
}

/* ==========================================================================
   Sezione Servizi
   ========================================================================== */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.service-card {
    position: relative;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: var(--transition);
    height: 100%;
    text-decoration: none;
    cursor: pointer;
}

.podcast-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.card-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 20px;
    background: radial-gradient(circle at center, var(--accent-primary) 0%, transparent 60%);
    opacity: 0;
    transition: var(--transition);
    mix-blend-mode: overlay;
    pointer-events: none;
    z-index: 0;
}

.service-card:hover {
    transform: translateY(-4px);
    border-color: var(--hover-border);
    box-shadow: var(--hover-shadow);
    background: var(--bg-surface-hover);
}

.service-card:hover .card-glow {
    opacity: 0.15;
}

.card-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 100%;
}

.card-icon {
    width: 50px;
    height: 50px;
    background: rgba(0, 212, 255, 0.1);
    color: var(--accent-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    border: 1px solid rgba(0, 212, 255, 0.2);
    transition: var(--transition);
}

.service-card:hover .card-icon {
    background: var(--accent-primary);
    color: var(--bg-color);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.4);
}

.service-card h3 {
    font-size: 1.3rem;
    font-weight: 600;
}

.service-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    flex-grow: 1;
}

.card-action {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-primary);
    font-weight: 500;
    font-size: 0.95rem;
    margin-top: 1rem;
}

.card-action i {
    transition: transform 0.3s ease;
}

.service-card:hover .card-action i {
    transform: translateX(5px);
}

/* ==========================================================================
   Sezione Social
   ========================================================================== */
.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.social-btn {
    width: 60px;
    height: 60px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--text-secondary);
    transition: var(--transition);
}

.social-btn:hover {
    transform: translateY(-5px);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

.social-btn.linkedin:hover {
    background: #0077b5;
    border-color: #0077b5;
    box-shadow: 0 10px 20px rgba(0, 119, 181, 0.4);
}

.social-btn.facebook:hover {
    background: #1877f2;
    border-color: #1877f2;
    box-shadow: 0 10px 20px rgba(24, 119, 242, 0.4);
}

.social-btn.email:hover {
    background: #ea4335;
    border-color: #ea4335;
    box-shadow: 0 10px 20px rgba(234, 67, 53, 0.4);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
    padding: 3rem 1.5rem;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    background: rgba(10, 10, 15, 0.5);
}

[data-theme="light"] .footer {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.signature {
    font-family: monospace;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.location {
    color: var(--text-muted);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ==========================================================================
   Animazioni
   ========================================================================== */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.2s;
}

.delay-3 {
    animation-delay: 0.3s;
}

.delay-4 {
    animation-delay: 0.4s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Design Responsivo
   ========================================================================== */
@media (max-width: 600px) {
    .container {
        padding: 2rem 1.5rem;
        gap: 3rem;
    }

    .hero-section {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }

    .company {
        justify-content: center;
    }

    .bio-content {
        padding: 1.5rem;
    }

    .tech-stack {
        justify-content: center;
    }

    .name {
        font-size: 2.2rem;
    }

    .role {
        font-size: 1.2rem;
    }
}

/* ==========================================================================
   Sezione Chat AI
   ========================================================================== */
.chat-section {
    margin-bottom: 3rem;
}

.chat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    backdrop-filter: blur(12px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 400px;
    transition: var(--transition);
}

.chat-card:hover {
    transform: translateY(-4px);
    border-color: var(--hover-border);
    box-shadow: var(--hover-shadow);
}

[data-theme="light"] .chat-card:hover {
    border-color: var(--hover-border);
    box-shadow: var(--hover-shadow);
}

.chat-header {
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #00ff88;
    border-radius: 50%;
    box-shadow: 0 0 8px #00ff88;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.chat-messages::-webkit-scrollbar {
    width: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

.message {
    max-width: 85%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.5;
    animation: messageSlide 0.3s ease-out;
}

.ai-message {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-bottom-left-radius: 2px;
}

/* Stile Markdown all'interno dei messaggi */
.message p {
    margin: 0;
}

.message p+p {
    margin-top: 0.5rem;
}

.message ul,
.message ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.message li {
    margin-bottom: 0.25rem;
}

.message strong {
    color: var(--accent-primary);
}

.user-message {
    align-self: flex-end;
    background: var(--accent-secondary);
    color: white;
    border-bottom-right-radius: 2px;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-input-area {
    padding: 1rem;
    display: flex;
    gap: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--border-color);
}

#chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.8rem 1rem;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
}

#chat-input:focus {
    border-color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.08);
}

#chat-send {
    background: var(--accent-primary);
    border: none;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0a0a0f;
    cursor: pointer;
    transition: all 0.2s;
}

#chat-send:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px var(--border-glow);
}

#chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.typing-indicator {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 0.5rem;
}

/* ==========================================================================
   Modale Tech
   ========================================================================== */
.tech-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 10, 15, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.tech-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.tech-modal-container {
    position: relative;
    width: 90%;
    max-width: 450px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 40px rgba(0, 212, 255, 0.1);
    transform: translateY(20px) scale(0.95);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-height: 80vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.tech-modal-container::-webkit-scrollbar {
    width: 4px;
}

.tech-modal-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

.tech-modal-overlay.active .tech-modal-container {
    transform: translateY(0) scale(1);
}

.tech-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: var(--transition);
}

.tech-modal-close:hover {
    background: rgba(255, 100, 100, 0.1);
    color: #ff6b6b;
    border-color: rgba(255, 100, 100, 0.3);
    transform: rotate(90deg);
}

.tech-modal-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-right: 2rem;
    /* Lascia spazio per il pulsante di chiusura */
}

.tech-modal-icon {
    width: 50px;
    height: 50px;
    background: rgba(0, 212, 255, 0.1);
    color: var(--accent-primary);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    flex-shrink: 0;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.2) inset;
}

.tech-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.tech-modal-body p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.7;
    margin: 0;
}

[data-theme="light"] .tech-modal-overlay {
    background: rgba(255, 255, 255, 0.4);
}