/* Stili comuni per tutte le pagine interne */
.page-header {
    background: var(--light-bg);
    padding: 4rem 2rem;
    text-align: center;
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 3rem;
    color: var(--text-color);
    margin: 0;
}

/* Biografia */
.biography-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 3rem;
    padding: 2rem;
}

.bio-image {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
}

.bio-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.bio-text {
    line-height: 1.8;
}

.qualifications-list {
    list-style: none;
    padding: 0;
}

.qualifications-list li {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    position: relative;
}

.qualifications-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--primary-color);
}

/* Contatti */
.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    padding: 2rem;
}

.contact-info {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px var(--shadow-color);
}

.info-block {
    margin-bottom: 2rem;
}

.contact-form {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px var(--shadow-color);
}

/* Privacy e Cookie Policy */
.policy-section {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    line-height: 1.8;
}

/* Media Queries */
@media (max-width: 768px) {
    .biography-content,
    .contact-container {
        grid-template-columns: 1fr;
    }
}

/* Interests Page */
.interests-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.interest-card {
    perspective: 1500px;
    height: 400px;
}

.interest-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s;
    transform-style: preserve-3d;
    cursor: pointer;
}

.interest-card:hover .interest-card-inner {
    transform: rotateY(180deg);
}

.interest-card-front,
.interest-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 15px;
    padding: 2rem;
    background: var(--card-bg);
    box-shadow: 0 4px 15px var(--shadow-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.interest-card-front {
    background: linear-gradient(
        135deg,
        var(--primary-color),
        var(--secondary-color)
    );
    color: white;
}

.interest-card-back {
    background: var(--card-bg);
    transform: rotateY(180deg);
    padding: 2rem;
    color: var(--text-color);
    line-height: 1.6;
}

.card-icon {
    font-size: 4rem;
    margin: 2rem 0;
    opacity: 0.9;
}

.interest-card-front h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: white;
}

/* Animazione al caricamento */
@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.interest-card {
    animation: cardAppear 0.6s ease-out backwards;
}

.interest-card:nth-child(1) {
    animation-delay: 0.2s;
}

.interest-card:nth-child(2) {
    animation-delay: 0.4s;
}

.interest-card:nth-child(3) {
    animation-delay: 0.6s;
}

/* Media Queries */
@media (max-width: 768px) {
    .interests-container {
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .interest-card {
        height: 350px;
    }
}

/* Mobile Styles for Internal Pages */
@media (max-width: 768px) {
    .page-header {
        padding: 2rem 1rem;
    }

    .page-header h1 {
        font-size: 2.2rem;
    }

    .biography-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 1rem;
    }

    .bio-image {
        width: 100%;
        max-width: 250px;
        aspect-ratio: 1 / 1;
        margin: 0 auto;
        border-radius: 20px;
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .bio-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 20px;
    }

    .policy-section {
        padding: 1rem;
    }

    .policy-section h2 {
        font-size: 1.8rem;
    }

    .policy-section h3 {
        font-size: 1.4rem;
    }
}

/* 404 Page */
.error-container {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light-bg);
    padding-bottom: 100px; /* Ridotto da 400px */
}

.parallax-wrapper {
    position: absolute;
    bottom: -100px;
    left: 0;
    width: 100%;
    height: 500px;
    z-index: 1;
}

.parallax-image {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: auto;
    height: 100%;
    background-position: bottom center;
    background-repeat: no-repeat;
    background-size: contain;
    transform: translateX(-50%);
    will-change: transform;
    opacity: 0.9;
}

.error-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem;
    background: rgba(var(--card-bg-rgb), 0.95);
    border-radius: 20px;
    backdrop-filter: blur(8px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    margin: 1rem; /* Ridotto da 2rem */
    margin-bottom: 50px; /* Ridotto da 300px */
}

.error-title {
    font-size: 8rem;
    color: var(--primary-color);
    margin: 0;
    line-height: 1;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.error-subtitle {
    font-size: 2.5rem;
    color: var(--text-color);
    margin: 1rem 0;
}

.error-text {
    font-size: 1.2rem;
    color: var(--text-color);
    margin-bottom: 2rem;
}

.error-image {
    width: 300px; /* Ridotto da 400px */
    height: 300px; /* Ridotto da 400px */
    margin: 1rem auto; /* Ridotto da 2rem */
    display: flex;
    justify-content: center;
    align-items: center;
}

.maze-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply; /* Rimuove lo sfondo bianco */
    opacity: 0.9;
    animation: float 3s ease-in-out infinite;
}

.error-actions {
    margin-top: 2rem;
}

.home-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    background: var(--primary-color);
    color: white;
    border-radius: 30px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.home-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(var(--primary-rgb), 0.3);
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@media (max-width: 768px) {
    .error-title {
        font-size: 6rem;
    }
    
    .error-subtitle {
        font-size: 2rem;
    }
    
    .error-content {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .parallax-image {
        top: -10%;
        left: -5%;
        width: 110%;
        height: 110%;
    }

    .error-container {
        padding-bottom: 50px; /* Ridotto da 300px */
    }

    .parallax-wrapper {
        height: 400px;
    }

    .error-content {
        margin-bottom: 30px; /* Ridotto da 200px */
    }
}

@media (max-width: 480px) {
    .error-title {
        font-size: 4rem;
    }
    
    .error-subtitle {
        font-size: 1.5rem;
    }
}

/* Biografia Page Styles */
.biography-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.bio-section {
    margin-bottom: 4rem;
    opacity: 0;
    transform: scale(0.95) translateY(30px);
    transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
    perspective: 1000px;
}

.bio-section:nth-child(2) { animation-delay: 0.2s; }
.bio-section:nth-child(3) { animation-delay: 0.4s; }
.bio-section:nth-child(4) { animation-delay: 0.6s; }

.bio-section.visible {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.bio-section:hover {
    transform: scale(1.02);
}

.intro-section {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 3rem;
    align-items: center;
}

.bio-image {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.bio-image img {
    width: 100%;
    height: auto;
    transition: transform 0.3s ease;
}

.bio-image:hover img {
    transform: scale(1.05);
}

.qualifications {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
}

.qualifications span {
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

.bio-highlight {
    font-size: 1.2rem;
    color: var(--text-muted);
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
    margin: 1.5rem 0;
}

/* Timeline */
.timeline {
    position: relative;
    padding: 2rem 0 2rem 60px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 30px;
    top: 0;
    height: 100%;
    width: 2px;
    background: var(--primary-color);
}

.timeline-item {
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 2.5rem;
    position: relative;
}

.timeline-date {
    align-self: flex-start;
    margin-left: 0;
    margin-right: 0;
    margin-bottom: -1.2rem;
    margin-top: 0;
}

.timeline-content {
    margin-top: 0;
}

.timeline-date {
    background: rgba(30, 60, 120, 0.25); /* Colore primario trasparente */
    color: #fff;
    font-weight: 700;
    font-size: 1.05rem;
    min-width: 110px;
    min-height: 38px;
    padding: 0.5em 1.2em;
    border-radius: 12px 12px 0 0; /* Tab rettangolare con angoli superiori arrotondati */
    box-shadow: 0 4px 24px rgba(30,60,120,0.10);
    backdrop-filter: blur(8px); /* Effetto blur */
    -webkit-backdrop-filter: blur(8px);
    border: 1.5px solid rgba(255,255,255,0.25);
    margin-right: 2rem;
    margin-bottom: 0.5rem;
    text-align: center;
    position: relative;
    z-index: 2;
    transition: box-shadow 0.2s, transform 0.2s;
    word-break: break-word;
    letter-spacing: 0.02em;
    overflow: hidden;
}

.timeline-date::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 12px 12px 0 0;
    pointer-events: none;
    background: linear-gradient(120deg, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0.05) 100%);
    z-index: 1;
}

.timeline-date span, .timeline-date {
    position: relative;
    z-index: 2;
}

/* Rimuovo tutte le regole clip-path e border-radius personalizzate per le date della timeline */
.timeline-item:nth-child(1) .timeline-date,
.timeline-item:nth-child(2) .timeline-date,
.timeline-item:nth-child(3) .timeline-date,
.timeline-item:nth-child(4) .timeline-date,
.timeline-item:nth-child(5) .timeline-date,
.timeline-item:nth-child(6) .timeline-date,
.timeline-item:nth-child(7) .timeline-date,
.timeline-item:nth-child(8) .timeline-date,
.timeline-item:nth-child(9) .timeline-date,
.timeline-item:nth-child(10) .timeline-date,
.timeline-item:nth-child(11) .timeline-date,
.timeline-item:nth-child(12) .timeline-date {
    clip-path: none !important;
    border-radius: 12px 12px 0 0 !important;
}

.timeline-content {
    background: var(--card-bg);
    padding: 1.5rem 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    transition: transform 0.3s;
    overflow: hidden;
    flex: 1;
    position: relative;
}

.timeline-content::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-color);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.6s ease;
}

.timeline-item.visible .timeline-content::before {
    transform: scaleY(1);
}

.timeline-content:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

/* Publications Grid */
.publications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.publication-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.publication-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.pub-year {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.3rem 1rem;
    border-radius: 15px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .intro-section {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .bio-image {
        max-width: 250px;
        margin: 0 auto;
    }
    
    .qualifications {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .timeline-item {
        flex-direction: column;
        align-items: stretch;
    }
    .timeline-date {
        margin-right: 0;
        margin-bottom: 1rem;
        align-self: flex-start;
    }
    .timeline-content {
        padding: 1.2rem 1rem;
    }
}

.book-card {
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.book-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.book-info {
    padding: 1rem;
    text-align: center;
}

.book-info h3 {
    margin: 0.5rem 0;
    color: var(--text-color);
}

.book-info p {
    color: var(--text-muted);
    margin: 0;
}

/* Cookie Banner Migliorato */
.cookie-banner {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(200%);
    width: 90%;
    max-width: 400px;
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 20px;
    z-index: 1000;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.cookie-banner.show {
    transform: translateX(-50%) translateY(0);
}

.cookie-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.cookie-content p {
    margin: 0;
    line-height: 1.6;
    font-size: 0.95rem;
}

.cookie-content a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.cookie-buttons {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.btn-primary, .btn-secondary {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-secondary {
    background: transparent;
    color: var(--text-color);
    border: 2px solid var(--border-color);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(var(--primary-rgb), 0.3);
}

.btn-secondary:hover {
    background: var(--border-color);
    transform: translateY(-2px);
}

/* Section Animations */
.bio-section {
    opacity: 0;
    transform: scale(0.95) translateY(30px);
    transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
    perspective: 1000px;
}

.bio-section.visible {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.bio-section:hover {
    transform: scale(1.02);
}

.publication-card {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.publication-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.publication-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

@media (max-width: 768px) {
    .cookie-content {
        flex-direction: column;
        text-align: center;
    }
}

.alert {
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 8px;
    text-align: center;
}

.alert-success {
    background-color: rgba(var(--success-rgb), 0.1);
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

.alert-error {
    background-color: rgba(var(--error-rgb), 0.1);
    color: var(--error-color);
    border: 1px solid var(--error-color);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1.2rem 2rem;
    border-radius: 12px;
    background: white;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    transform: translateX(150%);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 9999;
    min-width: 300px;
    pointer-events: none;
    opacity: 0;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.success {
    background: #4CAF50;
    color: white;
}

.toast.error {
    background: #f44336;
    color: white;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.toast-content::before {
    content: '✓';
    font-size: 1.2rem;
}

.toast.error .toast-content::before {
    content: '✕';
}

/* Nuovo Loading Button con Brain Animation */
.submit-btn {
    position: relative;
    overflow: hidden;
    padding: 1rem 2rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(var(--primary-rgb), 0.3);
}

.btn-loader {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: transform 0.3s ease;
}

.btn-brain {
    position: absolute;
    left: -24px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    transition: transform 2s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}

.submit-btn.loading .btn-brain {
    opacity: 1;
    transform: translate(calc(24px + 100%), -50%);
}

.submit-btn.loading .btn-text {
    opacity: 0.7;
}

.submit-btn.loading .btn-loader {
    animation: loading 2s ease infinite;
}

@keyframes loading {
    0% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(200%);
    }
    100% {
        transform: translateX(0);
    }
}

/* Form Styles */
.form-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.checkbox-group input[type="checkbox"] {
    margin-top: 0.25rem;
}

.privacy-consent {
    margin: 1.5rem 0;
}

.privacy-consent a {
    color: var(--primary-color);
    text-decoration: none;
}

.privacy-consent a:hover {
    text-decoration: underline;
}

/* Logo SPI */
.qualifications img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    object-fit: contain;
    object-position: center;
}

.logo-spi {
    width: 100%;
    max-width: 300px;
    margin: 2rem auto;
    text-align: center;
}

.logo-spi img {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 0; /* Rimuove eventuali bordi arrotondati */
}

/* Media Queries per il logo */
@media (max-width: 768px) {
    .logo-spi {
        max-width: 250px;
        margin: 1.5rem auto;
    }
}

/* Eventi Page Styles */
.events-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.event-card {
    background: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px var(--shadow-color);
    transition: transform 0.3s ease;
}

.event-card:hover {
    transform: translateY(-5px);
}

.event-image {
    width: 100%;
    height: 400px;
    overflow: hidden;
}

.event-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.event-content {
    padding: 1.5rem;
}

.event-date {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.event-location {
    margin-top: 1rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

@media (max-width: 768px) {
    .events-section {
        padding: 1rem;
    }
    
    .events-grid {
        grid-template-columns: 1fr;
    }
}

/* Admin Login Styles */
.admin-login {
    max-width: 400px;
    margin: 4rem auto;
    padding: 2rem;
    background: var(--card-bg);
    border-radius: 15px;
    box-shadow: 0 4px 15px var(--shadow-color);
}

.admin-login h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-color);
}

.admin-login .form-group {
    margin-bottom: 1.5rem;
}

.admin-login label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.admin-login input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text-color);
}

.admin-login .btn-primary {
    width: 100%;
    padding: 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.admin-login .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(var(--primary-rgb), 0.3);
}

@media (max-width: 768px) {
    .admin-login {
        margin: 2rem 1rem;
        padding: 1.5rem;
    }
}

/* Timeline Blob Dates Animation */
@keyframes dateAppear {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
} 