/* Portfolio Styles */
.portfolio-section {
    padding: 80px 20px 40px;
    background-color: #1a1a1a; /* light cyan background for colorful feel */
    color: #ffffff; /* dark text color */
    min-height: calc(100vh - 60px);
}

.portfolio-container {
    max-width: 100%; /* narrower width for better reading */
    height: 100%;
    margin: 0 auto;
}

.project-gallery {
    display: flex;
    flex-direction: column;
    gap: 50px;
    margin-top: 20px;
}

.project-item {
    display: block; /* stacked vertically */
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    position: relative;
}

.project-item.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Remove left/right layouts */
.project-left,
.project-right {
    flex-direction: initial;
    justify-content: initial;
}

.project-image-container {
    width: 65%;
    height: 40%;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 12px;
    position: relative;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.project-image-colorful {
    width: 100%;
    max-height: auto; /* increased height for bigger image */
    object-fit: contain;
    border-radius: 12px;
    transition: transform 1.5s ease;
    cursor: pointer;
}

.project-image-colorful:hover {
    transform: scale(1.05);
}

/* Remove grayscale styles */
.project-image-bw,
.project-image-bw:hover {
    filter: none;
    transform: none;
    cursor: pointer;
}

.image-placeholder {
    width: 90%;
    height: 300px;
    background-color: #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    font-size: 1.4rem;
    margin: 0 auto 20px auto;
    border-radius: 12px;
}

/* Project content section */
.project-content {
    text-align: center;
    padding: 0 20px;
}

/* Project title with blue underline */
.project-title.underlined-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #222222;
    position: relative;
    display: inline-block;
}

/* Project details text */
.project-details {
    color: #444444;
    font-size: 1.1rem;
    line-height: 1.5;
    margin-top: 10px;
    margin-bottom: 18px;
}

/* Modal Styles kept unchanged */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

#caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    height: 150px;
}

.error-message {
    text-align: center;
    color: #dc3545;
    font-size: 1.2rem;
    margin-top: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .portfolio-section {
        padding: 60px 15px 20px;
    }

    .project-gallery {
        gap: 40px;
    }

    .project-image-container {
        width: 100% !important;
        position: relative; /* ensure overlay positions correctly on mobile */
    }

    .project-overlay {
        height: 15rem !important; /* increased overlay height to show details */
    }

    .project-title.vertical-underline {
        font-size: 1.5rem !important; /* smaller title on mobile */
    }

    .project-details {
        font-size: 1.0rem !important; /* smaller details on mobile */
        opacity: 1 !important; /* make details visible by default */
        max-height: 10rem !important; /* allow details to show */
    }

    .image-placeholder {
        width: 100%;
        height: 250px;
    }
}

/* Overlay container positioned at bottom left of image */
.project-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 15rem; /* always expanded to show details */
    overflow: hidden;
    cursor: pointer;
    transition: height 1.5s ease;
    z-index: 2;
    display: flex;
    align-items: flex-end;
}

/* Gradient background from black fading upward */
.overlay-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,1) 0%, transparent 100%);
    border-radius: 0 0 12px 12px;
    pointer-events: none; /* allow clicks to pass through */
    z-index: -1;
}

/* Overlay content container */
.overlay-content {
    color: white;
    padding: 0 1rem 0.5rem 3rem;
    width: 100%;
}

/* Project title with vertical blue underline line on the left */
.project-title.vertical-underline {
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0 0 0.3rem 0;
    position: relative;
    display: inline-block;
    color: white;
    padding-left: 1rem; /* spacing for vertical line */
}

/* Vertical blue underline line */
.project-title.vertical-underline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: #1e9bd7;
    border-radius: 2px;
}

/* Project details text in white */
.project-details {
    color: white;
    font-size: 1.1rem;
    line-height: 1.5;
    margin-top: 0;
    margin-bottom: 0;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.6s ease, max-height 0.6s ease;
}

/* Reveal project details on hover of overlay container */
.project-overlay:hover {
    height: 15rem; /* expands overlay height */
}

/* Show details text on overlay hover */
.project-overlay:hover .project-details {
    opacity: 1;
    max-height: 10rem;
}

/* When not hovering, hide details text */
.project-overlay:not(:hover) .project-details {
    opacity: 0;
    max-height: 0;
}
