/* ========================================
   PROJECT DETAIL PAGES - Main Styles
   ======================================== */

:root {
    --primary-color: #f05513;
    --dark-color: #1a1a1a;
    --light-gray: #f4f4f4;
    --text-color: #666;
    --white-color: #fff;
    --font-primary: 'Playfair Display', serif;
    --font-secondary: 'Inter', sans-serif;
    --transition-speed: 0.4s;
    --transition-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Basic Reset & Typography */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-secondary);
    background-color: var(--white-color);
    color: var(--text-color);
    line-height: 1.7;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    color: var(--dark-color);
    font-weight: 700;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color var(--transition-speed) ease;
}

a:hover {
    color: var(--dark-color);
}

p {
    margin-bottom: 1rem;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader {
    border: 5px solid var(--light-gray);
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

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

/* Language Selector */
.language-selector {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001; /* Ensure it's above the navbar */
}

.lang-current-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--white-color);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    font-weight: 600;
    font-size: 14px;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed) var(--transition-smooth);
    border: none;
    cursor: pointer;
}

.lang-current-btn:hover {
    transform: scale(1.05);
}

.lang-options {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: var(--white-color);
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.16);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--transition-speed) var(--transition-smooth);
}

.language-selector.open .lang-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    text-align: left;
    border: none;
    cursor: pointer;
}

.lang-option:hover {
    background: var(--light-gray);
}

.lang-option.active {
    background: var(--primary-color);
    color: var(--white-color);
    font-weight: 600;
}

/* Navigation */
.project-navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    min-height: 70px;
    padding: 15px 0;
    display: flex;
    align-items: center;
}

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

.navbar-brand {
    display: flex;
    align-items: center;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--dark-color);
    gap: 10px;
}

.navbar-brand img {
    height: 40px;
}

.navbar-back {
    font-weight: 600;
    display: flex;
    align-items: center;
}

.navbar-back span:first-child {
    margin-right: 8px;
    font-size: 1.2rem;
}

/* Hero Section */
.project-hero {
    position: relative;
    height: 70vh;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white-color);
    margin-top: 70px; /* Navbar height */
}

.project-hero-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.2) 100%);
}

.project-hero-content {
    position: relative;
    z-index: 2;
    padding: 20px;
}

.project-category {
    display: inline-block;
    padding: 5px 15px;
    background: var(--primary-color);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

.project-hero-title {
    font-size: 3.5rem;
    color: var(--white-color);
    margin-bottom: 10px;
}

.project-hero-location {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Section Styling */
.project-info-section, .project-gallery, .project-features, .project-cta {
    padding: 80px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Project Info Section */
.project-info-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 60px;
}

.project-description h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.project-details h3 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    display: inline-block;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #e0e0e0;
    font-size: 0.95rem;
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 600;
    color: var(--dark-color);
}

/* Gallery Section */
.project-gallery {
    background-color: var(--light-gray);
}

.gallery-header {
    text-align: center;
    margin-bottom: 50px;
}

.gallery-header h2 {
    font-size: 2.5rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    cursor: pointer;
    min-height: 250px; /* Previene il collasso durante il caricamento */
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s var(--transition-smooth);
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.zoom-icon {
    font-size: 2rem;
    color: var(--white-color);
}

/* Features Section */
.features-header {
    text-align: center;
    margin-bottom: 50px;
}

.features-header h2 {
    font-size: 2.5rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.feature-card {
    text-align: center;
    padding: 30px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    transition: all 0.4s ease;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    border-color: transparent;
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.feature-card h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
}

/* CTA Section */
.project-cta {
    background-color: var(--dark-color);
    color: var(--white-color);
    text-align: center;
}

.cta-content h2 {
    font-size: 2.5rem;
    color: var(--white-color);
    margin-bottom: 15px;
}

.cta-buttons {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 15px 35px;
    border-radius: 50px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.4s ease;
    border: 2px solid transparent;
}

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

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

.btn-outline {
    background-color: transparent;
    color: var(--white-color);
    border-color: var(--white-color);
}

.btn-outline:hover {
    background-color: var(--white-color);
    color: var(--dark-color);
}

/* Reveal on Scroll */
[data-reveal] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

[data-reveal].revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 992px) {
    .project-info-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

@media (max-width: 768px) {
    .project-hero {
        height: 50vh;
    }
    .project-hero-title {
        font-size: 2.5rem;
    }
    .project-description h2, .gallery-header h2, .features-header h2, .cta-content h2 {
        font-size: 2rem;
    }
    .project-info-section, .project-gallery, .project-features, .project-cta {
        padding: 60px 20px;
    }
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .navbar-brand span {
        display: none;
    }
    .navbar-brand img {
        height: 35px;
        margin-right: 0;
    }
    .project-hero-title {
        font-size: 2rem;
    }
}