/* Base Styles */
:root {
    --primary-color: #4a6cf7;
    --secondary-color: #2a3b8f;
    --dark-color: #1e293b;
    --light-color: #f8fafc;
    --gray-color: #94a3b8;
    --transition: all 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: var(--light-color);
}

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

ul {
    list-style: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 30px;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
}

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

.primary-btn:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.secondary-btn {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    margin-left: 15px;
}

.secondary-btn:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Header Styles */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    font-weight: 500;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--primary-color);
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: var(--dark-color);
    margin: 3px 0;
    border-radius: 3px;
    transition: var(--transition);
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    background-color: #f0f4f8;
    padding-top: 80px;
}

.hero-content {
    max-width: 800px;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 10px;
    line-height: 1.2;
}

.hero h2 {
    font-size: 2rem;
    color: var(--gray-color);
    margin-bottom: 20px;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    color: var(--gray-color);
}

.highlight {
    color: var(--primary-color);
}

.cta-buttons {
    margin-bottom: 30px;
}

.social-icons {
    display: flex;
    gap: 20px;
}

.social-icons a {
    font-size: 1.5rem;
    color: var(--dark-color);
    transition: var(--transition);
}

.social-icons a:hover {
    color: var(--primary-color);
    transform: translateY(-3px);
}

/* About Section */
.about {
    padding: 100px 0;
    background-color: white;
}

.about-content {
    display: flex;
    align-items: center;
    gap: 50px;
}

.about-image {
    flex: 1;
}

.about-image img {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.about-text {
    flex: 1;
}

.about-text p {
    margin-bottom: 20px;
    color: var(--gray-color);
}

/* Skills Section */
.skills {
    padding: 100px 0;
    background-color: #f0f4f8;
}

.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 30px;
}

.skill-card {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

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

.skill-card i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.skill-card h3 {
    font-size: 1.2rem;
}

/* Projects Section */
.projects {
    padding: 100px 0;
    background-color: white;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

.project-card {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

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

.project-image img {
    width: 100%;
    height: 200px;
    object-fit: contain; /* Cambiato da 'cover' a 'contain' */
    background-color: #f5f5f5; /* Aggiunto per vedere meglio i bordi dell'immagine */
}

.project-info {
    padding: 20px;
}

.project-info h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.project-info p {
    color: var(--gray-color);
    margin-bottom: 15px;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.project-tags span {
    background-color: #e2e8f0;
    color: var(--dark-color);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
}

.project-links {
    display: flex;
    gap: 15px;
}

.project-links a {
    color: var(--primary-color);
    font-weight: 500;
    transition: var(--transition);
}

.project-links a:hover {
    color: var(--secondary-color);
}

/* Contact Section */
.contact {
    padding: 100px 0;
    background-color: #f0f4f8;
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 50px;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 15px;
}

.contact-item i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    font-family: 'Poppins', sans-serif;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

/* Preloader Styles */
.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #ffffff;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease-out;
}

.preloader.fade-out {
  opacity: 0;
}

.loader {
  width: 50px;
  height: 50px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Cookie Banner Styles */
.cookie-close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #666;
  transition: color 0.3s;
  padding: 0;
  line-height: 1;
  z-index: 10;
}

.cookie-close-btn:hover {
  color: #333;
}

.cookie-content {
  position: relative;
}

.cookie-footer {
  margin-top: 15px;
  border-top: 1px solid #eee;
  padding-top: 15px;
}

.data-transfer-notice {
  font-size: 0.8rem;
  color: #666;
  margin-top: 5px;
  font-style: italic;
}

.gdpr-rights {
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.section-description {
  text-align: center;
  max-width: 800px;
  margin: -2rem auto 3rem;
  color: #666;
  font-size: 1.1rem;
}

/* Language Switcher */
.lang-switcher {
  display: flex;
  gap: 5px;
  margin-left: 20px;
}

.lang-switcher a {
  font-weight: 600;
  width: 35px; /* Larghezza fissa per entrambi i pulsanti */
  height: 30px; /* Altezza fissa */
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px solid var(--primary-color);
  border-radius: 5px;
  transition: var(--transition);
  color: var(--primary-color);
  padding: 0; /* Rimosso padding variabile */
}

.lang-switcher a:hover {
  background-color: var(--primary-color);
  color: white;
}

.lang-switcher a.active {
  background-color: var(--primary-color);
  color: white;
}

/* Footer */
footer {
    background-color: var(--dark-color);
    color: white;
    padding: 30px 0;
    text-align: center;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .about-content {
        flex-direction: column;
    }
    
    .contact-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background-color: white;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        transition: var(--transition);
        padding-bottom: 50px; /* Spazio extra per il menu mobile */
    }
    
    .nav-links.active {
        left: 0;
    }

    .lang-switcher {
        margin-left: 0;
        margin-top: 20px;
        justify-content: center;
    }
    
    .hamburger {
        display: flex;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero h2 {
        font-size: 1.5rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
}

.centered-contact {
    display: flex;
    justify-content: center;
}

.centered-contact .contact-info {
    max-width: 500px;
}

.centered-contact .contact-item {
    text-align: left;
}

.centered-contact .contact-item h3 {
    text-align: left;
}

.centered-contact .social-icons {
    margin-top: 2rem;
    justify-content: center;
}

/* Cookie Banner and Modal */
/* Cookie Banner and Modal */
.cookie-banner {
    display: none; /* Keep this as none by default */
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(30, 41, 59, 0.95);
    color: white;
    z-index: 1001;
    padding: 15px 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.cookie-content p {
    flex: 1;
    margin-right: 20px;
    margin-bottom: 10px;
}

.cookie-buttons {
    display: flex;
    gap: 10px;
}

.cookie-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1002;
    justify-content: center;
    align-items: center;
}

.cookie-modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.cookie-option {
    margin: 20px 0;
    padding-bottom: 15px;
    border-bottom: 1px solid #e2e8f0;
}

.cookie-option label {
    display: flex;
    align-items: center;
    font-weight: 600;
    margin-bottom: 5px;
}

.cookie-option input {
    margin-right: 10px;
}

.cookie-option p {
    margin-left: 25px;
    color: var(--gray-color);
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .cookie-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .cookie-content p {
        margin-right: 0;
        margin-bottom: 15px;
    }
}

/* Privacy Policy Page */
.privacy-policy {
    padding: 150px 0 100px;
    background-color: white;
}

.policy-content {
    max-width: 800px;
    margin: 0 auto;
}

.policy-content h2 {
    margin-top: 40px;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.policy-content h3 {
    margin-top: 25px;
    margin-bottom: 10px;
}

.policy-content p, .policy-content ul {
    margin-bottom: 15px;
    color: var(--gray-color);
}

.policy-content ul {
    padding-left: 20px;
    list-style-type: disc;
}

.policy-content li {
    margin-bottom: 8px;
}
.social-icons-contact {
    display: flex;
    gap: 15px;
    margin-top: 5px;
}

.social-icons-contact a {
    color: var(--text-color);
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

.social-icons-contact a:hover {
    color: var(--primary-color);
}
