/* Portfolio Section */
.portfolio-section {
    padding: 6rem 0;
    background-color: #0d1b2a !important;
    position: relative;
    overflow: hidden;
}

.portfolio-section .section-title {
    font-family: var(--font-primary);
    font-size: 3rem;
    font-weight: 800;
    color: var(--color-text);
    text-align: center;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.portfolio-section .text-accent {
    color: var(--color-primary);
    position: relative;
    display: inline-block;
}

.portfolio-section .text-accent::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--color-primary);
    z-index: -1;
    border-radius: 2px;
    opacity: 0.7;
}

.portfolio-section .section-subtitle {
    font-size: 1.25rem;
    color: var(--color-text);
    opacity: 0.9;
    text-align: center;
    max-width: 700px;
    margin: 0 auto 3.5rem;
    line-height: 1.7;
}

.section-divider {
    width: 80px;
    height: 4px;
    background: var(--color-primary);
    margin: 0 auto 3.5rem;
    border: none;
    border-radius: 2px;
    border-radius: 2px;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2.5rem;
    margin-top: 3rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.portfolio-card {
    background: var(--color-bg-light);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(8, 25, 58, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.portfolio-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 32px rgba(8, 25, 58, 0.1);
    border-color: var(--color-primary);
}

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

.portfolio-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.portfolio-card:hover .portfolio-image {
    transform: scale(1.05);
}

.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(13, 27, 42, 0.9) 0%, transparent 60%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.portfolio-content {
    padding: 1.75rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background: var(--color-bg-light);
    position: relative;
    z-index: 1;
}

.portfolio-tag {
    display: inline-block;
    background: var(--color-accent);
    color: var(--color-primary);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.35rem 0.9rem;
    border-radius: 20px;
    margin-right: 0.5rem;
    margin-bottom: 0.75rem;
    border: 1px solid var(--color-border);
    transition: all 0.2s ease;
}

.portfolio-tag:hover {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.portfolio-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: #0d1b2a; /* Dark blue for better contrast */
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.portfolio-desc {
    color: #2d3748; /* Dark gray for better readability */
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.btn-gallery-overlay {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    color: #fff;
    border: 2px solid #fff;
    border-radius: 50px;
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    margin-top: 0.5rem;
}

.btn-gallery-overlay:hover {
    background: #fff;
    color: #0d1b2a;
    transform: translateY(-2px);
}

.btn-gallery-overlay svg {
    transition: transform 0.3s ease;
}

.btn-gallery-overlay:hover svg {
    transform: translateX(3px);
}

/* Portfolio Modal */
.portfolio-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 1.5rem;
}

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

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(13, 27, 42, 0.95);
    backdrop-filter: blur(8px);
    z-index: 1;
}

.modal-container {
    position: relative;
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 1200px;
    max-height: 90vh;
    overflow: hidden;
    z-index: 2;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.portfolio-modal.active .modal-container {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(13, 27, 42, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #f4c10f;
    border-color: transparent;
    transform: rotate(90deg);
}

.modal-close svg {
    width: 20px;
    height: 20px;
    color: #0d1b2a;
}

.modal-title {
    display: none; /* Hide the title since we're using a cleaner design */
}

.gallery-container {
    position: relative;
    flex: 1;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-slide {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
}

.gallery-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.gallery-image.zoomed {
    transform: scale(1.5);
    cursor: zoom-out;
}

.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(13, 27, 42, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    transition: all 0.3s ease;
    opacity: 0.8;
}

.nav-arrow:hover {
    background: #f4c10f;
    border-color: transparent;
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}

.nav-arrow.prev {
    left: 2rem;
}

.nav-arrow.next {
    right: 2rem;
}

.nav-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: translateY(-50%) !important;
    background: rgba(255, 255, 255, 0.5);
}

.nav-arrow svg {
    width: 24px;
    height: 24px;
    color: #0d1b2a;
}

.gallery-caption {
    padding: 1.5rem 2rem;
    text-align: center;
    background: #f8f9fc;
    border-top: 1px solid #e5e7eb;
}

.gallery-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.gallery-description {
    color: var(--color-text);
    opacity: 0.85;
    font-size: 1.025rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.gallery-thumbnails {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 2rem;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #f4c10f #e5e7eb;
    background: #fff;
    border-top: 1px solid #e5e7eb;
}

.gallery-thumbnails::-webkit-scrollbar {
    height: 6px;
}

.gallery-thumbnails::-webkit-scrollbar-track {
    background: #e5e7eb;
    border-radius: 3px;
}

.gallery-thumbnails::-webkit-scrollbar-thumb {
    background: #f4c10f;
    border-radius: 3px;
}

.thumbnail {
    width: 80px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.thumbnail:hover {
    opacity: 1;
    transform: translateY(-2px);
}

.thumbnail.active {
    border-color: #f4c10f;
    opacity: 1;
}

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

/* Responsive Styles */
@media (max-width: 1024px) {
    .portfolio-section .section-title {
        font-size: 3rem;
    }
    
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .portfolio-section {
        padding: 4rem 0;
    }
    
    .portfolio-section .section-title {
        font-size: 2.5rem;
    }
    
    .portfolio-section .section-subtitle {
        font-size: 1.1rem;
        padding: 0 1rem;
    }
    
    .portfolio-grid {
        grid-template-columns: 1fr;
        max-width: 500px;
        margin: 0 auto;
    }
    
    .modal-title {
        font-size: 1.75rem;
        padding: 1.5rem 1.5rem 0.5rem;
    }
    
    .gallery-slide {
        padding: 1rem;
    }
    
    .nav-arrow {
        width: 40px;
        height: 40px;
    }
    
    .nav-arrow svg {
        width: 20px;
        height: 20px;
    }
    
    .gallery-caption, .gallery-thumbnails {
        padding: 1rem 1.5rem;
    }
    
    .gallery-title {
        font-size: 1.1rem;
    }
    
    .gallery-description {
        font-size: 0.9rem;
    }
    
    .thumbnail {
        width: 70px;
        height: 50px;
    }
}

@media (max-width: 480px) {
    .portfolio-section .section-title {
        font-size: 2rem;
    }
    
    .portfolio-section .section-subtitle {
        font-size: 1rem;
    }
    
    .portfolio-title {
        font-size: 1.5rem;
    }
    
    .portfolio-desc {
        font-size: 0.9rem;
    }
    
    .btn-gallery-overlay {
        font-size: 0.8rem;
        padding: 0.4rem 1rem;
    }
    
    .modal-title {
        font-size: 1.5rem;
    }
    
    .thumbnail {
        width: 60px;
        height: 45px;
    }
}
