/* 
* Projects Page CSS for Josh Wallace Portfolio
* Styles specific to the projects/portfolio display
* Updated to place captions above images and include demo buttons
*/

/* === PROJECTS PAGE === */
.projects-page {
    background-color: var(--body-bg);
}

.projects-header {
    max-width: 1200px;
    margin: 2rem auto 1rem;
    padding: 0 5%;
}

.projects-page .projects-header h2 {
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.projects-header p {
    color: var(--text-dark);
    max-width: 800px;
}

.projects-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 5%;
}

.project-item {
    margin-bottom: 3rem;
    background-color: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: none;
}

/* Project Header with Demo Button */
.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1.5rem 0.5rem;
    /* Reduced bottom padding */
    border: none;
}

.projects-page .project-header h2 {
    margin-bottom: 0;
    color: var(--text-dark);
}

.project-header h2:after {
    display: none;
}

/* Demo Button Styles */
.demo-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--accent-green, #1abc9c);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.demo-button:hover {
    background-color: var(--accent-green-dark, #16a085);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.demo-button i {
    font-size: 1rem;
}

.project-content {
    padding: 1rem 1.5rem 1.5rem;
    /* Reduced top padding */
    border-top: 1px solid #eee;
    /* Single horizontal rule */
}

.project-description {
    margin-bottom: 2rem;
    color: var(--text-dark);
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-top: 1.2rem;
}

.tech-tag {
    background-color: rgba(26, 188, 156, 0.1);
    color: var(--accent-green);
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
}

.project-gallery {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

/* Updated gallery item structure to place captions above images */
.gallery-item {
    display: flex;
    flex-direction: column;
}

/* Force caption to appear above image regardless of HTML order */
.image-caption {
    order: -1;
    /* Negative order pushes to the top */
    font-size: 0.9rem;
    color: var(--text-dark);
    margin-bottom: 0.4rem;
    /* Space between caption and image */
    margin-top: 0;
    /* Remove any top margin */
    text-align: left;
    font-weight: 500;
}

.project-image {
    order: 2;
    width: 100%;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    height: 250px;
    margin-top: 0;
    /* Remove any top margin */
}

.project-image:hover {
    transform: scale(1.02);
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* === GIF CONTROLS === */
.gif-container {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.gif-container::before {
    content: "\f04b";
    /* Play icon */
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    z-index: 10;
    pointer-events: none;
    transition: all 0.3s ease;
}

.gif-container.playing::before {
    content: "\f04c";
    /* Pause icon */
    opacity: 0;
}

.gif-container:hover::before {
    opacity: 1 !important;
    background-color: rgba(0, 0, 0, 0.7);
}

.static-image {
    display: block;
    /* Shown by default */
}

.gif-image {
    display: none;
    /* Hidden by default */
}

.gif-container.playing .static-image {
    display: none;
    /* Hide static image when playing */
}

.gif-container.playing .gif-image {
    display: block;
    /* Show GIF when playing */
}

/* === HORIZONTAL SCROLLING GALLERY === */
.design-category {
    margin-bottom: 2.5rem;
}

.projects-page .design-category h3 {
    color: var(--text-dark);
    margin-bottom: 1rem;
    position: relative;
    padding-bottom: 0.5rem;
    font-size: 1.4rem;
}

.design-category h3:after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 3px;
    background-color: var(--accent-green);
}

.horizontal-scroll-gallery {
    display: flex;
    overflow-x: auto;
    padding-bottom: 15px;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    gap: 1.5rem;
}

.horizontal-scroll-gallery::-webkit-scrollbar {
    height: 8px;
}

.horizontal-scroll-gallery::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.horizontal-scroll-gallery::-webkit-scrollbar-thumb {
    background: var(--accent-green-light);
    border-radius: 10px;
}

.horizontal-scroll-gallery::-webkit-scrollbar-thumb:hover {
    background: var(--accent-green);
}

/* Ensure horizontal scroll gallery items also have captions above images */
.horizontal-scroll-gallery .gallery-item {
    flex: 0 0 auto;
    width: 280px;
    max-width: 280px;
    flex-direction: column;
}

.horizontal-scroll-gallery .image-caption {
    order: -1;
}

.horizontal-scroll-gallery .project-image {
    order: 2;
    height: 180px;
}

/* === PROJECT ITEM ANIMATIONS === */
.project-item {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.project-item.appear {
    opacity: 1;
    transform: translateY(0);
}

.project-item:nth-child(2) {
    transition-delay: 0.1s;
}

.project-item:nth-child(3) {
    transition-delay: 0.2s;
}

.project-item:nth-child(4) {
    transition-delay: 0.3s;
}

.project-item:nth-child(5) {
    transition-delay: 0.4s;
}

/* === RESPONSIVE DESIGN FOR PROJECTS === */
@media (max-width: 992px) {
    .project-gallery {
        grid-template-columns: 1fr;
    }

    .project-image {
        height: 300px;
        /* Larger on single column */
    }
}

@media (max-width: 768px) {
    .horizontal-scroll-gallery .gallery-item {
        width: 85%;
    }

    .horizontal-scroll-gallery .project-image {
        height: 220px;
    }

    .design-category h3:after {
        left: 50%;
        transform: translateX(-50%);
    }

    .design-category h3 {
        text-align: center;
    }

    .tech-stack {
        justify-content: center;
    }

    .image-caption {
        margin-bottom: 0.3rem;
        /* Slightly tighter on mobile */
        font-size: 0.85rem;
        text-align: left;
        /* Keep alignment consistent on mobile */
    }
}

@media (max-width: 576px) {
    .project-image {
        height: 220px;
    }

    .tech-tag {
        font-size: 0.75rem;
    }
}


/* Add to projects.css */

.featured-images {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.additional-images {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.additional-images h4 {
    color: var(--text-dark);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

/* Update existing horizontal-scroll-gallery styles */
.horizontal-scroll-gallery {
    display: flex;
    overflow-x: auto;
    padding-bottom: 15px;
    gap: 1.5rem;
    scroll-behavior: smooth;
}

.horizontal-scroll-gallery .gallery-item {
    flex: 0 0 280px;
    max-width: 280px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .featured-images {
        grid-template-columns: 1fr;
    }
}


/* Modal Image Viewer CSS */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    overflow: hidden;
    border-radius: 4px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.modal-image {
    display: block;
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.modal-close:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.modal-close:before,
.modal-close:after {
    content: '';
    position: absolute;
    width: 20px;
    height: 2px;
    background-color: white;
}

.modal-close:before {
    transform: rotate(45deg);
}

.modal-close:after {
    transform: rotate(-45deg);
}

/* For the modal view, keep the caption visible */
.modal-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 15px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 14px;
    text-align: center;
    transform: translateY(0);
    /* Always visible */
    transition: transform 0.3s ease;
}

/* Enhanced styling for project images to indicate they're clickable */
.project-image {
    cursor: zoom-in;
    position: relative;
}

.project-image:after {
    content: '\f00e';
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-image:hover:after {
    opacity: 1;
}

/* Mobile-specific adjustments */
@media (max-width: 768px) {
    .modal-content {
        max-width: 95%;
    }

    .modal-close {
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
    }

    .modal-caption {
        padding: 10px;
        font-size: 12px;
    }

    .project-image:after {
        opacity: 1;
        width: 25px;
        height: 25px;
        font-size: 10px;
    }
}

/* 
* Animation updates for projects page
* Should be added to projects.css
*/

/* === IMPROVED PROJECT ITEM ANIMATIONS === */
.project-item {
    opacity: 0;
    transform: translateY(15px);
    /* Reduced from 20px for subtler movement */
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
    /* Slightly faster transition */
}

.project-item.appear {
    opacity: 1;
    transform: translateY(0);
}

/* Adjusted timing for staggered animations */
.project-item:nth-child(2) {
    transition-delay: 0.05s;
    /* Reduced from 0.1s */
}

.project-item:nth-child(3) {
    transition-delay: 0.1s;
    /* Reduced from 0.2s */
}

.project-item:nth-child(4) {
    transition-delay: 0.15s;
    /* Reduced from 0.3s */
}

.project-item:nth-child(5) {
    transition-delay: 0.2s;
    /* Reduced from 0.4s */
}

/* Initial visibility setting - makes the page look less empty */
.project-item {
    opacity: 0.2;
    /* Start with slight visibility instead of completely hidden */
}

/* Preload the next project section with minimal visibility */
.projects-container {
    position: relative;
    overflow: hidden;
}

/* Fade-in effect for gallery items */
.gallery-item {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.project-item.appear .gallery-item {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger the gallery item animations */
.project-item.appear .gallery-item:nth-child(1) {
    transition-delay: 0.05s;
}

.project-item.appear .gallery-item:nth-child(2) {
    transition-delay: 0.1s;
}

.project-item.appear .gallery-item:nth-child(3) {
    transition-delay: 0.15s;
}

.project-item.appear .gallery-item:nth-child(4) {
    transition-delay: 0.2s;
}

/* Add spacing between project gallery and horizontal scroll gallery */
.project-gallery+.horizontal-scroll-gallery {
    margin-top: 2rem;
    /* Increased from default spacing */
}

/* Also ensure horizontal galleries have proper top spacing in general */
.horizontal-scroll-gallery {
    margin-top: 1.5rem;
}

/* Add these styles to your projects.css file */

/* Modal Image Viewer Navigation Arrows */
.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: white;
    transition: background-color 0.3s ease, transform 0.2s ease;
    z-index: 1002;
    /* Higher than modal-content */
}

.modal-nav:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.modal-nav:active {
    transform: translateY(-50%) scale(0.95);
}

.modal-prev {
    left: 20px;
}

.modal-next {
    right: 20px;
}

.modal-nav i {
    font-size: 22px;
}

/* Improved modal content positioning to work with arrows */
.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    overflow: hidden;
    border-radius: 4px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    background-color: rgba(0, 0, 0, 0.3);
    /* Slight background to help with visibility */
}

/* Enhance mobile responsiveness for navigation arrows */
@media (max-width: 768px) {
    .modal-nav {
        width: 40px;
        height: 40px;
    }

    .modal-prev {
        left: 10px;
    }

    .modal-next {
        right: 10px;
    }

    .modal-nav i {
        font-size: 18px;
    }
}

/* For very small screens */
@media (max-width: 480px) {
    .modal-nav {
        width: 36px;
        height: 36px;
    }

    .modal-prev {
        left: 8px;
    }

    .modal-next {
        right: 8px;
    }

    .modal-nav i {
        font-size: 16px;
    }
}

/* Add a semi-transparent background to the modal overlay */
.modal-overlay {
    background-color: rgba(0, 0, 0, 0.9);
}

/* Transition for smoother image changes */
.modal-image {
    transition: opacity 0.2s ease;
}

/* Add to projects.css - ensures gallery items are accessible */
.gallery-item .project-image {
    cursor: zoom-in;
}

/* Add to projects.css or directly in your HTML head */

/* Image counter styles */
.modal-counter {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 1003;
    pointer-events: none;
}

/* Adjust for mobile devices */
@media (max-width: 768px) {
    .modal-counter {
        bottom: 10px;
        right: 10px;
        font-size: 12px;
        padding: 4px 8px;
    }

    /* When both caption and counter are present */
    .modal-caption+.modal-counter {
        bottom: 45px;
        /* Position above the caption */
    }
}


/* Add to projects.css - Fixed position navigation arrows */

/* Make navigation arrows fixed position regardless of image size */
.modal-nav {
    position: fixed;
    /* Change from absolute to fixed */
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: white;
    transition: background-color 0.3s ease, opacity 0.3s ease;
    z-index: 1002;
    /* Better visibility with a subtle shadow */
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

.modal-nav:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.modal-nav:active {
    transform: translateY(-50%) scale(0.95);
}

/* Fix positions to the sides of the viewport */
.modal-prev {
    left: 20px;
}

.modal-next {
    right: 20px;
}

.modal-nav i {
    font-size: 22px;
}

/* Ensure modal content doesn't block arrows */
.modal-content {
    max-width: calc(100% - 120px);
    /* Leave room for arrows on either side */
    margin: 0 auto;
}

/* Floating Project Menu */
.project-menu {
    position: fixed;
    left: 20px;
    top: calc(50% + 50px);
    transform: translateY(-50%);
    background: var(--card-bg);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    z-index: 100;
}

.project-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.project-menu li {
    margin: 0.5rem 0;
}

.project-menu a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
    cursor: pointer;
}

.project-menu a:hover {
    color: var(--accent-color);
}

.project-menu a.active {
    color: var(--accent-color);
    font-weight: 500;
}

.section-nav {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 100;
}

.section-nav button {
    background-color: rgba(26, 188, 156, 0.1);
    border: none;
    color: var(--accent-green);
    font-size: 1.5rem;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.section-nav button:hover {
    background-color: var(--accent-green);
    color: white;
}

@media (max-width: 1024px) {
    .project-menu {
        display: none;
    }

    .section-nav {
        display: none;
    }
}

.secondary-button {
    background-color: var(--primary-light);
    color: var(--text-light);
    padding: 0.5rem 1.2rem;
    border-radius: 4px;
    font-weight: 500;
    transition: var(--transition);
}

.secondary-button:hover {
    background-color: #30363d;
    transform: translateY(-2px);
}

.secondary-button.active {
    background-color: #262c36;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
    transform: translateY(1px);
}