/* assets/css/style.css */

/* ===================================
   VARIABILI CSS E RESET
=================================== */
:root {
    --primary-orange: #f97316;
    --secondary-orange: #fb923c;
    --dark-bg: #0a0a0a;
    --dark-secondary: #1a1a1a;
    --dark-tertiary: #2a2a2a;
    --text-light: #ffffff;
    --text-gray: #9ca3af;
    --text-gray-light: #d1d5db;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--dark-bg);
    color: var(--text-light);
    overflow-x: hidden;
    line-height: 1.6;
}

html, body { 
    overflow-x: hidden;
    width: 100%;
}


/* ===================================
   PRELOADER
=================================== */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--dark-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loader {
    font-family: 'Exo 2', sans-serif;
    font-size: 4rem;
    font-weight: 900;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

/* ===================================
   NAVBAR
=================================== */
.navbar {
    background-color: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    z-index: 1000;
    transition: var(--transition);
}

.navbar.scrolled {
    padding: 0.5rem 0;
    box-shadow: 0 4px 20px rgba(249, 115, 22, 0.1);
}

.navbar-brand svg {
    height: 50px;
    width: auto;
}

.navbar-toggler {
    border: none;
    color: var(--text-light);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.nav-link {
    color: var(--text-gray) !important;
    font-weight: 500;
    margin: 0 1rem;
    transition: var(--transition);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: var(--primary-orange);
    transition: var(--transition);
    transform: translateX(-50%);
}

.nav-link:hover {
    color: var(--primary-orange) !important;
}

.nav-link:hover::after {
    width: 100%;
}

/* ===================================
   HERO SECTION
=================================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 80px;
    background: radial-gradient(circle at 30% 50%, rgba(249, 115, 22, 0.1) 0%, transparent 50%);
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 80%, transparent 50%, rgba(249, 115, 22, 0.05) 50%),
        radial-gradient(circle at 80% 20%, transparent 50%, rgba(249, 115, 22, 0.05) 50%);
    pointer-events: none;
}

.hero h1 {
    font-family: 'Exo 2', sans-serif;
    font-weight: 900;
    font-size: clamp(3rem, 8vw, 5rem);
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.hero .highlight {
    color: var(--primary-orange);
    position: relative;
    display: inline-block;
}

.hero .highlight::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-orange), var(--secondary-orange));
    border-radius: 2px;
}

.hero .subtitle {
    font-family: 'Roboto Mono', monospace;
    color: var(--primary-orange);
    font-size: 1.2rem;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
}

.hero .lead-text {
    color: var(--text-gray);
    font-size: 1.1rem;
    line-height: 1.8;
    max-width: 600px;
    margin-bottom: 3rem;
}

.stats-row {
    display: flex;
    gap: 3rem;
    margin-top: 4rem;
}

.stat-item h3 {
    font-size: 2.5rem;
    color: var(--primary-orange);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-item p {
    color: var(--text-gray);
    font-size: 0.9rem;
}

.hero-image {
    position: relative;
}

.code-window {
    background-color: var(--dark-secondary);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.window-header {
    background-color: var(--dark-tertiary);
    padding: 1rem;
    display: flex;
    gap: 0.5rem;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.red { background-color: #ff5f56; }
.dot.yellow { background-color: #ffbd2e; }
.dot.green { background-color: #27c93f; }

.code-window pre {
    padding: 2rem;
    margin: 0;
    overflow-x: auto;
}

.code-window code {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

.keyword { color: #ff79c6; }
.variable { color: #50fa7b; }
.property { color: #8be9fd; }
.string { color: #f1fa8c; }

/* ===================================
   BUTTONS
=================================== */
.btn {
    padding: 1rem 2.5rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    transition: var(--transition);
    border-radius: 5px;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background-color: var(--primary-orange);
    border: none;
    color: var(--text-light);
}

.btn-primary:hover {
    background-color: var(--secondary-orange);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(249, 115, 22, 0.3);
    color: var(--text-light);
}

.btn-outline {
    color: var(--text-light);
    border: 2px solid var(--primary-orange);
    background-color: transparent;
}

.btn-outline:hover {
    background-color: var(--primary-orange);
    color: var(--text-light);
    transform: translateY(-2px);
}

/* ===================================
   SECTIONS COMMON
=================================== */
section {
    position: relative;
}

.section-title {
    font-family: 'Exo 2', sans-serif;
    font-weight: 800;
    font-size: 3rem;
    margin-bottom: 3rem;
    text-align: center;
    position: relative;
}

.subtitle-section {
    display: block;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.9rem;
    color: var(--primary-orange);
    font-weight: 500;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

/* ===================================
   SERVICES SECTION
=================================== */
.services {
    padding: 100px 0;
    background-color: var(--dark-secondary);
}

.service-card {
    background: linear-gradient(145deg, #1a1a1a, #0f0f0f);
    border-radius: 20px;
    padding: 3rem 2rem;
    text-align: center;
    transition: var(--transition);
    height: 100%;
    border: 1px solid rgba(249, 115, 22, 0.1);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top left, rgba(249, 115, 22, 0.1), transparent 50%);
    opacity: 0;
    transition: var(--transition);
}

.service-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary-orange);
    box-shadow: 0 20px 40px rgba(249, 115, 22, 0.2);
}

.service-card:hover::before {
    opacity: 1;
}

.service-icon {
    font-size: 3rem;
    color: var(--primary-orange);
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.service-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.service-card p {
    color: var(--text-gray);
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.service-features {
    list-style: none;
    text-align: left;
    position: relative;
    z-index: 1;
}

.service-features li {
    color: var(--text-gray-light);
    font-size: 0.9rem;
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.service-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary-orange);
}

/* ===================================
   PORTFOLIO SECTION
=================================== */
.portfolio {
    padding: 100px 0;
    background-color: var(--dark-bg);
    position: relative;
    overflow: hidden;
}

.filter-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filter-btn {
    background-color: transparent;
    border: 1px solid var(--primary-orange);
    color: var(--text-gray);
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.filter-btn:hover,
.filter-btn.active {
    background-color: var(--primary-orange);
    color: var(--text-light);
}

.portfolio-container {
    position: relative;
    height: auto;
    overflow: hidden;
    margin: 0 -15px;
    padding: 2rem 0;
}

.portfolio-wrapper {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    align-items: center;
    padding: 0 50px;
    gap: 30px;
}

.portfolio-item {
    flex: 0 0 auto;
    width: 600px;
    max-width: 90vw;
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    opacity: 0;
    animation: fadeInUp 0.6s forwards;
    background-color: var(--dark-secondary);
    /* Manteniamo l'aspect ratio 16:9 per le immagini 1920x1080 */
    aspect-ratio: 16 / 9;
}

.portfolio-item.hidden {
    display: none;
}

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

.portfolio-item:hover {
    transform: scale(1.05);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.portfolio-item img {
    width: 100%; 
    height: 320px;
    object-fit: cover; 
    transition: var(--transition);
    background-color: var(--dark-secondary);
}

.portfolio-item:hover img {
    transform: scale(1.05);
}

.portfolio-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.7) 50%, transparent 100%);
    padding: 2rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.portfolio-item:hover .portfolio-overlay {
    transform: translateY(0);
}

.portfolio-title {
    font-family: 'Exo 2', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.portfolio-tech {
    color: var(--primary-orange);
    font-family: 'Roboto Mono', monospace;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.portfolio-type {
    display: inline-block;
    background-color: rgba(249, 115, 22, 0.2);
    color: var(--primary-orange);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    margin-bottom: 1rem;
}

.portfolio-link {
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    transition: var(--transition);
}

.portfolio-link:hover {
    color: var(--primary-orange);
}

.collaboration-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background-color: rgba(249, 115, 22, 0.9);
    color: var(--text-light);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Scroll Indicators */
.scroll-indicator {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    color: var(--primary-orange);
    cursor: pointer;
    z-index: 10;
    background: rgba(26, 26, 26, 0.9);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
    border: 2px solid rgba(249, 115, 22, 0.3);
}

.scroll-indicator:hover {
    background: var(--primary-orange);
    color: var(--text-light);
    border-color: var(--primary-orange);
}

.scroll-left {
    left: 20px;
}

.scroll-right {
    right: 20px;
}

/* ===================================
   ABOUT SECTION
=================================== */
.about {
    padding: 100px 0;
    background-color: var(--dark-secondary);
}

.about-content {
    margin-bottom: 2rem;
}

.about-content .lead {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-weight: 500;
}

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

.skill-item {
    text-align: center;
    padding: 1.5rem;
    background-color: var(--dark-bg);
    border-radius: 15px;
    transition: var(--transition);
    border: 1px solid transparent;
}

.skill-item:hover {
    border-color: var(--primary-orange);
    transform: translateY(-5px);
}

.skill-item i {
    font-size: 2.5rem;
    color: var(--primary-orange);
    margin-bottom: 0.5rem;
    display: block;
}

.skill-item span {
    font-size: 0.9rem;
    color: var(--text-gray);
}

.collaboration-info {
    background-color: var(--dark-bg);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid rgba(249, 115, 22, 0.2);
}

.collaboration-info h3 {
    color: var(--primary-orange);
    margin-bottom: 1rem;
}

.collaboration-stats {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
}

.collab-stat {
    text-align: center;
    flex: 1;
}

.collab-stat i {
    font-size: 2rem;
    color: var(--primary-orange);
    margin-bottom: 0.5rem;
    display: block;
}

.collab-stat h4 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.collab-stat p {
    color: var(--text-gray);
    font-size: 0.9rem;
}

/* ===================================
   CONTACT SECTION
=================================== */
.contact {
    padding: 100px 0;
    background-color: var(--dark-bg);
}

.contact-info h3 {
    color: var(--primary-orange);
    margin-bottom: 1rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: var(--dark-secondary);
    border-radius: 15px;
    transition: var(--transition);
}

.contact-item:hover {
    transform: translateX(10px);
}

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

.contact-item h4 {
    font-size: 1rem;
    color: var(--text-gray);
    margin-bottom: 0.25rem;
}

.contact-item p {
    margin: 0;
    color: var(--text-light);
}

.contact-form {
    background-color: var(--dark-secondary);
    padding: 2rem;
    border-radius: 20px;
}

.form-control,
.form-select {
    background-color: var(--dark-bg);
    border: 1px solid rgba(249, 115, 22, 0.2);
    color: var(--text-light);
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 10px;
    transition: var(--transition);
    width: 100%;
}

.form-control:focus,
.form-select:focus {
    background-color: var(--dark-bg);
    border-color: var(--primary-orange);
    color: var(--text-light);
    box-shadow: 0 0 0 0.2rem rgba(249, 115, 22, 0.25);
    outline: none;
}

.form-control::placeholder {
    color: var(--text-gray);
}

.form-select option {
    background-color: var(--dark-bg);
    color: var(--text-light);
}

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

/* ===================================
   FOOTER
=================================== */
footer {
    background-color: var(--dark-secondary);
    padding: 3rem 0 1rem;
    text-align: center;
    border-top: 1px solid rgba(249, 115, 22, 0.2);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.footer-logo svg {
    height: 40px;
    width: auto;
}

.social-links {
    display: flex;
    gap: 1.5rem;
}

.social-links a {
    color: var(--text-gray);
    font-size: 1.5rem;
    transition: var(--transition);
}

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

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    color: var(--text-gray);
    font-size: 0.9rem;
    margin: 0;
}

/* ===================================
   BACK TO TOP
=================================== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--primary-orange);
    color: var(--text-light);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: var(--secondary-orange);
    transform: translateY(-5px);
}

/* ===================================
   RESPONSIVE
=================================== */
@media (max-width: 1200px) {
    .portfolio-item {
        min-width: 400px;
    }
}

@media (max-width: 992px) {
    .hero h1 {
        font-size: 3.5rem;
    }
    
    .stats-row {
        gap: 2rem;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .navbar-nav {
        text-align: center;
        padding: 1rem 0;
    }
    
    .nav-link {
        margin: 0.5rem 0;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero .subtitle {
        font-size: 1rem;
    }
    
    .stats-row {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .code-window {
        font-size: 0.8rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .portfolio-item {
        min-width: 300px;
        margin-right: 20px;
    }
    
    .filter-buttons {
        padding: 0 1rem;
    }
    
    .filter-btn {
        font-size: 0.9rem;
        padding: 0.4rem 1rem;
    }
    
    .collaboration-stats {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .contact-form {
        padding: 1.5rem;
    }
    
    .btn {
        padding: 0.8rem 2rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .hero {
        padding-top: 60px;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .portfolio-container {
        height: 380px !important;
    }
    
    .portfolio-item {
        min-width: 280px;
        height: 320px;
    } 
    .portfolio-title {
        font-size: 1.2rem;
    }
    
    .portfolio-tech {
        font-size: 0.8rem;
    }
    
    .skills-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
    
    .skill-item {
        padding: 1rem;
    }
    
    .skill-item i {
        font-size: 2rem;
    }
}