/* Reset e base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Light theme (default) - con azzurrino istituzionale */
    --bg-color: #ffffff;
    --text-color: #2d3748;
    --accent-color: #87CEEB; /* Azzurrino istituzionale */
    --accent-hover: #6BB6D6;
    --accent-dark: #4682B4;
    --green-terminal: #2d5016;
    --border-color: #e2e8f0;
    --card-bg: #f7fafc;
    --card-hover: #edf2f7;
    --shadow: rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    /* Dark theme */
    --bg-color: #0d1117;
    --text-color: #c9d1d9;
    --accent-color: #87CEEB; /* Manteniamo l'azzurrino anche nel dark */
    --accent-hover: #A8D8E8;
    --accent-dark: #6BB6D6;
    --green-terminal: #3fb950;
    --border-color: #30363d;
    --card-bg: #161b22;
    --card-hover: #1c2128;
    --shadow: rgba(0, 0, 0, 0.3);
}

body {
    font-family: 'Courier New', 'Monaco', 'Menlo', monospace;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
}

/* Theme toggle button */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 2px 8px var(--shadow);
}

.theme-toggle:hover {
    border-color: var(--accent-color);
    background-color: var(--card-hover);
    transform: scale(1.1);
}

.theme-toggle:active {
    transform: scale(0.95);
}

[data-theme="dark"] .theme-toggle .theme-icon {
    color: #ffd700;
    filter: drop-shadow(0 0 3px rgba(255, 215, 0, 0.5));
}

/* Header */
header {
    text-align: center;
    margin-bottom: 60px;
    padding: 40px 20px;
    border-bottom: 2px solid var(--border-color);
    transition: border-color 0.3s ease;
}

.logo-container {
    margin-bottom: 30px;
}

.logo {
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 0 10px var(--accent-color));
    transition: filter 0.3s ease;
}

[data-theme="dark"] .logo {
    filter: drop-shadow(0px 0px 2px rgb(255, 255, 255));
}

.ascii-logo {
    color: var(--accent-dark);
    font-size: 12px;
    line-height: 1.2;
    text-align: left;
    display: inline-block;
    margin: 0;
    font-family: 'Courier New', monospace;
}

[data-theme="dark"] .ascii-logo {
    color: var(--accent-color);
}

h1 {
    font-size: 2.5em;
    color: var(--accent-dark);
    margin-bottom: 10px;
    text-shadow: 0 0 10px rgba(135, 206, 235, 0.3);
    transition: color 0.3s ease;
}

[data-theme="dark"] h1 {
    color: var(--accent-color);
    text-shadow: 0 0 10px rgba(135, 206, 235, 0.5);
}

.tagline {
    font-size: 1.2em;
    color: var(--green-terminal);
    margin-bottom: 15px;
    font-weight: bold;
    transition: color 0.3s ease;
}

.description {
    font-size: 1em;
    color: var(--text-color);
    opacity: 0.9;
    transition: color 0.3s ease;
}

/* Main sections */
main {
    padding: 20px 0;
}

section {
    margin-bottom: 50px;
}

h2 {
    color: var(--accent-dark);
    font-size: 1.5em;
    margin-bottom: 20px;
    font-weight: normal;
    transition: color 0.3s ease;
}

[data-theme="dark"] h2 {
    color: var(--accent-color);
}

.info-section p {
    margin-bottom: 15px;
    font-size: 1em;
    line-height: 1.8;
    transition: color 0.3s ease;
}

.info-section strong {
    color: var(--accent-dark);
    transition: color 0.3s ease;
}

[data-theme="dark"] .info-section strong {
    color: var(--accent-color);
}

.info-section ul {
    margin-left: 2em;
    margin-bottom: 15px;
    padding-left: 0;
}

.info-section li {
    margin-bottom: 8px;
    line-height: 1.8;
}

.statuto-link {
    display: inline-block;
    color: var(--accent-dark);
    text-decoration: none;
    font-weight: bold;
    margin-top: 10px;
    padding: 8px 15px;
    border: 2px solid var(--accent-color);
    border-radius: 5px;
    transition: all 0.3s ease;
}

.statuto-link:hover {
    background-color: var(--accent-color);
    color: var(--bg-color);
    transform: translateX(5px);
}

[data-theme="dark"] .statuto-link {
    color: var(--accent-color);
}

[data-theme="dark"] .statuto-link:hover {
    background-color: var(--accent-color);
    color: var(--bg-color);
}

/* Breadcrumb navigation */
.breadcrumb {
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.breadcrumb a {
    color: var(--accent-dark);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: var(--accent-hover);
}

[data-theme="dark"] .breadcrumb a {
    color: var(--accent-color);
}

/* Statuto section specific styles */
.statuto-section h2 {
    margin-top: 30px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.statuto-section h2:first-of-type {
    margin-top: 0;
}

.statuto-date {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 2px solid var(--border-color);
    text-align: center;
    font-style: italic;
    opacity: 0.8;
}

/* Contacts grid */
.contacts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.contact-card {
    background-color: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 25px;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.contact-card:hover {
    border-color: var(--accent-color);
    background-color: var(--card-hover);
    box-shadow: 0 4px 12px rgba(135, 206, 235, 0.2);
    transform: translateY(-5px);
}

.contact-icon {
    font-size: 2.5em;
    margin-bottom: 15px;
}

.contact-card h3 {
    color: var(--accent-dark);
    font-size: 1.2em;
    margin-bottom: 10px;
    font-weight: normal;
    transition: color 0.3s ease;
}

[data-theme="dark"] .contact-card h3 {
    color: var(--accent-color);
}

.contact-card p {
    font-size: 0.9em;
    margin-bottom: 10px;
    opacity: 0.8;
    flex-grow: 1;
}

.contact-link {
    color: var(--accent-dark);
    font-size: 0.9em;
    font-weight: bold;
    margin-top: auto;
    transition: color 0.3s ease;
}

[data-theme="dark"] .contact-link {
    color: var(--accent-color);
}

/* Footer */
.footer-section {
    text-align: center;
    padding: 40px 20px;
    border-top: 2px solid var(--border-color);
    margin-top: 60px;
    transition: border-color 0.3s ease;
}

.footer-text {
    font-size: 1.1em;
    margin-bottom: 15px;
}

.prompt {
    color: var(--green-terminal);
    font-weight: bold;
    transition: color 0.3s ease;
}

.command {
    color: var(--accent-dark);
    transition: color 0.3s ease;
}

[data-theme="dark"] .command {
    color: var(--accent-color);
}

.footer-copyright {
    font-size: 0.85em;
    opacity: 0.7;
}

/* Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 2em;
    }

    .contacts-grid {
        grid-template-columns: 1fr;
    }

    .ascii-logo {
        font-size: 10px;
    }

    .theme-toggle {
        top: 10px;
        right: 10px;
        width: 45px;
        height: 45px;
        font-size: 1.3em;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.5em;
    }

    .tagline {
        font-size: 1em;
    }

    .ascii-logo {
        font-size: 8px;
    }

    .theme-toggle {
        width: 40px;
        height: 40px;
        font-size: 1.2em;
    }
}

/* Animazione blink per il prompt */
@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.prompt::after {
    content: '_';
    animation: blink 1s infinite;
    margin-left: 2px;
}
