/* Import base styles */
@import url('styles.css');

/* Portfolio Hero Section */
.portfolio-hero {
    height: 50vh;
    min-height: 350px;
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('../images/hero-portfolio.jpg');
    background-size: cover;
    background-position: center;
}

.portfolio-hero .hero-content {
    text-align: left;
    max-width: 600px;
    margin: 0;
    padding-left: 80px;
}

.portfolio-hero h1 {
    font-size: 42px;
    margin-bottom: 20px;
    text-align: left;
    margin-left: 0;
}

.portfolio-hero p {
    font-size: 15px;
    line-height: 1.7;
    text-align: left;
    margin-left: 0;
    font-style: italic;
}

/* Category Filters */
.category-filters {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 50px 20px 40px;
    flex-wrap: wrap;
    max-width: 800px;
    margin: 0 auto;
}

.filter-btn {
    padding: 10px 25px;
    border: 2px solid #333;
    background: white;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.filter-btn:hover {
    background: #f3f4f6;
}

.filter-btn.active {
    background: #ff0000;
    color: white;
    border-color: #ff0000;
}

/* Portfolio Section */
.portfolio-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 20px 80px;
}

/* Portfolio Grid */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

/* Project Card */
.project-card {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    aspect-ratio: 4/3;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.project-card.hidden {
    display: none;
}

.project-image {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

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

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

.project-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 60px 20px 20px;
    color: white;
    transition: background 0.3s ease;
}

.project-card:hover .project-overlay {
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
}

.project-overlay h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.project-category {
    font-size: 13px;
    opacity: 0.9;
    font-weight: 400;
}

/* Project Modal/Lightbox */
.project-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    overflow-y: auto;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 1000px;
    padding: 20px;
    margin: 20px;
}

.modal-close {
    position: absolute;
    top: -10px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 40px;
    cursor: pointer;
    z-index: 10001;
    transition: color 0.3s, transform 0.3s;
    line-height: 1;
}

.modal-close:hover {
    color: #ff0000;
    transform: rotate(90deg);
}

.modal-header {
    text-align: center;
    margin-bottom: 20px;
    color: white;
}

.modal-header h2 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}

.modal-category {
    font-size: 14px;
    color: #ff0000;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Gallery Container */
.modal-gallery {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.gallery-container {
    width: 100%;
    max-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 8px;
}

.gallery-image {
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain;
    border-radius: 8px;
    transition: opacity 0.3s ease;
}

.gallery-image.loading {
    opacity: 0.5;
}

/* Gallery Navigation */
.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 24px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.gallery-nav:hover {
    background: #ff0000;
}

.gallery-nav.prev {
    left: -70px;
}

.gallery-nav.next {
    right: -70px;
}

/* Gallery Thumbnails */
.gallery-thumbnails {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.gallery-thumbnail {
    width: 80px;
    height: 60px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.3s, transform 0.3s, border 0.3s;
    border: 2px solid transparent;
}

.gallery-thumbnail:hover {
    opacity: 0.8;
}

.gallery-thumbnail.active {
    opacity: 1;
    border-color: #ff0000;
    transform: scale(1.05);
}

.gallery-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Gallery Counter */
.gallery-counter {
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

/* Portfolio CTA Section */
.portfolio-cta {
    height: 50vh;
    min-height: 350px;
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('../images/sunset.jpg');
    background-size: cover;
    background-position: center;
}

.portfolio-cta .final-cta-content {
    text-align: center;
}

.cta-subtitle {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 10px;
    color: #ff0000;
}

.portfolio-cta h2 {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 25px;
    font-style: italic;
}

/* Active nav link */
.nav-links a.active {
    color: #ff0000;
    font-weight: 600;
}

/* Scroll Animation for Cards */
.project-card {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease forwards;
}

.project-card:nth-child(1) { animation-delay: 0.1s; }
.project-card:nth-child(2) { animation-delay: 0.2s; }
.project-card:nth-child(3) { animation-delay: 0.3s; }
.project-card:nth-child(4) { animation-delay: 0.4s; }
.project-card:nth-child(5) { animation-delay: 0.5s; }
.project-card:nth-child(6) { animation-delay: 0.6s; }
.project-card:nth-child(7) { animation-delay: 0.7s; }
.project-card:nth-child(8) { animation-delay: 0.8s; }
.project-card:nth-child(9) { animation-delay: 0.9s; }
.project-card:nth-child(10) { animation-delay: 1.0s; }
.project-card:nth-child(11) { animation-delay: 1.1s; }
.project-card:nth-child(12) { animation-delay: 1.2s; }

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

/* Filter Animation */
.project-card.filtering {
    animation: filterOut 0.3s ease forwards;
}

.project-card.filtering-in {
    animation: filterIn 0.3s ease forwards;
}

@keyframes filterOut {
    to {
        opacity: 0;
        transform: scale(0.8);
    }
}

@keyframes filterIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive Design */
@media (max-width: 1100px) {
    .gallery-nav.prev {
        left: 10px;
    }

    .gallery-nav.next {
        right: 10px;
    }

    .gallery-nav {
        background: rgba(0, 0, 0, 0.5);
    }
}

@media (max-width: 900px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .portfolio-hero {
        height: 45vh;
        min-height: 300px;
    }

    .portfolio-hero .hero-content {
        padding-left: 20px;
        padding-right: 20px;
    }

    .portfolio-hero h1 {
        font-size: 32px;
    }

    .portfolio-hero p {
        font-size: 14px;
    }

    .category-filters {
        gap: 10px;
        padding: 30px 15px;
    }

    .filter-btn {
        padding: 8px 18px;
        font-size: 13px;
    }

    .portfolio-section {
        padding: 20px 15px 60px;
    }

    .project-overlay h3 {
        font-size: 16px;
    }

    .project-category {
        font-size: 12px;
    }

    .modal-content {
        padding: 15px;
        margin: 10px;
    }

    .modal-header h2 {
        font-size: 24px;
    }

    .modal-close {
        top: -5px;
        right: 5px;
        font-size: 32px;
    }

    .gallery-nav {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .gallery-thumbnail {
        width: 60px;
        height: 45px;
    }

    .portfolio-cta h2 {
        font-size: 32px;
    }

    /* Nav fixes */
    .nav-links {
        display: none;
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        width: 100%;
        background: rgba(0, 0, 0, 0.95);
        flex-direction: column;
        padding: 20px;
        margin: 0;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
        z-index: 999;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links li {
        width: 100%;
        text-align: center;
        padding: 10px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-links li:last-child {
        border-bottom: none;
    }

    .nav-links a {
        display: block;
        font-size: 16px;
        padding: 10px;
    }

    .mobile-menu-btn {
        display: block;
    }

    .call-button.desktop-call {
        display: none;
    }

    .footer-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 40px;
    }

    .footer-sections {
        flex-direction: column;
        gap: 30px;
    }
}

@media (max-width: 600px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .project-card {
        aspect-ratio: 16/10;
    }
}

@media (max-width: 480px) {
    .portfolio-hero h1 {
        font-size: 28px;
    }

    .portfolio-hero p {
        font-size: 13px;
    }

    .filter-btn {
        padding: 8px 15px;
        font-size: 12px;
    }

    .modal-header h2 {
        font-size: 20px;
    }

    .gallery-container {
        max-height: 50vh;
    }

    .gallery-image {
        max-height: 50vh;
    }

    .gallery-thumbnails {
        gap: 6px;
    }

    .gallery-thumbnail {
        width: 50px;
        height: 38px;
    }

    .portfolio-cta h2 {
        font-size: 26px;
    }
}