/* Portfolio-specific styles */

/* Portfolio Grid */
.portfolio-items {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 2rem;
}

.portfolio-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2.5rem 3.5rem;
    box-shadow: var(--shadow);
    transition: all 0.2s ease;
    cursor: pointer;
}

.portfolio-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.portfolio-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    position: relative;
}

.portfolio-title {
    font-family: "Poppins", sans-serif;
    font-size: 3rem;
    font-weight: 500;
    line-height: 1.2;
    color: var(--text);
    flex: 1;
    max-width: 80%;
}

.portfolio-arrow {
    color: var(--beige);
    font-size: 1.5rem;
    transition: all 0.2s ease;
    opacity: 0.5;
}

.portfolio-card:hover .portfolio-arrow {
    color: var(--primary);
    opacity: 1;
}

/* Portfolio intro sentence */
.portfolio-intro {
    color: var(--text-light);
    line-height: 1.6;
    font-weight: 300;
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
}

/* Portfolio hero image */
.portfolio-hero-image {
    margin-bottom: 1rem;
}

.hero-thumbnail {
    aspect-ratio: 16/10;
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    overflow: hidden;
    width: 100%;
}

.hero-thumbnail:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Portfolio content sections (legacy - keeping for modal) */
.portfolio-content {
    margin-bottom: 1.5rem;
}

.portfolio-section {
    margin-bottom: 1rem;
}

.portfolio-section:last-child {
    margin-bottom: 0;
}

.portfolio-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.portfolio-label i {
    color: var(--primary);
    font-size: 0.9rem;
}

.portfolio-description {
    color: var(--text-light);
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Thumbnails Grid */
.portfolio-thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.thumbnail {
    aspect-ratio: 16/10;
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    overflow: hidden;
}

.thumbnail:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow);
}

.thumbnail::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.thumbnail:hover::after {
    opacity: 0;
}

/* Video play overlay for main portfolio thumbnails */
.video-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: var(--white);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    pointer-events: none;
    border: 2px solid var(--white);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.thumbnail:hover .video-play-overlay {
    transform: translate(-50%, -50%) scale(1.1);
    background: rgba(0, 0, 0, 0.9);
}

/* Inline video player */
.inline-video-player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 8px;
}

/* Inline video close button */
.inline-video-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(0, 0, 0, 0.8);
    color: var(--white);
    border: 2px solid var(--white);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s ease;
    font-size: 1rem;
}

.inline-video-close:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: scale(1.1);
}


/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(80, 73, 57, 0.5);
    backdrop-filter: blur(4px);
    overflow-y: scroll;
}

.modal-content {
    position: relative;
    background: var(--white);
    margin: 5% auto;
    width: 80%;
    max-width: 1200px;
    max-height: auto;
    border-radius: 2px;
 
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--primary);
    color: var(--white);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s ease;
    font-size: 1.2rem;
}

.modal-close .ti-x {
    stroke-width: 2.5;
}


.modal-close:hover {
    background: #0052cc;
    transform: scale(1.1);
}

.modal-header {
    padding: 2rem 2rem 1rem 2rem;
}

.modal-header h2 {
    font-family: "Poppins", sans-serif;
    font-size: 3.75rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 0.5rem;
    width: 90%;
}



/* Modal links section */
.modal-links {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem;
}

.modal-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    border: 2px solid var(--bg);
    transition: all 0.2s ease;
}

.modal-link:hover {
    color: #0052cc;
    background: var(--white);
    border-color: var(--primary);
}

.modal-link .link-icon {
    font-size: 1rem;
    transition: transform 0.2s ease;
}

.modal-link:hover .link-icon {
    transform: translateX(1px);
}

.modal-body {
    padding: 2rem;
    flex: 1;
    overflow-y: auto;
    font-family: 'Merriweather', Georgia, serif;
    font-size: 1.2rem;
    font-weight: 300;
}

.modal-description {
    color: var(--text-light);
}

/* Modal read more functionality */
.modal-summary-long {
    margin-top: 0.75rem;
}

.modal-read-more-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.75rem;
    padding: 0;
    transition: all 0.2s ease;
}

.modal-read-more-btn:hover {
    color: #0052cc;
    transform: translateX(2px);
}

.modal-read-more-btn:hover .read-more-icon {
    transform: translateY(1px);
}

.modal-read-more-btn.expanded:hover .read-more-icon {
    transform: rotate(180deg) translateY(-1px);
}

.modal-read-more-btn .read-more-icon {
    font-size: 1rem;
    transition: transform 0.3s ease;
    display: inline-block;
    line-height: 1;
    transform-origin: center;
}

.modal-read-more-btn.expanded .read-more-icon {
    transform: rotate(180deg);
}

/* Modal content sections */
.modal-section {
    margin-bottom: 2rem;
}

.modal-section:last-child {
    margin-bottom: 2rem;
}

.modal-label {
    font-family: "Poppins", sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-label i {
    color: var(--primary);
    font-size: 1rem;
}

/* Image Carousel */
.image-carousel {
    position: relative;
    background: var(--bg);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.carousel-container {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/10;
}

.carousel-images {
    display: flex;
    transition: transform 0.3s ease;
    height: 100%;
}

.carousel-image,
.carousel-video {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: var(--white);
}

.carousel-video {
    border: none;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--white);
    color: var(--primary);
    border: 0px solid var(--primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.2s ease;
    z-index: 5;
    box-shadow: var(--shadow);
}

.carousel-btn:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-50%) scale(1.1);
}

.carousel-prev {
    left: 1rem;
}

.carousel-next {
    right: 1rem;
}

/* Carousel Thumbnails */
.carousel-thumbnails {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 0;
    flex-wrap: wrap;
}

.carousel-thumbnail {
    width: 60px;
    height: 40px;
    border-radius: 4px;
    background: var(--border);
    cursor: pointer;
    transition: all 0.2s ease;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 2px solid transparent;
    opacity: 0.7;
}

.carousel-thumbnail.active {
    border-color: var(--primary);
    opacity: 1;
    transform: scale(1.05);
}

.carousel-thumbnail:hover {
    opacity: 1;
    transform: scale(1.02);
}

/* Video thumbnail styling */
.video-thumbnail {
    position: relative;
}

.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: var(--white);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    pointer-events: none;
}

.carousel-thumbnail.video-thumbnail .play-icon {
    width: 20px;
    height: 20px;
    font-size: 10px;
}

/* Image Caption */
.image-caption {
    text-align: center;
    padding: 1rem 2rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.4;
    font-style: italic;
    min-height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
}

.thumbnail.video-thumbnail::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-left: 8px solid var(--white);
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    padding: 4px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .portfolio-items {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .portfolio-card {
        padding: 1.25rem;
    }
    
    .portfolio-intro {
        font-size: 1.2rem;
        margin-bottom: 1.25rem;
    }
    
    .hero-thumbnail {
        aspect-ratio: 4/3;
    }
    
    .portfolio-thumbnails {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 0.4rem;
    }
    
    .modal-content {
        margin: 5% auto;
        width: 95%;
        max-height: 85vh;
    }
    
    .modal-header {
        padding: 1.5rem 1.5rem 1rem 1.5rem;
    }
    
    .modal-header h2 {
        font-size: 1.5rem;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .carousel-btn {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .carousel-prev {
        left: 0.5rem;
    }
    
    .carousel-next {
        right: 0.5rem;
    }
    
    .carousel-thumbnail {
        width: 50px;
        height: 33px;
    }
}

@media (max-width: 480px) {
    .portfolio-items {
        gap: 1rem;
    }
    
    .portfolio-card {
        padding: 1rem;
    }
    
    .portfolio-title {
        font-size: 1.1rem;
    }
    
    .portfolio-intro {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }
    
    .hero-thumbnail {
        aspect-ratio: 1/1;
    }
    
    .portfolio-thumbnails {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
        gap: 0.3rem;
    }
    
    .modal-content {
        margin: 2% auto;
        width: 98%;
        max-height: 95vh;
        border-radius: 8px;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-header h2 {
        font-size: 1.25rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-close {
        top: 0.5rem;
        right: 0.5rem;
        width: 35px;
        height: 35px;
    }
    
    .carousel-container {
        aspect-ratio: 4/3;
    }
}
