:root {
    --bg-color: #f8f9fa;
    --text-color: #333;
    --card-bg: #fff;
    --nav-bg: #fff;
    --border-color: rgba(0,0,0,0.1);
    --logo-color: #2c3e50;
    --nav-link-color: #555;
    --nav-link-hover: #3498db;
    --heading-color: #2c3e50;
    --item-title-color: #2c3e50;
    --date-color: #7f8c8d;
    --company-color: #3498db;
    --footer-bg: #2c3e50;
    --gallery-bg: #ecf0f1;
    --container-width: 1680px; /* Expanded main content width */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--bg-color);
    transition: background-color 0.3s, color 0.3s;
}

.navbar {
    background: var(--nav-bg);
    box-shadow: 0 2px 10px var(--border-color);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: background-color 0.3s;
    backdrop-filter: saturate(1.2) blur(6px);
    background: rgba(255,255,255,0.85);
}

.nav-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--logo-color);
    transition: color 0.3s;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--nav-link-color);
    transition: color 0.3s;
    font-weight: 500;
}

.nav-links a:hover {
    color: var(--nav-link-hover);
}

.nav-controls {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
}

.toggle-btn {
    background: linear-gradient(145deg, #e0e0e0, #c0c0c0);
    border: none;
    border-radius: 20px;
    padding: 0.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 50px;
    height: 25px;
    display: flex;
    align-items: center;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.toggle-btn:hover {
    background: linear-gradient(145deg, #d0d0d0, #b0b0b0);
}

.toggle-btn:active {
    transform: scale(0.98);
}

.toggle-point {
    width: 20px;
    height: 20px;
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    position: relative;
    z-index: 1;
}

.lang-toggle .toggle-point {
    transform: translateX(2px);
    font-weight: 600;
    color: #333;
    font-size: 0.6rem;
}

.lang-toggle.active .toggle-point {
    transform: translateX(26px);
}

.toggle-bg {
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    background: linear-gradient(145deg, #3498db, #2980b9);
    border-radius: 18px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.toggle-btn.active .toggle-bg {
    opacity: 1;
}

.hero {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 120px 0 80px;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem;
}

.profile-img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    margin: 0 auto 2rem;
    border: 5px solid white;
    background: #ddd;
    background-image: url('profile.jpg');
    background-size: cover;
    background-position: center;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.contact-info {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section {
    padding: 80px 0;
    max-width: var(--container-width);
    margin: 0 auto;
    padding-left: 2.5rem;
    padding-right: 2.5rem;
}

.section h2 {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    text-align: center;
    color: var(--heading-color);
    position: relative;
    transition: color 0.3s;
}

.section h2::after {
    content: '';
    width: 60px;
    height: 3px;
    background: var(--nav-link-hover);
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    transition: background 0.3s;
}

.experience-item,
.education-item,
.project-item,
.cert-item {
    background: var(--card-bg);
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 12px var(--border-color);
    transition: transform 0.35s cubic-bezier(.4,.2,.2,1), background-color 0.3s, box-shadow 0.35s;
    position: relative;
    overflow: hidden;
}

.experience-item::before,
.education-item::before,
.project-item::before,
.cert-item::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, #3498db, #2a5298);
    opacity: 0;
    transition: opacity 0.4s;
}

.experience-item:hover,
.education-item:hover,
.project-item:hover,
.cert-item:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 10px 28px -4px rgba(0,0,0,0.18);
}

.experience-item:hover::before,
.education-item:hover::before,
.project-item:hover::before,
.cert-item:hover::before {
    opacity: 1;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.item-title {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--item-title-color);
    transition: color 0.3s;
}

.item-date {
    color: var(--date-color);
    font-weight: 500;
    transition: color 0.3s;
}

.item-company {
    color: var(--company-color);
    margin-bottom: 0.5rem;
    transition: color 0.3s;
}

.item-description ul {
    margin-left: 1.5rem;
}

.item-description li {
    margin-bottom: 0.5rem;
}

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

.tech-tag {
    background: var(--gallery-bg);
    color: var(--item-title-color);
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.9rem;
    transition: background-color 0.3s, color 0.3s, transform 0.3s;
    will-change: transform;
}

.tech-tag:hover {
    background: #3498db;
    color: #fff;
    transform: translateY(-3px);
}

/* Projects grid (exact 4 columns on large screens, centered last row) */
.projects-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.7rem;
    justify-content: center; /* center rows including incomplete last row */
}

.projects-grid > a,
.projects-grid > .project-item {
    flex: 1 0 calc((100% - (1.7rem * 3)) / 4); /* 4 columns accounting for gaps */
    max-width: calc((100% - (1.7rem * 3)) / 4);
    text-decoration: none;
    color: inherit;
    display: flex;
}

/* Ensure direct project-item divs (non-anchor) stretch */
.projects-grid > a > .project-item,
.projects-grid > .project-item {
    width: 100%;
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
}

.projects-grid .project-item .item-description { flex-grow: 1; }

/* Medium screens: 3 columns */
@media (max-width: 1200px) {
    .projects-grid > a,
    .projects-grid > .project-item {
        flex: 1 0 calc((100% - (1.7rem * 2)) / 3);
        max-width: calc((100% - (1.7rem * 2)) / 3);
    }
}

/* Tablets: 2 columns */
@media (max-width: 900px) {
    .projects-grid > a,
    .projects-grid > .project-item {
        flex: 1 0 calc((100% - 1.7rem) / 2);
        max-width: calc((100% - 1.7rem) / 2);
    }
}

/* Mobile: 1 column */
@media (max-width: 600px) {
    .projects-grid > a,
    .projects-grid > .project-item {
        flex: 1 0 100%;
        max-width: 100%;
    }
}

.award-badge {
    background: #f39c12;
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    display: inline-block;
}

/* Certification grid */
.cert-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.7rem;
    justify-content: center;
    margin-top: 2rem;
}

/* 3-column layout for certifications */
.cert-grid > a,
.cert-grid > .cert-item {
    flex: 1 0 calc((100% - (1.7rem * 2)) / 3);
    max-width: calc((100% - (1.7rem * 2)) / 3);
    text-decoration: none;
    color: inherit;
    display: flex;
}

.cert-grid > a > .cert-item,
.cert-grid > .cert-item {
    width: 100%;
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
}

/* Certification image placeholder */
.cert-image-placeholder {
    width: 100%;
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, #dfe9f3 0%, #ffffff 100%);
    border: 1px dashed rgba(0,0,0,0.15);
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: #7f8c8d;
    position: relative;
    overflow: hidden;
}

.cert-image-placeholder::after {
    content: 'Certification Image';
    letter-spacing: .5px;
}

/* Actual certification image container */
.cert-image {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1rem;
    position: relative;
    background: #f5f7fa;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    transition: transform .35s ease, box-shadow .35s ease;
}
.cert-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.cert-item:hover .cert-image {
    transform: translateY(-4px);
    box-shadow: 0 8px 22px -4px rgba(0,0,0,0.18);
}

/* Responsive columns for certifications */
/* Breakpoints adjust columns downward */
@media (max-width: 1200px) {
    .cert-grid > a,
    .cert-grid > .cert-item { flex: 1 0 calc((100% - 1.7rem) / 2); max-width: calc((100% - 1.7rem) / 2); }
}
@media (max-width: 900px) {
    .cert-grid > a,
    .cert-grid > .cert-item { flex: 1 0 calc((100% - 1.7rem) / 2); max-width: calc((100% - 1.7rem) / 2); }
}
@media (max-width: 600px) {
    .cert-grid > a,
    .cert-grid > .cert-item { flex: 1 0 100%; max-width: 100%; }
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.gallery-item {
    background: var(--card-bg);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px var(--border-color);
    transition: background-color 0.3s;
}

/* Special styling for the volunteering section full-width item */
.gallery-item[style*="grid-column"] {
    box-shadow: none;
    background: transparent;
    border-radius: 0;
    overflow: visible;
}

.gallery-item[style*="grid-column"] .gdgc-journey {
    margin-bottom: 0;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.gallery-item[style*="grid-column"] .gallery-content {
    background: var(--card-bg);
    margin-top: 0;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
    box-shadow: 0 5px 15px var(--border-color);
}

.gallery-img {
    width: 100%;
    height: 380px; /* increased from 300px */
    background: var(--gallery-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--date-color);
    transition: background-color 0.3s, color 0.3s;
}

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

.gallery-content {
    padding: 1.5rem;
}

.image-slider {
    width: 100%;
    height: 380px; /* increased from 300px */
    position: relative;
    overflow: hidden;
    background: var(--gallery-bg);
    transition: background-color 0.3s;
}

.slider-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.slider-image.active {
    opacity: 1;
}

.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    background: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background 0.3s;
    margin-top: 1rem;
}

.btn:hover {
    background: #2980b9;
}

/* Hero actions */
.hero-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.download-cv-btn {
    position: relative;
    font-weight: 600;
    letter-spacing: .5px;
    border: 1px solid rgba(255,255,255,0.4);
    backdrop-filter: blur(4px) saturate(1.2);
}

.download-cv-btn::after {
    content: '→';
    margin-left: .4rem;
    transition: transform .3s;
    display: inline-block;
}

.download-cv-btn:hover::after { transform: translateX(4px); }

/* (Removed .volunteering-cards styles - no longer used after simplification) */

.footer {
    background: var(--footer-bg);
    color: white;
    text-align: center;
    padding: 2rem 0;
    transition: background-color 0.3s;
}

/* GDGC Journey Styles */
.gdgc-journey {
    background: var(--card-bg);
    padding: 0;
    border-radius: 15px;
    box-shadow: 0 5px 15px var(--border-color);
    border: none;
    outline: none;
    overflow: hidden;
}

.gdgc-content {
    color: var(--text-color);
    text-align: center;
    border: none;
    outline: none;
    padding: 2rem;
    background: transparent;
    margin: 0;
}

.gdgc-title {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    font-weight: bold;
    color: var(--heading-color);
}

.journey-text {
    max-width: 600px;
    margin: 0 auto 2rem;
    line-height: 1.8;
    color: var(--text-color);
    font-size: 1rem;
}

/* Journey highlights restored */
.journey-highlights {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 700px) {
    .journey-highlights { grid-template-columns: repeat(2, 1fr); }
}

.journey-step {
    text-align: center;
    padding: 0;
    background: var(--gallery-bg);
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 16/23; /* Maintain 16:23 aspect ratio */
    display: flex;
    align-items: end;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.journey-step:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.step-badge {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.journey-step:hover .step-badge {
    transform: scale(1.02);
}

.step-title {
    font-weight: bold;
    color: white;
    margin: 0;
    padding: 0.4rem;
    font-size: 0.7rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.9));
    width: 100%;
    text-shadow: 0 1px 3px rgba(0,0,0,0.9);
    position: relative;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.journey-step:hover .step-title {
    opacity: 1;
}

/* GDGC Slider Styles */
.gdgc-slider {
    width: 100%;
    height: 500px; /* increased from 400px */
    position: relative;
    overflow: hidden;
    background: var(--gallery-bg);
    border-radius: 10px;
    margin-top: 2rem;
}

.gdgc-slider .slider-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.gdgc-slider .slider-image.active {
    opacity: 1;
}

/* Red Crescent slider mirroring GDGC with slightly larger height */
.redc-slider {
    width: 100%;
    height: 540px; /* slightly bigger for emphasis */
    position: relative;
    overflow: hidden;
    background: var(--gallery-bg);
    border-radius: 10px;
    margin-top: 2rem;
}
.redc-slider .slider-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}
.redc-slider .slider-image.active { opacity: 1; }

@media (max-width: 768px) {
    .redc-slider { height: 320px; }
}
@media (max-width: 480px) {
    .redc-slider { height: 260px; }
}

/* Enlarge certification image height slightly by changing aspect ratio */
.cert-image { aspect-ratio: 16/8.5; }

/* Mobile Responsive */
@media (max-width: 768px) {
    .gdgc-journey {
        padding: 0;
    }
    
    .gdgc-content {
        padding: 1.5rem;
    }
    
    .gdgc-title {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
    
    /* .journey-highlights hidden */
    
    /* journey-step rule removed (no overrides needed) */
    
    .step-title {
        font-size: 0.6rem;
        padding: 0.3rem;
    }
    
    .gdgc-slider {
        height: 300px;
    }
}

@media (max-width: 480px) {
    .gdgc-content {
        padding: 1rem;
    }
    
    .gdgc-title {
        font-size: 1.3rem;
    }
    
    /* .journey-highlights hidden */
    
    .step-title {
        font-size: 0.65rem;
        padding: 0.3rem;
    }
    
    .journey-text {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }
    
    .gdgc-slider {
        height: 250px;
        margin-top: 1.5rem;
    }
}

@media (max-width: 1200px) {
    .nav-container { padding: 1rem 1.5rem; }
    .section { padding-left: 1.5rem; padding-right: 1.5rem; }
}

@media (max-width: 992px) {
    .nav-container {
        padding: 1rem;
    }
    
    .section {
        padding: 60px 0;
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .section h2 {
        font-size: 2.2rem;
        margin-bottom: 2.5rem;
    }
    
    .gallery {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
    }
    
    .contact-info {
        gap: 1.5rem;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero p {
        font-size: 1.2rem;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .nav-container {
        padding: 0.8rem;
        flex-wrap: wrap;
    }
    
    .logo {
        font-size: 1.3rem;
    }
    
    .nav-controls {
        gap: 0.3rem;
    }
    
    .toggle-btn {
        width: 40px;
        height: 20px;
    }
    
    .toggle-point {
        width: 16px;
        height: 16px;
        font-size: 0.6rem;
    }
    
    .lang-toggle.active .toggle-point {
        transform: translateX(20px);
    }
    
    .hero {
        padding: 100px 0 60px;
    }
    
    .hero h1 {
        font-size: 2rem;
        margin-bottom: 0.8rem;
    }
    
    .hero p {
        font-size: 1.1rem;
        margin-bottom: 1.5rem;
    }
    
    .profile-img {
        width: 120px;
        height: 120px;
        margin-bottom: 1.5rem;
    }
    
    .contact-info {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .section {
        padding: 50px 0;
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .section h2 {
        font-size: 2rem;
        margin-bottom: 2rem;
    }
    
    .experience-item,
    .education-item,
    .project-item,
    .cert-item {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .item-title {
        font-size: 1.2rem;
    }
    
    .item-date {
        order: -1;
        font-size: 0.9rem;
    }
    
    .gallery {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin-top: 1.5rem;
    }
    
    .gallery-img {
        height: 250px;
    }
    
    .image-slider {
        height: 250px;
    }
    
    .gallery-content {
        padding: 1rem;
    }
    
    .tech-stack {
        gap: 0.3rem;
        margin-top: 0.8rem;
    }
    
    .tech-tag {
        padding: 0.2rem 0.6rem;
        font-size: 0.8rem;
    }
    
    .award-badge {
        padding: 0.2rem 0.6rem;
        font-size: 0.8rem;
        margin-top: 0.3rem;
    }
}

@media (max-width: 576px) {
    .nav-container {
        padding: 0.5rem;
        justify-content: space-between;
    }
    
    .logo {
        font-size: 1.1rem;
    }
    
    .toggle-btn {
        width: 35px;
        height: 18px;
    }
    
    .toggle-point {
        width: 14px;
        height: 14px;
        font-size: 0.5rem;
    }
    
    .lang-toggle.active .toggle-point {
        transform: translateX(17px);
    }
    
    .hero {
        padding: 80px 0 40px;
    }
    
    .hero-content {
        padding: 0 1rem;
    }
    
    .hero h1 {
        font-size: 1.8rem;
        margin-bottom: 0.5rem;
    }
    
    .hero p {
        font-size: 1rem;
        margin-bottom: 1rem;
    }
    
    .profile-img {
        width: 100px;
        height: 100px;
        margin-bottom: 1rem;
    }
    
    .contact-info {
        gap: 0.8rem;
    }
    
    .contact-item {
        font-size: 0.9rem;
    }
    
    .section {
        padding: 40px 0;
        padding-left: 0.8rem;
        padding-right: 0.8rem;
    }
    
    .section h2 {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }
    
    .section h2::after {
        width: 50px;
        height: 2px;
        bottom: -8px;
    }
    
    .experience-item,
    .education-item,
    .project-item,
    .cert-item {
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: 8px;
    }
    
    .item-title {
        font-size: 1.1rem;
        line-height: 1.3;
    }
    
    .item-company {
        font-size: 0.9rem;
    }
    
    .item-description {
        font-size: 0.9rem;
    }
    
    .item-description ul {
        margin-left: 1rem;
    }
    
    .item-description li {
        margin-bottom: 0.3rem;
    }
    
    .gallery-img {
        height: 200px;
        font-size: 2rem;
    }
    
    .image-slider {
        height: 200px;
    }
    
    .gallery-content {
        padding: 0.8rem;
    }
    
    .tech-tag {
        padding: 0.2rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .award-badge {
        padding: 0.2rem 0.5rem;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.6rem;
    }
    
    .hero p {
        font-size: 0.95rem;
    }
    
    .section h2 {
        font-size: 1.6rem;
    }
    
    .item-title {
        font-size: 1rem;
    }
    
    .gallery-img {
        height: 180px;
    }
    
    .image-slider {
        height: 180px;
    }
    
    /* Volunteering section special handling for mobile */
    .gallery-item[style*="grid-column"] {
        grid-column: 1;
    }
    
    .gallery-img[style*="padding"] {
        padding: 1rem !important;
    }
    
    .gallery-img[style*="padding"] h3 {
        font-size: 1rem !important;
        margin-bottom: 0.8rem !important;
    }
    
    .gallery-img[style*="padding"] > div > div {
        flex-direction: column !important;
        gap: 0.8rem !important;
    }
    
    .gallery-img[style*="padding"] > div > div > div {
        text-align: center !important;
    }
    
    .gallery-img[style*="padding"] > div > div > div[style*="font-size: 1.5rem"] {
        display: none !important;
    }
}

@media (max-width: 360px) {
    .nav-container {
        padding: 0.3rem;
    }
    
    .logo {
        font-size: 1rem;
    }
    
    .hero {
        padding: 70px 0 30px;
    }
    
    .hero h1 {
        font-size: 1.4rem;
    }
    
    .hero p {
        font-size: 0.9rem;
    }
    
    .profile-img {
        width: 80px;
        height: 80px;
    }
    
    .section {
        padding: 30px 0;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    .section h2 {
        font-size: 1.4rem;
    }
    
    .experience-item,
    .education-item,
    .project-item,
    .cert-item {
        padding: 0.8rem;
    }
    
    .item-title {
        font-size: 0.95rem;
    }
    
    .item-description,
    .gallery-content p {
        font-size: 0.85rem;
    }
    
    .gallery-img {
        height: 160px;
    }
    
    .image-slider {
        height: 160px;
    }
}

/* Landscape orientation for tablets */
@media (max-width: 1024px) and (orientation: landscape) {
    .hero {
        padding: 90px 0 50px;
    }
    
    .hero h1 {
        font-size: 2.2rem;
    }
    
    .section {
        padding: 50px 0;
    }
    
    .gallery {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .profile-img {
        background-size: cover;
        image-rendering: -webkit-optimize-contrast;
    }
    
    .gallery-img video,
    .slider-image {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* Print styles */
@media print {
    .navbar,
    .nav-controls,
    .footer {
        display: none;
    }
    
    .hero {
        background: none;
        color: black;
        padding: 20px 0;
    }
    
    .section {
        padding: 20px 0;
        break-inside: avoid;
    }
    
    .experience-item,
    .education-item,
    .project-item,
    .cert-item {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .gallery {
        display: block;
    }
    
    .gallery-item {
        break-inside: avoid;
        margin-bottom: 20px;
    }
    
    .gallery-img {
        display: none;
    }
}

/* Focus and accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .slider-image {
        transition: none;
    }
    
    .toggle-btn,
    .toggle-point {
        transition: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --border-color: rgba(0,0,0,0.3);
    }
    
    .experience-item,
    .education-item,
    .project-item,
    .cert-item,
    .gallery-item {
        border: 2px solid var(--border-color);
    }
}