/* ========================================
   PROJECTS PAGE - Styles
   ======================================== */

/* ========================================
   FILTER SECTION
   ======================================== */
.filter-section {
    padding: 60px 0 40px;
    background: var(--bg-white);
}

.filter-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-dark);
    background: var(--bg-light);
    border: 2px solid transparent;
    transition: all var(--transition-speed) var(--transition-smooth);
    cursor: pointer;
}

.filter-btn:hover {
    background: var(--bg-white);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.filter-btn.active {
    background: var(--primary-color);
    color: var(--text-white);
    border-color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(240, 85, 19, 0.3);
}

/* ========================================
   PROJECTS GRID SECTION
   ======================================== */
.projects-grid-section {
    padding: 40px 0 var(--section-padding);
}

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

.project-card {
    opacity: 1;
    transform: scale(1) translateY(0);
    transition: opacity 0.4s var(--transition-smooth), transform 0.4s var(--transition-smooth), height 0.4s var(--transition-smooth), padding 0.4s var(--transition-smooth), margin 0.4s var(--transition-smooth);
    overflow: hidden;
    height: auto; /* O un valore specifico se necessario */
}

.project-card.hidden {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
    height: 0;
    margin: 0;
    padding: 0;
}

.project-link {
    display: block;
}

.project-image {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-speed) var(--transition-smooth);
    padding-bottom: 75%;
}

.project-card:hover .project-image {
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
}

.project-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--transition-smooth);
}

.project-card:hover .project-image img {
    transform: scale(1.1);
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(26, 26, 26, 0.95) 0%, rgba(26, 26, 26, 0.3) 50%, transparent 100%);
    display: flex;
    align-items: flex-end;
    padding: 30px;
    opacity: 0;
    transition: all var(--transition-speed) var(--transition-smooth);
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.project-info {
    color: var(--text-white);
    transform: translateY(20px);
    transition: transform var(--transition-speed) var(--transition-smooth);
}

.project-card:hover .project-info {
    transform: translateY(0);
}

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

.project-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.project-location {
    font-size: 14px;
    opacity: 0.9;
}

/* ========================================
   BEFORE/AFTER SECTION
   ======================================== */
.before-after-section {
    padding: var(--section-padding) 0;
    background: var(--bg-light);
}

.before-after-slider {
    margin-top: 60px;
}

.slider-project-name {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 25px;
    color: var(--text-dark);
    text-align: center;
}

.ba-slider-container {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 15px;
    box-shadow: var(--shadow-lg);
    cursor: ew-resize;
    user-select: none;
}

.ba-image-container {
    position: relative;
    width: 100%;
    padding-bottom: 60%;
}

.ba-image-after {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ba-image-before {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    overflow: hidden;
    z-index: 2;
}

.ba-image-before img {
    width: 100vw; /* Usa la larghezza della viewport per evitare che l'immagine si ridimensioni */
    height: 100%;
    object-fit: cover;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    max-width: none; /* Assicura che l'immagine possa superare la larghezza del suo contenitore */
}

.ba-slider-handle {
    position: absolute;
    top: 0;
    left: 50%;
    width: 4px;
    height: 100%;
    background: var(--text-white);
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ba-slider-line {
    flex: 1;
    width: 4px;
    background: var(--text-white);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.ba-slider-button {
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    border: 4px solid var(--text-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    position: relative;
    cursor: ew-resize;
}

.ba-arrow-left,
.ba-arrow-right {
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
}

.ba-arrow-left {
    left: 12px;
    border-width: 6px 8px 6px 0;
    border-color: transparent var(--text-white) transparent transparent;
}

.ba-arrow-right {
    right: 12px;
    border-width: 6px 0 6px 8px;
    border-color: transparent transparent transparent var(--text-white);
}

.ba-labels {
    position: absolute;
    top: 20px;
    left: 0;
    width: 100%;
    z-index: 4;
    display: flex;
    justify-content: space-between;
    padding: 0 30px;
    pointer-events: none;
}

.ba-label-before,
.ba-label-after {
    padding: 8px 20px;
    background: rgba(26, 26, 26, 0.8);
    color: var(--text-white);
    border-radius: 25px;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    backdrop-filter: blur(5px);
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    .filter-buttons {
        gap: 10px;
    }

    .filter-btn {
        padding: 10px 20px;
        font-size: 13px;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .ba-slider-button {
        width: 40px;
        height: 40px;
    }

    .ba-arrow-left {
        left: 10px;
        border-width: 5px 6px 5px 0;
    }

    .ba-arrow-right {
        right: 10px;
        border-width: 5px 0 5px 6px;
    }

    .ba-labels {
        padding: 0 15px;
    }

    .ba-label-before,
    .ba-label-after {
        padding: 6px 15px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .project-overlay {
        padding: 20px;
    }

    .project-title {
        font-size: 1.25rem;
    }

    .slider-project-name {
        font-size: 1.25rem;
    }
}

/* ========================================
   PROJECT MODAL STYLES
   ======================================== */
.project-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: #fff;
    margin: 3% auto;
    max-width: 1000px;
    border-radius: 15px;
    position: relative;
    animation: slideIn 0.4s ease-out;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    color: #fff;
    background: #f05513;
    position: absolute;
    top: -15px;
    right: -15px;
    font-size: 32px;
    font-weight: bold;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10001;
    box-shadow: 0 4px 15px rgba(240, 85, 19, 0.4);
}

.modal-close:hover,
.modal-close:focus {
    background: #d04510;
    transform: rotate(90deg);
}

.modal-body {
    padding: 40px;
}

.modal-header {
    margin-bottom: 30px;
    border-bottom: 2px solid #f05513;
    padding-bottom: 20px;
}

.modal-timeline {
    display: inline-block;
    background: #f05513;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.modal-title {
    font-size: 2.5rem;
    color: #1a1a1a;
    margin: 10px 0;
    font-weight: 700;
}

.modal-location {
    color: #666;
    font-size: 1.1rem;
    margin: 5px 0;
}

.modal-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 30px;
}

.modal-image {
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.modal-details {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-description {
    color: #444;
    line-height: 1.8;
    font-size: 1rem;
}

.modal-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #f05513;
}

.modal-detail-item {
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
    font-size: 0.95rem;
}

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

.modal-detail-item strong {
    color: #f05513;
    margin-right: 8px;
}

.modal-features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.modal-features li {
    padding: 10px 0;
    padding-left: 25px;
    position: relative;
    color: #444;
    line-height: 1.6;
}

.modal-features li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #f05513;
    font-weight: bold;
    font-size: 1.2rem;
}

.clickable-project {
    cursor: pointer;
    transition: transform 0.3s ease;
}

.clickable-project:hover {
    transform: translateY(-5px);
}

@media (max-width: 768px) {
    .modal-content {
        margin: 5% 10px;
        max-width: 95%;
    }

    .modal-body {
        padding: 20px;
    }

    .modal-main {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .modal-title {
        font-size: 1.8rem;
    }

    .modal-close {
        top: -10px;
        right: -10px;
        width: 40px;
        height: 40px;
        font-size: 28px;
    }
}

/* ========================================
   PROJECTS SECTION HEADERS
   ======================================== */
.projects-section-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 60px;
    padding: 0 20px;
}

.projects-section-header .section-label {
    display: inline-block;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 15px;
    padding: 8px 20px;
    border-radius: 50px;
    background: linear-gradient(135deg, rgba(240, 85, 19, 0.1) 0%, rgba(240, 85, 19, 0.05) 100%);
}

.projects-section-header .section-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 20px;
    line-height: 1.2;
}

.projects-section-header .section-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 700px;
    margin: 0 auto;
}

/* Portfolio Header - Special styling */
.projects-section-header.portfolio-header {
    margin-top: 40px;
}

.projects-section-header.portfolio-header .section-label {
    background: linear-gradient(135deg, rgba(52, 73, 94, 0.1) 0%, rgba(52, 73, 94, 0.05) 100%);
    color: var(--text-dark);
}

/* ========================================
   PORTFOLIO DIVIDER
   ======================================== */
.portfolio-divider {
    margin: 80px auto;
    max-width: 1200px;
    position: relative;
}

.divider-line {
    height: 2px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        var(--primary-color) 20%,
        var(--primary-color) 80%,
        transparent 100%
    );
    position: relative;
}

.divider-line::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: var(--bg-white);
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    box-shadow: 0 0 0 10px var(--bg-white);
}

.divider-line::after {
    content: '◆';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--primary-color);
    font-size: 20px;
    z-index: 1;
}

/* ========================================
   PORTFOLIO GRID - Special styling
   ======================================== */
.portfolio-grid {
    /* Stessi stili della grid normale, ma possiamo personalizzare se necessario */
}

.portfolio-grid .project-card {
    /* Badge distintivo per progetti portfolio */
    position: relative;
}

.portfolio-grid .clickable-project::before {
    content: '⊕';
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: rgba(240, 85, 19, 0.95);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    z-index: 10;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(240, 85, 19, 0.3);
}

.portfolio-grid .clickable-project:hover::before {
    opacity: 1;
    transform: scale(1);
}

/* Responsive */
@media (max-width: 768px) {
    .projects-section-header .section-title {
        font-size: 2rem;
    }

    .projects-section-header .section-subtitle {
        font-size: 1rem;
    }

    .portfolio-divider {
        margin: 60px auto;
    }

    .divider-line::before {
        width: 50px;
        height: 50px;
    }

    .divider-line::after {
        font-size: 16px;
    }
}

/* ========================================
   PROGETTI REALI PAGE SPECIFIC STYLES
   ======================================== */
.real-projects {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    padding: 80px 0;
}

.projects-intro {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 60px;
}

.projects-intro h1 {
    font-family: 'Playfair Display', serif;
    font-size: 3.5rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 20px;
}

.projects-intro p {
    font-size: 1.2rem;
    color: #666;
    line-height: 1.7;
}

.real-projects .project-category {
    margin: 80px 0;
    display: block; /* Override previous inline-block if needed */
    padding: 0;
    background: none;
    border-radius: 0;
}

.category-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    color: #f05513;
    text-align: center;
    margin-bottom: 50px;
    position: relative;
}

.category-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, #f05513, #ff8547);
    border-radius: 2px;
}

/* Specific Project Card Styles for Real Projects */
.real-projects .project-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    margin-bottom: 40px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: auto; 
    opacity: 1;
    transform: none;
}

.real-projects .project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.real-projects .project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 40px;
    margin-bottom: 60px;
}

.real-projects .project-image {
    height: 250px;
    overflow: hidden;
    position: relative;
    padding-bottom: 0;
}

.real-projects .project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    position: relative;
}

.real-projects .project-card:hover .project-image img {
    transform: scale(1.05);
}

.project-status {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(240, 85, 19, 0.9);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.project-status.completed {
    background: rgba(46, 184, 92, 0.9);
}

.project-content {
    padding: 30px;
}

.real-projects .project-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 10px;
}

.real-projects .project-location {
    color: #f05513;
    font-weight: 500;
    margin-bottom: 15px;
    opacity: 1;
    font-size: 1rem;
}

.project-description {
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
}

.project-details {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.project-detail {
    background: #f8f9fa;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #555;
}

.project-detail strong {
    color: #1a1a1a;
}

.project-features {
    list-style: none;
    padding: 0;
    margin: 20px 0 0 0;
}

.project-features li {
    padding: 5px 0;
    color: #666;
    position: relative;
    padding-left: 20px;
}

.project-features li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: #f05513;
    font-weight: bold;
}

.large-project-card {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    align-items: center;
}

.large-project-image {
    height: 400px !important;
}

.large-project-content {
    padding: 50px;
}

@media (max-width: 768px) {
    .large-project-card {
        grid-template-columns: 1fr;
    }
    
    .large-project-content {
        padding: 30px;
    }
    
    .projects-intro h1 {
        font-size: 2.5rem;
    }
    
    .category-title {
        font-size: 2rem;
    }
}

.timeline-badge {
    display: inline-block;
    background: linear-gradient(135deg, #f05513, #ff8547);
    color: white;
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 15px;
}

/* CTA Section specific */
.section-cta {
    text-align: center;
    margin-top: 80px;
    padding: 0 20px;
}
.section-cta h2 {
    font-family: 'Playfair Display', serif;
    margin-bottom: 20px;
}
.section-cta p {
    color: #666;
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}
.section-cta .btn {
    padding: 15px 40px;
    font-size: 1.1rem;
}
