@import url('https://fonts.googleapis.com/css2?family=Readex+Pro:wght@160..700&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css');
body {
    font-family: "Readex Pro", sans-serif;
    background-color: #293133;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: 250px; /* Space for fixed footer */
    position: relative;
}

.container {
    width: 90%;
    max-width: 900px;
    margin: 15px auto;
    flex: 1;
}

/* Section styling */
.section {
    background-color: #ffffff;
    padding: 40px;
    margin: 20px 0;
    border-radius: 20px;
    position: relative;
    z-index: 10;
}

h2 {
    color: #333;
    margin-top: 0;
}

/* Navigation */
nav {
    background-color: #E895D7;
    padding: 15px;
    text-align: center;
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

nav a {
    color: white;
    text-decoration: none;
    margin: 0 15px;
    font-size: 18px;
    padding: 8px 12px;
    border-radius: 5px;
    transition: background-color 0.3s;
}

nav a:hover, nav a:focus {
    background-color: rgba(255, 255, 255, 0.2);
    text-decoration: underline;
}

nav a:focus {
    outline: 3px solid #FFCEF2;
    outline-offset: 2px;
}

/* Profile photo section */
.photo-section {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.photo {
    width: 150px;
    height: 150px;
    background-image: url('FotoIvan.png');
    background-size: cover;
    background-position: center;
    border-radius: 50%;
    border: 5px solid white;
    transition: transform 0.6s;
}

.photo:hover {
    transform: rotateY(180deg);
    background-image: url('LogoSitoSpecch.png');
}

/* Scroll to top button */
.scroll-to-top {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: #E895D7;
    color: white;
    text-align: center;
    line-height: 50px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    font-size: 24px;
    z-index: 900;
}

.scroll-to-top:focus {
    outline: 3px solid #FFCEF2;
    outline-offset: 2px;
}

/* Contact form */
.contact-form {
    width: 100%;
    max-width: 100%;
}

.form-group {
    margin-bottom: 20px;
}

form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

form input, form textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
    box-sizing: border-box;
}

form input:focus, form textarea:focus {
    border-color: #E895D7;
    outline: 2px solid #FFCEF2;
}

.privacy-group {
    display: flex;
    align-items: center;
}

.privacy-group input[type="checkbox"] {
    width: auto;
    margin-right: 10px;
}

.privacy-group label {
    display: inline;
    margin-bottom: 0;
}

form button {
    width: 100%;
    padding: 10px;
    background-color: #E895D7;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
    transition: background-color 0.3s;
}

form button:hover, form button:focus {
    background-color: #d784c6;
}

form button:focus {
    outline: 3px solid #FFCEF2;
    outline-offset: 2px;
}

/* About section */
.about-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    position: relative;
}

.download-btn {
    position: absolute;
    bottom: -60px;
    right: 0;
    background-color: #E895D7;
    color: white;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 5px;
    font-size: 16px;
    transition: background-color 0.3s;
    z-index: 5;
}

.download-btn:hover, .download-btn:focus {
    background-color: #d784c6;
    text-decoration: underline;
}

.download-btn:focus {
    outline: 3px solid #FFCEF2;
    outline-offset: 2px;
}

#about {
    padding-bottom: 60px;
}

/* Skills section */
.skills-section {
    padding: 40px 0;
    color: white;
    margin: 20px 0;
}

.skills-section h2 {
    color: white;
    margin-bottom: 20px;
}

.skills-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-top: 20px;
}

.skills-category {
    width: 100%;
}

.skills-category h3 {
    color: white;
    margin-bottom: 15px;
    padding-bottom: 5px;
    border-bottom: 2px solid #E895D7;
}

.skill-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.skill-name {
    width: 25%;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.skill-name i, .skill-name img {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #E895D7;
    font-size: 18px;
}

.skill-logo {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    object-fit: contain;
    vertical-align: middle;
}

.skill-bar-container {
    flex-grow: 1;
    height: 12px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    overflow: hidden;
    margin: 0 15px;
}

.skill-bar {
    height: 100%;
    background-color: #E895D7;
    border-radius: 6px;
}

.skill-level {
    width: 10%;
    text-align: right;
    font-weight: 500;
}

/* Project Card Swiper */
.swipe-container {
    position: relative;
    height: 550px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 40px 0;
}

.card-stack {
    position: relative;
    width: 350px;
    height: 495px;
    perspective: 1000px;
}

.card {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: #ffffff;
    border: 2px solid #E895D7;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    transition: transform 0.4s ease, opacity 0.4s ease, box-shadow 0.4s ease;
    backface-visibility: hidden;
    overflow: hidden;
    background-size: cover;
    background-position: center;
}

.card.dragging {
    transition: none;
}

.card.active {
    display: block;
    z-index: 10;
}

.card-content {
    padding: 20px;
    text-align: center;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 50%, rgba(0,0,0,0.7) 100%);
    opacity: 0;
    transition: opacity 0.3s;
    color: white;
    box-sizing: border-box;
}

.card:hover .card-content {
    opacity: 1;
}

.card-title-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(232, 149, 215, 0.9);
    padding: 15px 0;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    color: white;
    transform: translateY(0);
    transition: transform 0.3s ease, background-color 0.3s;
}

.card:hover .card-title-bar {
    background-color: rgba(232, 149, 215, 1);
}

/* Swipe controls */
.swipe-controls {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 30px;
}

.swipe-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s, background-color 0.3s, box-shadow 0.3s;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.swipe-button.reject {
    background-color: #E895D7;
    color: white;
}

.swipe-button.view {
    background-color: #ffffff;
    color: #E895D7;
    border: 2px solid #E895D7;
}

.swipe-button.like {
    background-color: #E895D7;
    color: white;
}

.swipe-button:hover, .swipe-button:focus {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.swipe-button.reject:hover, .swipe-button.reject:focus {
    background-color: #d784c6;
}

.swipe-button.view:hover, .swipe-button.view:focus {
    background-color: #FFCEF2;
    color: #333;
}

.swipe-button.like:hover, .swipe-button.like:focus {
    background-color: #d784c6;
}

/* Project details modal */
.project-details {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    width: 85%;
    max-width: 900px;
    text-align: left;
    max-height: 85vh;
    overflow-y: auto;
    z-index: 1100;
}

.project-details h3 {
    color: #333;
    font-size: 24px;
    text-align: center;
    margin-bottom: 25px;
    border-bottom: 2px solid #E895D7;
    padding-bottom: 15px;
}

.project-gallery {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px;
    margin: 30px 0;
}

.project-gallery img {
    max-width: 45%;
    height: auto;
    border-radius: 10px;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.project-gallery img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.project-details p {
    font-size: 16px;
    line-height: 1.7;
    color: #444;
    margin-bottom: 25px;
}

.close-btn {
    background-color: #E895D7;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    margin: 20px auto 0;
    display: block;
    transition: background-color 0.3s, transform 0.2s;
}

.close-btn:hover, .close-btn:focus {
    background-color: #d784c6;
    transform: translateY(-2px);
}

/* Modal backdrop */
.modal-backdrop, .overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1050;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    transition: opacity 0.3s;
}

/* Footer */
footer {
    background-color: #E895D7;
    color: white;
    text-align: center;
    padding: 25px 15px;
    width: 100%;
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 900;
    box-shadow: 0 -4px 8px rgba(0, 0, 0, 0.1);
}

.footer-content {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-info-bar {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 10px 20px;
    border-radius: 30px;
    margin-bottom: 15px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 15px;
    max-width: 90%;
}

.info-item {
    display: flex;
    align-items: center;
    margin: 0 10px;
}

.info-item i {
    margin-right: 8px;
    font-size: 18px;
}

.social-links {
    margin-bottom: 15px;
}

.social-links a {
    color: white;
    margin: 0 10px;
    font-size: 24px;
    transition: color 0.3s, transform 0.3s;
    display: inline-block;
}

.social-links a:hover, .social-links a:focus {
    color: #000000;
    transform: scale(1.1);
}

.social-links a:focus {
    outline: 3px solid #FFCEF2;
    outline-offset: 2px;
}

.contact-info {
    line-height: 1.6;
}

.contact-info a {
    color: white;
    text-decoration: none;
}

.contact-info a:hover, .contact-info a:focus {
    text-decoration: underline;
}

.contact-info a:focus {
    outline: 3px solid #FFCEF2;
    outline-offset: 2px;
}

/* Animations */
@keyframes swipeRight {
    from {transform: translateX(0) rotate(0deg);}
    to {transform: translateX(1000px) rotate(30deg);}
}

@keyframes swipeLeft {
    from {transform: translateX(0) rotate(0deg);}
    to {transform: translateX(-1000px) rotate(-30deg);}
}

/* Accessibility */
.skip-link {
    position: absolute;
    top: -50px;
    left: 0;
    background: #E895D7;
    color: white;
    padding: 10px;
    z-index: 1001;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid #FFCEF2;
}

/* Responsive design */
@media (max-width: 992px) {
    .container {
        width: 95%;
    }
    
    .section {
        padding: 30px;
    }
    
    .footer-info-bar {
        flex-direction: column;
        gap: 10px;
    }
    
    .info-item {
        margin: 5px 0;
    }
}

@media (max-width: 768px) {
    .container {
        width: 90%;
    }
    
    .section {
        padding: 25px;
    }
    
    .skill-name {
        width: 35%;
    }
    
    .swipe-container {
        height: 300px;
    }
    
    .card-stack {
        width: 200px;
        height: 250px;
    }
    
    .contact-info {
        font-size: 14px;
    }
    
    .contact-info br {
        display: block;
        content: "";
        margin: 5px 0;
    }
    
    .project-gallery img {
        max-width: 100%;
    }
    
    .footer-info-bar {
        padding: 10px;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    nav {
        padding: 10px 5px;
    }
    
    nav a {
        margin: 0 5px;
        font-size: 16px;
        padding: 5px 8px;
    }
    
    .section {
        padding: 20px;
        margin: 15px 0;
    }
    
    .skill-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .skill-name {
        width: 100%;
        margin-bottom: 5px;
    }
    
    .skill-bar-container {
        margin: 5px 0;
        width: 100%;
    }
    
    .skill-level {
        width: 100%;
        text-align: left;
        margin-top: 3px;
    }
    
    .swipe-container {
        height: 280px;
    }
    
    .card-stack {
        width: 180px;
        height: 230px;
    }
    
    .card-content {
        padding: 15px;
        font-size: 16px;
    }
    
    .swipe-button {
        width: 40px;
        height: 40px;
    }
    
    .about-header {
        flex-direction: column;
    }
    
    .download-btn {
        position: relative;
        bottom: 0;
        right: 0;
        margin-top: 15px;
        align-self: flex-end;
    }
    
    footer {
        padding: 20px 10px;
    }
    
    .social-links a {
        margin: 0 8px;
        font-size: 22px;
    }
    
    .contact-info {
        font-size: 13px;
    }
    
    .info-item {
        font-size: 13px;
    }
}