/* General Reset */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: Arial, sans-serif; }

body { display: flex; flex-direction: column; min-height: 100vh; transition: background 0.3s ease-in-out; padding-top: 80px; }

p { text-align: left;
  font-family: "Ubuntu", sans-serif;
  font-weight: 400;
  font-size: 18px; }

/* Navigation Bar */
nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    background: #f8f8f8;
    padding: 10px 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    max-height: 80px;
    overflow: hidden;
}
.tab {
padding: 8px 15px;
    margin: 3px;
    border-radius: 10px 10px 0 0;
    cursor: pointer;
    position: relative;
    transition: background 0.3s ease-in-out;
    text-align: center;
    background: transparent;
    min-width: 60px;
    max-width: 80px;
    height: 60px;                    
    display: flex;              
    flex-direction: column; 
    align-items: center;             
    justify-content: flex-start;     
}

.tab i {
     font-size: 20px;
    display: block;
    margin: 0 auto 3px auto;         
    color: #333;
    transition: color 0.3s;
    line-height: 1;                  
    position: relative;              
    top: 0;                     
}

.tab a {
    text-decoration: none;
    display: block;
    width: 100%;
    height: 100%;
}

.tab a i {
    margin: 0;
    padding: 0;
    vertical-align: baseline;
}

.tab span.tooltip {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 5px 8px;
    border-radius: 5px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}
.tab:hover span.tooltip { opacity: 1;
z-index: 99;}

/* Active Tab Styling */
.tab.active {
    background: transparent;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}
.tab.active i {
    color: red;  /* Active icon color */
}

/* Attach Tab to Page */
.tab.active, .page.active {
    background: inherit;
}

a {
    text-decoration: none;
}


    /* Page Content */
    #content { flex-grow: 1; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 20px; width: 100%; }
    .page {
        display: none;
        width: 80%;
        padding: 20px;
        border-radius: 10px;
        transition: opacity 0.3s ease-in-out;
    }
    .page.active {
        display: block;
        opacity: 1;
    }

    /* Home Page */
    .profile-pic { width: 150px; float: right; margin-left: 20px; }

    /* Pastel Colors */
    .home { background: transparent; }
    .coding { background: #000000; color: white; }
    .writing { background: #F8C8DC; }
    .cubing {background: linear-gradient(to bottom, #FFFACD, #FDFD96, #F0E68C);}
    .volunteering { background: #C2E1C2; }
    .travel { background: #D9C2E9; }
    .contact { background: #C2DFF2; }

    /* Icon Colors */
    .home i { color: #FFAA88; }
    .coding i { color: #00ff00; }
    .writing i { color: purple; }
    .cubing i { color: blue; }
    .volunteering i { color: brown; }
    .travel i { color: grey; }
    .contact i { color: #FF88AA; }

    /* Carousels */
.carousel-container {
display: flex;
justify-content: space-around;
}

.carousel {
text-align: center;
width: 30%;
position: relative;
}

.carousel img {
width: 100%;
height: 300px;
}

.prev, .next {
position: absolute;
top: 50%;
transform: translateY(-50%);
background: rgba(0, 0, 0, 0.5);
color: white;
border: none;
cursor: pointer;
}

.prev { left: 0; }
.next { right: 0; }

/* Dots */
.dots {
display: flex;
justify-content: center;
margin-top: 10px;
}

.dot {
width: 10px;
height: 10px;
background: lightgray;
border-radius: 50%;
margin: 5px;
}

.active-dot { background: gray; }

    /* Project Carousels */
    .project-section {
        margin: 40px 0;
        width: 100%;
    }
    
    /* Enhanced carousel for touch and scroll - ADD THIS */
.carousel-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    padding: 20px 0;
    touch-action: pan-x; /* Enable horizontal touch scrolling */
}

.project-carousel {
    display: flex;
    transition: transform 0.5s ease;
    will-change: transform;
    cursor: grab; /* Show grab cursor */
}

.project-carousel:active {
    cursor: grabbing; /* Show grabbing cursor when dragging */
}

.project-carousel.dragging {
    transition: none; /* Disable transition during drag */
}


    .project-section h2 {
        font-family: "Josefin Sans", sans-serif;
        font-size: 28px;
        margin-bottom: 20px;
        color: #333;
        text-align: center;
    }
    
        .project-section p {
        font-family: "Josefin Sans", sans-serif;
        font-size: 20px;
        margin-bottom: 10px;
        color: white;
        text-align: center;
    }

    .carousel-wrapper {
        position: relative;
        width: 100%;
        overflow: hidden;
        padding: 20px 0;
    }

    .carousel-nav {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        background: rgba(0, 0, 0, 0.5);
        color: white;
        border: none;
        border-radius: 50%;
        width: 50px;
        height: 50px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 20px;
        z-index: 10;
        transition: all 0.3s ease;
    }

    .carousel-nav:hover {
        background: rgba(0, 0, 0, 0.8);
        transform: translateY(-50%) scale(1.1);
    }

    .carousel-nav.prev {
        left: 10px;
    }

    .carousel-nav.next {
        right: 10px;
    }

    .carousel-wrapper {
        position: relative;
        width: 100%;
        overflow: hidden;
        padding: 20px 0;
    }

    .project-carousel {
        display: flex;
        transition: transform 0.5s ease;
        will-change: transform;
    }

    .project-box {
        width: calc(33.333% - 10px);
        height: 200px;
        border-radius: 15px;
        position: relative;
        cursor: pointer;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
        transform-origin: center;
        overflow: hidden;
        background-color: #f0f0f0;
        margin: 0 5px;
        flex-shrink: 0;
        box-sizing: border-box;
    }

    .project-box::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.4);
        transition: all 0.3s ease;
        border-radius: 15px;
    }

    .project-box:hover::before {
        background: rgba(0, 0, 0, 0.6);
    }

    .project-content {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 20px;
        color: white;
        z-index: 2;
        transform: translateY(0);
        transition: all 0.3s ease;
    }

    .project-content h3 {
        font-family: "Josefin Sans", sans-serif;
        font-size: 22px;
        font-weight: 600;
        margin-bottom: 8px;
        text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
    }

    .project-content p {
        font-family: "Ubuntu", sans-serif;
        font-size: 14px;
        font-style: normal;
        opacity: 0.9;
        text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
        text-align: left;
    }

    /* Center box scaling effect */
    .project-box:nth-child(3) {
        transform: scale(1.2);
        z-index: 3;
        box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    }

    .project-box:nth-child(3) .project-content h3 {
        font-size: 26px;
    }

    .project-box:nth-child(3) .project-content p {
        font-size: 16px;
    }

    /* Side boxes scaling effect */
    .project-box:nth-child(2),
    .project-box:nth-child(4) {
        transform: scale(0.9);
        opacity: 0.8;
    }

    .project-box:nth-child(1),
    .project-box:nth-child(5) {
        transform: scale(0.8);
        opacity: 0.6;
    }

    /* Hover effects */
    .project-box:hover {
        transform: scale(1.15) translateY(-5px);
        box-shadow: 0 20px 40px rgba(0,0,0,0.3);
        border-radius: 5px;
    }

    .project-box:nth-child(3):hover {
        transform: scale(1.3) translateY(-5px);
        border-radius: 5px;
    }

    /* Footer */
    footer { background: #333; color: white; text-align: center; padding: 10px; margin-top: auto; }

    /* Rubik's Cube Animation */
    @keyframes rotateCube {
        0% { transform: rotateX(0deg) rotateY(0deg); }
        25% { transform: rotateX(90deg) rotateY(0deg); }
        50% { transform: rotateX(90deg) rotateY(90deg); }
        75% { transform: rotateX(0deg) rotateY(90deg); }
        100% { transform: rotateX(0deg) rotateY(0deg); }
    }

    /* 3x3 Animated Rubik's Cube */
    .cube-container {
        perspective: 800px;
        margin: 20px auto;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .rubiks-cube {
        width: 80px;
        height: 80px;
        position: relative;
        transform-style: preserve-3d;
        animation: rotateCube 7.2s infinite linear;
    }

    .cube-face {
        position: absolute;
        width: 80px;
        height: 80px;
        border: 2px solid #333;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(3, 1fr);
        gap: 1px;
        box-shadow: inset 0 0 20px rgba(0,0,0,0.2);
    }

    .cube-square {
        width: 100%;
        height: 100%;
        border: 1px solid #333;
    }

    /* Cube Face Positioning */
    .front {
        transform: rotateY(0deg) translateZ(40px);
    }
    .back {
        transform: rotateY(180deg) translateZ(40px);
    }
    .right {
        transform: rotateY(90deg) translateZ(40px);
    }
    .left {
        transform: rotateY(-90deg) translateZ(40px);
    }
    .top {
        transform: rotateX(90deg) translateZ(40px);
    }
    .bottom {
        transform: rotateX(-90deg) translateZ(40px);
    }

    /* Override text color for coding page */
    .coding h1, .coding h2, .coding h3, .coding p, .coding span, .coding div {
        color: white !important;
    }

    /* Travel Polygons */
    .travel-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        max-width: 600px;
        margin: 0 auto;
    }

    .polygon {
        position: relative;
        cursor: pointer;
        transition: all 0.3s ease;
        margin: 2px;
        overflow: hidden;
        background-size: cover;
        background-position: center;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .polygon::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1;
    }

    .polygon-text {
        position: relative;
        z-index: 2;
        color: white;
        font-weight: bold;
        text-align: center;
        text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    }

    .polygon:hover {
        transform: scale(1.05);
        box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    }

    .polygon:hover::before {
        background: rgba(0,0,0,0.3);
    }

    /* Animated Gradient Background for Travel */
    .travel.page {
        background: linear-gradient(-45deg, #ff9a9e, #fad0c4, #a8edea, #fed6e3, #d299c2, #fef9d7, #c8b2db);
        background-size: 400% 400%;
        animation: gradientShift 10s ease infinite;
        width: 100vw;
        margin-left: calc(-50vw + 50%);
        padding-left: calc(50vw - 50%);
        padding-right: calc(50vw - 50%);
    }

    @keyframes gradientShift {
        0% {
            background-position: 0% 50%;
        }
        25% {
            background-position: 100% 50%;
        }
        50% {
            background-position: 100% 100%;
        }
        75% {
            background-position: 0% 100%;
        }
        100% {
            background-position: 0% 50%;
        }
    }

    /* Static Black Background for Coding Page */
    .coding.page {
        background: #000000 !important;
        color: white !important;
        width: 100vw;
        margin-left: calc(-50vw + 50%);
        padding-left: calc(50vw - 50%);
        padding-right: calc(50vw - 50%);
        position: relative;
        overflow: hidden;
    }

    .coding.page > * {
        position: relative;
        z-index: 2;
    }

    /* Contact Page Styling */
    .contact-content {
        position: relative;
        color: white;
        text-align: center;
        padding: 40px 20px;
        background: #f9f9f9;
        border-radius: 20px;
        margin: 20px;
        box-shadow: 0 4px 16px rgba(0, 0, 0);
        border: 1px solid #e0e0e0;
    }

    .contact-content h1 {
        font-family: "Josefin Sans", sans-serif;
        font-size: 3rem;
        margin-bottom: 30px;
    }

    .contact-info {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 20px;
        margin-bottom: 40px;
    }

/* Contact Cards */


.contact-card {
    position: relative;
    width: 100%;
    height: 150px;
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    background-size: cover;
    background-position: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
      color: white !important;
}

.contact-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    transition: all 0.3s ease;
}

.contact-card:hover::before {
    background: rgba(0,0,0,0.3);
}

.contact-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.contact-content {
    margin: 10px !important;
    padding: 20px 15px !important;
      color: white !important;
}
.contact-content h1 {
    font-size: 2rem !important;
    margin-bottom: 25px !important;
}
.contact-info {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
    margin-bottom: 25px !important;
}
.contact-card {
    height: 120px !important;
    border-radius: 10px !important;
}
.contact-overlay i {
    font-size: 1.8rem !important;
    margin-bottom: 6px !important;
}
.contact-overlay h3 {
    font-size: 1.2rem !important;
    margin-bottom: 3px !important;
    color: white !important;
}
.contact-overlay p {
    font-size: 0.9rem !important;
    text-align:center;
        color: white !important;
}
#map {
    height: 250px !important;
    margin: 20px 0 !important;
    border-radius: 10px !important;
}

.contact-card:hover .contact-overlay i {
    transform: scale(1.2);
}

    /* Responsive */
    @media (max-width: 768px), (orientation: portrait) {
    nav {
        max-height: 80px !important;
        padding: 8px 2px !important;
        justify-content: space-between !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
        gap: 1px;
        overflow: visible !important;
    }
    
    .tab {
        width: calc(12.5% - 2px) !important;
        min-width: 40px !important;
        max-width: 50px !important;
        height: 60px !important;
        margin: 1px !important;
        padding: 4px 2px !important;
        font-size: 11px !important;
        flex: 1 1 auto !important;
        box-sizing: border-box !important;
    }
    
    .tab i {
        font-size: 14px !important;
        margin-bottom: 1px !important;
    }
    
    .tab .tooltip {
        bottom: -28px !important;
        font-size: 8px !important;
        padding: 2px 4px !important;
        white-space: nowrap !important;
    }
    
    /* Keep normal body padding */
    body {
        padding-top: 80px !important;
    }
    
      .carousel-container { flex-direction: column; }
      .carousel { width: 100%; }
      .profile-pic { float: none; display: block; margin: 0 auto; }

      /* Mobile project carousel adjustments */
      .project-carousel {
          gap: 0px;
      }

      .project-box {
          flex: 0 0 45%;
          height: 150px;
          margin: 0 5px;
      }

      .project-content h3 {
          font-size: 18px;
      }

      .project-content p {
          font-size: 12px;
      }

      .project-box:nth-child(2) .project-content h3 {
          font-size: 20px;
      }

      .project-box:nth-child(2) .project-content p {
          font-size: 14px;
      }

      .carousel-nav {
          width: 40px;
          height: 40px;
          font-size: 16px;
      }

      .project-section h2 {
          font-size: 24px;
      }
    }

    /* Literary Writing Section Styles */
    .writing {
        background: linear-gradient(135deg, #F8BBD9 0%, #FFE5B4 50%, #E6F3E6 100%);
    }

    .literary-header {
        text-align: center;
        padding: 40px 20px 20px;
        position: relative;
    }

    .literary-header h1 {
        font-family: "Pacifico", cursive;
        font-size: 2.2rem;
        color: #2F1B14;
        text-shadow: 2px 2px 4px rgba(139, 69, 19, 0.3);
        margin-bottom: 15px;
    }

    .quill-decoration {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 15px;
        margin-bottom: 30px;
    }

    .quill-icon {
        font-size: 2rem;
        animation: float 3s ease-in-out infinite;
    }

    .ink-line {
        width: 200px;
        height: 2px;
        background: linear-gradient(90deg, transparent, #2F1B14, transparent);
        animation: expand 3s ease-in-out infinite alternate;
    }

    @keyframes float {
        0%, 100% { transform: translateY(0px); }
        50% { transform: translateY(-20px); }
    }

    @keyframes expand {
        0% { width: 150px; }
        100% { width: 160px; }
    }

    .literary-section {
        margin: 25px auto;
        max-width: 1000px;
        padding: 15px 25px;
        background: linear-gradient(135deg, #FFF8DC 0%, #FFE4E1 50%, #E6E6FA 100%);
        border-radius: 15px;
        box-shadow: 0 8px 25px rgba(255, 107, 157, 0.3);
        border: 2px solid rgba(255, 107, 157, 0.2);
        backdrop-filter: blur(10px);
        position: relative;
        overflow: hidden;
        cursor: pointer;
        transition: all 0.5s ease;
    }

    .literary-section::before {
        content: '';
        position: absolute;
        top: -100%;
        left: 0;
        width: 100%;
        height: 200%;
        background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 20"><path d="M0 10 Q25 0 50 10 T100 10" stroke="%23FF6B9D" stroke-width="0.5" fill="none" opacity="0.3"/></svg>');
        background-repeat: repeat-y;
        animation: scrollPattern 20s linear infinite;
        pointer-events: none;
    }

    @keyframes scrollPattern {
        0% { transform: translateY(0); }
        100% { transform: translateY(-20px); }
    }

    .literary-section.collapsed {
        max-height: 90px;
        overflow: hidden;
    }

    .literary-section.expanded {
        max-height: none;
    }

    .literary-section .section-content {
        transition: opacity 0.5s ease, transform 0.5s ease;
        transform: translateY(0);
    }

    .literary-section.collapsed .section-content {
        opacity: 0.3;
        transform: translateY(-20px);
    }

    .literary-section.expanded .section-content {
        opacity: 1;
        transform: translateY(0);
    }

    /* Scroll unroll effect */
    @media (min-width: 768px) {
        .literary-section:hover {
            transform: scale(1.02);
            box-shadow: 0 15px 40px rgba(255, 107, 157, 0.4);
        }

        .literary-section:hover .section-content {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .literary-section h2 {
        font-family: "Pacifico", cursive;
        font-size: 1.8rem;
        color: #8B4513;
        text-align: center;
        margin-bottom: 20px;
        position: relative;
    }

    .literary-section h2::after {
        content: '';
        display: block;
        width: 100px;
        height: 3px;
        background: linear-gradient(90deg, #8B4513, #D2691E, #8B4513);
        margin: 10px auto;
        border-radius: 2px;
    }

    .section-icon {
        font-size: 2rem;
        margin-right: 15px;
        vertical-align: middle;
    }

    /* Achievement Gallery */
    .achievement-gallery {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 20px;
        margin-top: 20px;
    }

    .achievement-card {
        background: transparent;
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 6px 20px rgba(139, 69, 19, 0.2);
        transition: transform 0.3s ease, box-shadow 0.3s ease;
        border: 1px solid rgba(139, 69, 19, 0.1);
    }

    .achievement-card:hover {
        transform: translateY(-8px);
        box-shadow: 0 15px 40px rgba(139, 69, 19, 0.3);
    }

    .achievement-image {
        width: 100%;
        height: 150px;
        overflow: hidden;
    }

    .achievement-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.3s ease;
    }

    .achievement-card:hover .achievement-image img {
        transform: scale(1.1);
    }

    .achievement-content {
        padding: 18px;
    }

    .achievement-content h3 {
        font-family: "Josefin Sans", serif;
        font-size: 1.1rem;
        color: #8B4513;
        margin-bottom: 8px;
    }

    .award-year {
        font-weight: bold;
        color: #D2691E;
        font-size: 0.95rem;
        margin-bottom: 12px;
    }

    .achievement-content p:last-child {
        color: #5D4037;
        line-height: 1.5;
        font-size: 0.9rem;
    }

    /* Works Grid */
    .works-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 20px;
        margin-top: 20px;
    }

    .work-card {
        position: relative;
        border-radius: 12px;
        overflow: hidden;
        height: 320px;
        cursor: pointer;
        transition: transform 0.3s ease;
    }

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

    .work-image {
        width: 100%;
        height: 100%;
        position: relative;
    }

    .work-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.3s ease;
    }

    .work-overlay {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        background: linear-gradient(transparent, rgba(47, 27, 20, 0.9));
        color: white;
        padding: 30px 20px 20px;
        transform: translateY(60%);
        transition: transform 0.3s ease;
    }

    .work-card:hover .work-overlay {
        transform: translateY(0);
    }

    .work-card:hover .work-image img {
        transform: scale(1.1);
    }

    .work-overlay h3 {
        font-family: "Josefin Sans", serif;
        font-size: 1.1rem;
        margin-bottom: 8px;
    }

    .work-overlay p {
        font-size: 0.8rem;
        line-height: 1.4;
        margin-bottom: 12px;
    }

    .read-link {
        display: inline-block;
        background: #D2691E;
        color: white;
        padding: 8px 16px;
        border-radius: 20px;
        text-decoration: none;
        font-weight: 500;
        transition: background 0.3s ease;
    }

    .read-link:hover {
        background: #8B4513;
    }

    .story-card {
        border: 3px solid #8B4513;
    }

    .poem-card {
        border: 3px solid #D2691E;
    }

    /* Favorites Section */
    .favorites-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
        gap: 25px;
        margin-top: 20px;
    }

    .favorite-category {
        background: transparent;
        padding: 18px;
        border-radius: 12px;
        box-shadow: 0 6px 20px rgba(139, 69, 19, 0.15);
    }

    .favorite-category h3 {
        font-family: "Josefin Sans", serif;
        font-size: 1.2rem;
        color: #8B4513;
        margin-bottom: 15px;
        text-align: center;
    }

    .category-icon {
        font-size: 1.5rem;
        margin-right: 10px;
    }

    .media-carousel {
        display: flex;
        gap: 15px;
        overflow-x: auto;
        padding: 10px 0;
        scrollbar-width: thin;
        scrollbar-color: #D2691E transparent;
    }

    .media-carousel::-webkit-scrollbar {
        height: 6px;
    }

    .media-carousel::-webkit-scrollbar-track {
        background: transparent;
    }

    .media-carousel::-webkit-scrollbar-thumb {
        background: #D2691E;
        border-radius: 3px;
    }

    .media-item {
        flex: 0 0 auto;
        text-align: center;
        transition: transform 0.3s ease;
    }

    .media-item:hover {
        transform: translateY(-8px);
    }

    .media-item img {
        width: 100px;
        height: 130px;
        object-fit: cover;
        border-radius: 6px;
        box-shadow: 0 3px 12px rgba(139, 69, 19, 0.3);
        transition: box-shadow 0.3s ease;
    }

    .media-item:hover img {
        box-shadow: 0 8px 25px rgba(139, 69, 19, 0.5);
    }

    .media-info {
        margin-top: 8px;
        max-width: 100px;
    }

    .media-info h4 {
        font-family: "Josefin Sans", serif;
        font-size: 0.8rem;
        color: #8B4513;
        margin-bottom: 4px;
        line-height: 1.1;
    }

    .media-info p {
        font-size: 0.7rem;
        color: #5D4037;
        line-height: 1.1;
    }

    /* Responsive Design for Writing Section */
    @media (max-width: 768px), screen and (orientation: portrait) {
        .literary-header h1 {
            font-size: 1.8rem;
        }

        .literary-section {
            margin: 15px;
            padding: 12px 18px;
        }

        .literary-section h2 {
            font-size: 1.4rem;
        }

        .literary-section.collapsed {
            max-height: 70px;
        }

        .achievement-gallery {
            grid-template-columns: 1fr;
            gap: 15px;
        }

        .works-grid {
            grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
            gap: 15px;
        }

        .work-card {
            height: 250px;
        }

       .favorites-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important;
        grid-template-columns: none !important;
    }
    
    .favorite-category {
        width: 100% !important;
        margin-bottom: 15px !important;
    }
    
    .favorite-category h3 {
        font-size: 1.1rem !important;
        margin-bottom: 12px !important;
    }
    
    .media-carousel {
        flex-direction: column !important;
        gap: 10px !important;
        overflow-x: visible !important;
        padding: 8px 0 !important;
    }
    
    .media-item {
        flex-direction: row !important;
        display: flex !important;
        align-items: center !important;
        text-align: left !important;
        padding: 8px !important;
        background: rgba(255, 255, 255, 0.7) !important;
        border-radius: 8px !important;
        margin-bottom: 5px !important;
    }
    
    .media-item img {
        width: 60px !important;
        height: 80px !important;
        margin-right: 12px !important;
        flex-shrink: 0 !important;
    }
    
    .media-info {
        flex-grow: 1 !important;
        max-width: none !important;
        text-align: left !important;
    }
    
    .media-info h4 {
        font-size: 0.9rem !important;
        margin-bottom: 2px !important;
    }
    
    .media-info p {
        font-size: 0.75rem !important;
        opacity: 0.8 !important;
    }
    
        .contact-content {
        padding: 18px 8px !important;
        width: calc(100vw - 6px) !important;
        margin-right: 20px;
    }
    .contact-info {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px !important;
        width: 100% !important;
    }
    }
    

    /* Volunteering Section Styles */
    .volunteering {
        background: linear-gradient(135deg, #E8F5E8 0%, #F0F8F0 50%, #E0F0E0 100%);
    }

    .volunteering-header {
        text-align: center;
        max-width: 1000px;
        margin: 0 auto 60px;
    }

    .volunteering-header h1 {
        font-family: "Pacifico", cursive;
        font-size: 2.8rem;
        color: #2E7D32;
        margin-bottom: 30px;
        text-shadow: 2px 2px 4px rgba(46, 125, 50, 0.3);
    }

    .volunteering-intro {
        background: rgba(255, 255, 255, 0.9);
        padding: 30px;
        border-radius: 20px;
        box-shadow: 0 8px 25px rgba(46, 125, 50, 0.2);
        border: 2px solid rgba(46, 125, 50, 0.1);
    }

    .volunteering-intro p {
        font-size: 1.1rem;
        line-height: 1.7;
        color: #2E7D32;
        font-family: "Ubuntu", sans-serif;
        margin: 0;
    }
    

    .timeline-container {
        max-width: 1200px;
        margin: 0 auto;
        position: relative;
    }

    .timeline-container h2 {
        font-family: "Pacifico", cursive;
        font-size: 2.2rem;
        color: #2E7D32;
        text-align: center;
        margin-bottom: 50px;
    }

    .tree-timeline {
        position: relative;
        padding: 20px 0;
    }

    /* Vertical timeline for all screen sizes */
    .tree-timeline::before {
        content: '';
        position: absolute;
        left: 50%;
        top: 0;
        bottom: 0;
        width: 6px;
        background: linear-gradient(to bottom, #8B4513, #A0522D, #CD853F, #DEB887);
        transform: translateX(-50%);
        border-radius: 3px;
        box-shadow: 0 0 8px rgba(139, 69, 19, 0.3);
        transform-origin: top center;
        animation: growBranch 3s ease-out;
    }

    @keyframes growBranch {
        0% {
            height: 0;
            transform: translateX(-50%) scaleY(0);
        }
        100% {
            height: 100%;
            transform: translateX(-50%) scaleY(1);
        }
    }

    .timeline-event {
        position: relative;
        margin-bottom: 40px;
        width: 100%;
        display: flex;
        align-items: center;
        opacity: 0;
        animation: fadeInEvent 0.8s ease-in-out forwards;
        animation-delay: calc(var(--index, 0) * 0.4s + 0.5s);
    }

    @keyframes fadeInEvent {
        0% {
            opacity: 0;
            transform: translateY(30px);
        }
        100% {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .timeline-event:nth-child(odd) {
        justify-content: flex-start;
        padding-left: calc(50% + 40px);
    }

    .timeline-event:nth-child(even) {
        justify-content: flex-end;
        padding-right: calc(50% + 40px);
    }

    .event-marker {
        width: 20px;
        height: 20px;
        background: radial-gradient(circle, #8B4513, #654321);
        border-radius: 50%;
        border: 4px solid #fff;
        box-shadow: 0 4px 12px rgba(139, 69, 19, 0.4);
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        margin: 0;
        z-index: 10;
        animation: pulse 2s infinite;
    }

    .event-marker.current {
        background: radial-gradient(circle, #FF5722, #E64A19);
        box-shadow: 0 4px 12px rgba(255, 87, 34, 0.4);
        animation: pulseActive 1.5s infinite;
    }

    @keyframes pulse {
        0%, 100% {
            transform: translateX(-50%) scale(1);
            box-shadow: 0 4px 12px rgba(139, 69, 19, 0.4);
        }
        50% {
            transform: translateX(-50%) scale(1.1);
            box-shadow: 0 6px 20px rgba(139, 69, 19, 0.6);
        }
    }

    @keyframes pulseActive {
        0%, 100% {
            transform: translateX(-50%) scale(1);
            box-shadow: 0 4px 12px rgba(255, 87, 34, 0.4);
        }
        50% {
            transform: translateX(-50%) scale(1.2);
            box-shadow: 0 8px 25px rgba(255, 87, 34, 0.8);
        }
    }

    .event-content {
        background: rgba(255, 255, 255, 0.95);
        padding: 20px;
        border-radius: 15px;
        box-shadow: 0 8px 25px rgba(46, 125, 50, 0.2);
        border: 2px solid rgba(76, 175, 80, 0.3);
        max-width: 350px;
        text-align: center;
        backdrop-filter: blur(10px);
        transition: all 0.3s ease;
    }

    .timeline-event:nth-child(odd) .event-content {
        margin-left: 0;
    }

    .timeline-event:nth-child(even) .event-content {
        margin-right: 0;
    }

    /* Add connecting lines */
    .timeline-event::after {
        content: '';
        position: absolute;
        width: 30px;
        height: 3px;
        background: linear-gradient(to right, #8B4513, #A0522D);
        top: 50%;
        z-index: 5;
        border-radius: 2px;
        box-shadow: 0 1px 3px rgba(139, 69, 19, 0.3);
    }

    .timeline-event:nth-child(odd)::after {
        left: 50%;
        margin-left: 10px;
    }

    .timeline-event:nth-child(even)::after {
        right: 50%;
        margin-right: 10px;
    }

    .event-content:hover {
        transform: translateY(-5px);
        box-shadow: 0 12px 35px rgba(46, 125, 50, 0.3);
    }

    .event-content h3 {
        font-family: "Pacifico", cursive;
        font-size: 1.2rem;
        color: #2E7D32;
        margin-bottom: 10px;
    }

    .event-content h4 {
        font-family: "Josefin Sans", serif;
        font-size: 1.1rem;
        color: #4CAF50;
        margin-bottom: 12px;
        font-weight: 600;
    }

    .event-content p {
        font-size: 0.9rem;
        color: #558B5B;
        line-height: 1.5;
        margin: 0;
    }

    /* Mobile adjustments */
    @media (max-width: 767px) {
        

        .volunteering-header h1 {
            font-size: 28px;
        }

        .timeline-container h2 {
            font-size: 26px;
        }
        
        .volunteering-header h1 {
            font-size: 2.2rem;
        }

        .timeline-container h2 {
            font-size: 1.8rem;
        }

        .timeline-event:nth-child(odd) {
            padding-left: calc(50% + 30px);
        }

        .timeline-event:nth-child(even) {
            padding-right: calc(50% + 30px);
        }

        .event-content {
            max-width: 280px;
        }

        .timeline-event::after {
            width: 20px;
        }
    }

    /* Smaller mobile adjustments */
    @media (max-width: 480px) {

        .volunteering-intro {
            padding: 20px;
        }

        .volunteering-intro p {
            font-size: 1rem;
        }

        .event-content {
            padding: 15px;
            max-width: 200px;
        }

        .event-content h3 {
            font-size: 1rem;
        }

        .event-content h4 {
            font-size: 0.95rem;
        }

        .event-content p {
            font-size: 0.8rem;
        }
    }