html, body, h1, h2, h3, h4, h5, h6, p, ul, li, figure, figcaption {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    line-height: 1.6;
    font-family: Arial, sans-serif;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

/* Global Styles */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Roboto Flex', sans-serif;
    background-color: #ffffff;
    color: #333;
    line-height: 1.6;
}

/* Layout */
.layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
    width: 250px;
    background-color: #ffffff;
    
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-header {
    padding: 1rem 1.5rem;

    
}
.sidebar-header a{ 
    text-decoration: none;
    color: inherit;
}

.name {
    font-size: 1.5rem;
    text-transform: uppercase;
    margin: 0;
    color: #2c3e50;   
}
.subtitle {
    padding: 0.5rem 0;
    font-weight: normal;
    font-size: 1.2rem;
}

.nav-menu {
    list-style: none;
    padding: 0rem 0;
    margin: 0;
}

.nav-menu li {
    margin: 0;
}

.nav-link {
    display: block;
    padding: 0.5rem 1.5rem;
    color: #6c757d;
    text-decoration: none;

}

.nav-link:hover,
.nav-link.active {
    color: #e7a035;
    
}

/* Nested Navigation Menu */
.nav-item {
    position: relative;
}

.nav-submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    
}

.nav-submenu.always-visible {
    max-height: none;
    overflow: visible;
}

.nav-item:hover .nav-submenu,
.nav-item.expanded .nav-submenu {
    max-height: 300px;
}

.nav-submenu li {
    margin: 0;
}

.sub-link {
    padding: 0.2rem 2rem 0.2rem 2.5rem;
    font-size: 0.9rem;
    
}


/* Main Content */
.main-content {
    flex: 1;
    margin-left: 250px;
    padding: 2rem;
    max-width: calc(100vw - 250px);
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

.section-header {
    margin-bottom: 0rem;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 300;
    margin: 0 0 1rem 0;
    color: #2c3e50;
}

.section-header p {
    font-size: 1.1rem;
    color: #6c757d;
    margin: 0;
    max-width: 600px;
}

/* Gallery Styles */
.gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-top: 2rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 2px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    background: #fff;
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 250px;
    width: auto;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    text-decoration: none;
    color: inherit;
}

.gallery-item img {
    height: 100%;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    display: block;
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 2rem 1.5rem 1.5rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    transform: translateY(0);
}

.gallery-overlay h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
    font-weight: 400;
}

.gallery-overlay p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Portfolio Detail Meta */
.portfolio-meta {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    align-items: center;
}

.meta-item {
    color: #6c757d;
    font-size: 0.9rem;
}

.meta-item strong {
    color: #2c3e50;
    margin-right: 0.5rem;
}

.tech-tags {
    display: inline-flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-left: 0.5rem;
}

/* Portfolio Detail Gallery Grid (override for detail view) */
.portfolio-detail-gallery {   
    gap: 1.5rem;
    margin-bottom: 3rem;
    max-width: 100%;
}
.portfolio-detail-gallery img{
    display: inline;
    width: auto;
    height:250px;   
    border-radius: 5px; 

}


/* Contact Styles */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 4rem;
    margin-top: 2rem;
}

.contact-info {
    padding-right: 2rem;
}

.contact-item {
    margin-bottom: 2rem;
}

.contact-item h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: #2c3e50;
}

.contact-item p {
    margin: 0;
    color: #6c757d;
}

.contact-form {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 8px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2c3e50;
}

.submit-btn {
    background: #2c3e50;
    color: white;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.submit-btn:hover {
    background: #34495e;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
}

.modal-content {
    position: relative;
    margin: auto;
    padding: 0;
    width: 90%;
    max-width: 1200px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    color: #fff;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
}

.close:hover {
    opacity: 0.7;
}

.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 2rem;
    pointer-events: none;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
    pointer-events: all;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Portfolio Detail Pages */
.portfolio-detail {
    max-width: 900px;
}

.back-nav {
    margin-bottom: 0.5rem;
}

.back-link {
    color: #6c757d;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: #2c3e50;
}

.portfolio-detail-content h2 {
    font-size: 2.5rem;
    font-weight: 300;
    margin: 0 0 1.5rem 0;
    color: #2c3e50;
}

.portfolio-meta {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    align-items: center;
}

.meta-item {
    color: #6c757d;
    font-size: 0.9rem;
}

.meta-item strong {
    color: #2c3e50;
    margin-right: 0.5rem;
}

.portfolio-detail-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
    max-width: 100%;
}

.gallery-item-detail {
    margin-bottom: 0;
    background: none;
    border-radius: 0;
    box-shadow: none;
    transition: transform 0.3s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    /* ensure images are centered vertically */
    justify-content: center;
    padding: 0;
    height: 250px;
    width: auto;
    /* Remove border if present */
    border: none;
}

.gallery-item-detail img {
    height: 100%;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    display: block;
    background: none;
    border-radius: 0;
    box-shadow: none;
    cursor: pointer;
    transition: transform 0.3s ease;
}


.description-content {
    padding: 1rem  0;
    margin-bottom: 2rem;
    line-height: 1.7;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.tech-tag {
    background: #f8f9fa;
    color: #2c3e50;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid #e9ecef;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .main-content {
        margin-left: 0;
        max-width: 100%;
        padding: 2rem 1rem;
    }
    
    .gallery {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .contact-info {
        padding-right: 0;
    }
    
    .section-header h2,
    .portfolio-detail-content h2 {
        font-size: 2rem;
    }
    
    .portfolio-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .nav-submenu {
        position: static;
        max-height: none;
        overflow: visible;
    }
    
    .nav-item:hover .nav-submenu,
    .nav-item.expanded .nav-submenu {
        max-height: none;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 1rem;
    }
    
    .gallery {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .contact-form {
        padding: 1.5rem;
    }
    
    .modal-nav {
        padding: 0 1rem;
    }
    
    .portfolio-detail {
        max-width: 100%;
    }
    
    .tech-tags {
        gap: 0.3rem;
    }
    
    .tech-tag {
        font-size: 0.7rem;
        padding: 0.3rem 0.6rem;
    }
}