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

/* While loading, disable transitions to avoid flicker on theme apply */
html.theme-preload, html.theme-preload * {
    transition: none !important;
    animation: none !important;
}

:root {
    /* Dark mode variables (default) */
    --bg-color: #000000;
    --text-color: #ffffff;
    --section-border: #333;
    --card-bg: #1a1a1b;
    --card-border: #343536;
    --secondary-text: #999;
    --hover-bg: #222;
    --input-bg: #000;
    --input-border: #222;
}

.light-mode {
    /* Light mode variables - improved contrast */
    --bg-color: #ffffff;
    --text-color: #000000;
    --section-border: #aaaaaa;
    --card-bg: #f0f0f0;
    --card-border: #cccccc;
    --secondary-text: #444444;
    --hover-bg: #e0e0e0;
    --input-bg: #ffffff;
    --input-border: #999999;
}

/* Apply background texture to html in light mode to ensure full coverage */
html.light-mode {
    background-image: 
        radial-gradient(#e6e6e6 1px, transparent 1px), 
        radial-gradient(#e6e6e6 1px, transparent 1px);
    background-size: 25px 25px;
    background-position: 0 0, 12.5px 12.5px;
    background-attachment: fixed;
    height: 100%;
    min-height: 100%;
}

/* Apply light mode class to body as well for theming */
body.light-mode {
    background-color: transparent; /* Make body transparent to show html background */
    min-height: 100vh;
}

body {
    font-family: 'Courier New', monospace;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.4;
    font-size: 14px;
    transition: background-color 0.3s, color 0.3s;
    min-height: 100vh; /* Ensure body takes full viewport height */
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: var(--bg-color);
    z-index: 1000;
    padding: 15px 0;
    border-bottom: 1px solid var(--section-border);
    transition: background-color 0.3s;
}

/* Desktop-only glass navbar in light mode (mobile unchanged) */
@media (min-width: 769px) {
    .light-mode nav {
        background: rgba(255, 255, 255, 0.55);
        -webkit-backdrop-filter: saturate(180%) blur(18px);
        backdrop-filter: saturate(180%) blur(18px);
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
    }
}

/* Desktop-only glass navbar in dark mode (mobile unchanged) */
@media (min-width: 769px) {
    body:not(.light-mode) nav {
        background: rgba(18, 18, 18, 0.55);
        -webkit-backdrop-filter: saturate(180%) blur(18px);
        backdrop-filter: saturate(180%) blur(18px);
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
    }
}

/* Theme Toggle Button */
#theme-toggle, #mobile-theme-toggle {
    cursor: pointer;
    font-size: 14px;
    color: var(--text-color);
    transition: transform 0.3s ease;
}

#theme-toggle:hover, #mobile-theme-toggle:hover {
    transform: rotate(45deg);
}

nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo img {
    width: 24px;
    height: 16px;
    object-fit: cover;
    border-radius: 2px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 25px;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: opacity 0.2s ease, color 0.3s;
    position: relative;
    padding-bottom: 5px;
}

.nav-links a:hover {
    opacity: 0.7;
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: #ffd700;
    border-radius: 50%;
}

/* Mobile Menu */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-btn span {
    width: 20px;
    height: 2px;
    background: #fff;
    margin: 2px 0;
    transition: all 0.3s ease;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

    .mobile-menu {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(34, 34, 34, 0.85) !important;
    border-top: 1px solid var(--section-border);
    padding: 20px 0;
    z-index: 2000;
    transition: border-color 0.3s;
}


    /* Removed light-mode link color overrides to keep mobile navbar identical across themes */

.light-mode .profile-btn,
.light-mode .resume-btn,
.light-mode .project-link {
    border-color: #000000;
    color: #000000;
}

.light-mode .profile-btn:hover,
.light-mode .resume-btn:hover,
.light-mode .project-link:hover {
    background-color: #000000;
    color: #ffffff;
}

.light-mode .skill-item {
    border-color: #999999;
}

.light-mode .skill-icon i,
.light-mode .skill-icon {
    color: #000000 !important;
}

.light-mode #contact .form-submit {
    background: #e0e0e0;
    color: #000000;
    border-color: #999999;
}

.light-mode #contact .form-submit:hover {
    background: #000000;
    color: #ffffff;
}

.light-mode .contact-link {
    background: #e0e0e0;
    color: #000000;
    border-color: #999999;
}

.light-mode .contact-link:hover {
    background: #000000;
    color: #ffffff;
}

.mobile-menu.active {
    display: block;
}

.mobile-menu ul {
    list-style: none;
    text-align: center;
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    align-items: stretch;
    margin: 0;
    padding: 0;
    height: 100%;
}

.mobile-menu li {
    flex: 1 1 0;
    margin: 0;
    height: 100%;
    display: flex;
}

.mobile-menu a {
    color: #fff;
    text-decoration: none;
    font-size: 9px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    text-align: center;
    transition: background 0.2s, color 0.2s;
    height: 100%;
    width: 100%;
    padding: 0;
    position: relative;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

.mobile-menu a:hover {
    opacity: 0.7;
}

.mobile-menu a.active, .mobile-menu a:active {
    background: transparent !important;
    color: #fff;
}

.mobile-menu a.active::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: #ffd700;
    border-radius: 50%;
}

/* Profile Style */
.profile-section {
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 100px;
    padding-bottom: 40px;
}

.profile-wrapper {
    max-width: 800px;
    width: 100%;
}

.profile-card {
    background-color: var(--card-bg);
    width: 100%;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    overflow: hidden;
    transition: background-color 0.3s, border-color 0.3s, box-shadow 0.3s;
}

/* Enhanced card style for light mode with texture */
.light-mode .profile-card {
    background-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
}

.profile-banner {
    height: 200px;
    background: url('../img/cover.jpg') center/cover;
    position: relative;
}

.profile-banner::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 70%);
}

.profile-content {
    padding: 0 20px 20px;
    position: relative;
    z-index: 1;
}

.profile-header {
    display: flex;
    align-items: flex-end;
    margin-bottom: 20px;
}

.profile-avatar {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 5px solid #1a1a1b;
    margin-top: -40px;
    background-color: #1a1a1b;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.profile-info {
    margin-left: 20px;
    padding-bottom: 10px;
}

.profile-name {
    font-size: 1.8rem;
    font-weight: bold;
}

.light-mode .profile-name {
    color: #000000;
}

.profile-handle {
    font-size: 0.9rem;
    color: #818384;
}

.light-mode .profile-handle {
    color: #555555;
}

.profile-motto {
    font-style: italic;
    color: #b0b3b5;
    margin-top: 8px;
    font-size: 0.9rem;
}

.light-mode .profile-motto {
    color: #666666;
}

.profile-about-container {
    margin-top: 40px;
}

.profile-about-headline {
    text-align: left;
    font-size: 1.5rem;
    margin-bottom: 20px;
    letter-spacing: 2px;
    font-weight: normal;
}

.profile-about-body {
    display: flex;
    align-items: center;
    gap: 20px;
}

.profile-bio {
    color: #d7dadc;
    line-height: 1.5;
    flex-grow: 1;
}

.light-mode .profile-bio {
    color: #000000;
}

.profile-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: flex-start;
    margin-top: 30px;
}

.profile-btn {
    display: inline-block;
    padding: 12px 28px;
    border: 2px solid #fff;
    color: #fff;
    background: transparent;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    text-decoration: none;
    letter-spacing: 2px;
    transition: background-color 0.2s, color 0.2s, border-color 0.3s;
    border-radius: 0;
    font-weight: normal;
}

.profile-btn:hover {
    background-color: #fff;
    color: #000;
}

.light-mode .profile-btn {
    border: 2px solid #000;
    color: #000;
    background: transparent;
}

.light-mode .profile-btn:hover {
    background-color: #000;
    color: #fff;
}

.profile-socials.outside {
    margin-top: 25px;
    padding: 20px 0;
    display: flex;
    justify-content: center;
    gap: 25px;
}

.profile-socials.outside a {
    color: #818384;
    font-size: 1.5rem;
    transition: color 0.2s;
}

.profile-socials.outside a:hover {
    color: #d7dadc;
}

.light-mode .profile-socials.outside a {
    color: #444444;
}

.light-mode .profile-socials.outside a:hover {
    color: #000000;
}

@media (max-width: 600px) {
    .profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .profile-avatar {
        width: 140px;
        height: 140px;
        margin-top: -70px;
    }
    .profile-info {
        margin-left: 15px;
        margin-top: 0;
    }
    .profile-name {
        font-size: 1.4rem;
    }
    .profile-about-body {
        flex-direction: column;
        text-align: center;
    }
    .profile-wrapper {
        padding: 0 10px;
    }
    .profile-about-container {
        text-align: center;
    }
    .profile-about-headline {
        text-align: center;
    }
    .profile-actions {
        justify-content: center;
    }
}

/* About Section */
.about {
    padding: 80px 0;
    border-top: 1px solid var(--section-border);
    transition: border-color 0.3s;
}

.section-title {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 40px;
    letter-spacing: 2px;
    font-weight: normal;
}

.about-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    align-items: start;
}

.about-text {
    font-size: 13px;
    color: #ccc;
    line-height: 1.7;
}

.about-text p {
    margin-bottom: 15px;
}

.resume-btn {
    display: inline-block;
    margin-top: 25px;
    padding: 10px 22px;
    border: 2px solid #fff;
    color: #fff;
    background: transparent;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    text-decoration: none;
    letter-spacing: 1px;
    transition: background 0.2s, color 0.2s;
}
.resume-btn:hover {
    background: #fff;
    color: #000;
}

.about-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.about-image img {
    width: 100%;
    max-width: 120px;
    border-radius: 8px;
}

/* Skills Section */
.skills {
    padding: 80px 0;
    border-top: 1px solid var(--section-border);
    transition: border-color 0.3s;
}

.skills-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-top: 40px;
}

.skill-category h3 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 15px;
    color: #fff;
    border-bottom: 1px solid #333;
    padding-bottom: 5px;
}

/* Make skill headlines visible in light mode */
.light-mode .skill-category h3 {
    color: #222;
}

.skill-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 5px;
}

.skill-item {
    text-align: center;
    padding: 10px 5px;
    border: 1px solid var(--section-border);
    transition: all 0.2s ease, background-color 0.3s, border-color 0.3s, box-shadow 0.3s;
    background: var(--hover-bg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.skill-item:hover {
    background: var(--card-bg);
}

/* Enhanced skill items for light mode with texture */
.light-mode .skill-item {
    background: rgba(255, 255, 255, 0.75);
    box-shadow: 0 1px 5px rgba(0,0,0,0.05);
}

.light-mode .skill-item:hover {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.skill-icon {
    font-size: 1.8rem;
    margin-bottom: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 30px;
    color: #fff;
}

.skill-name {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #999;
    line-height: 1.2;
}

.light-mode .skill-name {
    color: #444;
    font-weight: bold;
}

/* Projects Section */
.projects {
    padding: 80px 0;
    border-top: 1px solid var(--section-border);
    transition: border-color 0.3s;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.project-card {
    background: var(--hover-bg);
    border: 1px solid var(--section-border);
    padding: 20px;
    transition: all 0.2s ease, background-color 0.3s, border-color 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.project-card:hover {
    background: var(--card-bg);
}

/* Enhanced project cards for light mode with texture */
.light-mode .project-card {
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.light-mode .project-card:hover {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.project-image {
    width: 100%;
    height: 120px;
    background: 
        repeating-linear-gradient(
            45deg,
            #222 0px,
            #222 4px,
            #333 4px,
            #333 8px
        );
    margin-bottom: 15px;
    border: 1px solid #444;
}

.light-mode .project-image {
    background: 
        repeating-linear-gradient(
            45deg,
            #e0e0e0 0px,
            #e0e0e0 4px,
            #d0d0d0 4px,
            #d0d0d0 8px
        );
    border: 1px solid #aaa;
}

.project-title {
    font-size: 14px;
    margin-bottom: 8px;
    color: #fff;
    font-weight: normal;
}

.light-mode .project-title {
    color: #000;
    font-weight: bold;
}

.project-description {
    color: #999;
    margin-bottom: 15px;
    font-size: 12px;
    line-height: 1.5;
}

.light-mode .project-description {
    color: #333;
}

.project-tech {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.tech-tag {
    background: #222;
    padding: 3px 8px;
    font-size: 10px;
    border: 1px solid #444;
    color: #ccc;
}

.light-mode .tech-tag {
    background: #d0d0d0;
    border-color: #999;
    color: #333;
}

.project-links {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.project-link {
    color: #fff;
    text-decoration: none;
    padding: 6px 12px;
    border: 1px solid #555;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.2s ease;
}

.light-mode .project-link {
    color: #000;
    border: 1px solid #555;
}

.project-link:hover {
    background: #fff;
    color: #000;
}

/* Contact Section - unified style */
#contact {
    padding-top: 80px;
    padding-bottom: 60px;
    border-top: 1px solid #333;
    min-height: 100vh;
}
#contact .container {
    max-width: 420px;
    margin: 0 auto;
    padding: 0 16px;
}
#contact .section-title {
    margin-top: 0;
    margin-bottom: 32px;
    text-align: center;
    font-size: 1.5rem;
    letter-spacing: 2px;
    font-weight: normal;
}
#contact .contact-info {
    text-align: center;
    color: #999;
    margin-bottom: 24px;
}

.light-mode #contact .contact-info {
    color: #444;
}
#contact .contact-form {
    background: var(--hover-bg);
    border: 1px solid var(--section-border);
    padding: 18px 14px 14px 14px;
    margin-bottom: 0;
    border-radius: 6px;
    transition: background-color 0.3s, border-color 0.3s, box-shadow 0.3s;
}

/* Enhanced contact form for light mode with texture */
.light-mode #contact .contact-form {
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 3px 15px rgba(0,0,0,0.07);
}
#contact .form-group {
    margin-bottom: 14px;
}
#contact .form-group label {
    display: block;
    font-size: 10px;
    color: #999;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.light-mode #contact .form-group label {
    color: #333;
    font-weight: bold;
}
#contact .form-group input,
#contact .form-group textarea {
    width: 100%;
    padding: 8px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-color);
    font-family: 'Courier New', monospace;
    font-size: 12px;
    border-radius: 3px;
    transition: background-color 0.3s, border-color 0.3s, color 0.3s;
}
#contact .form-group textarea {
    min-height: 80px;
}
#contact .form-submit {
    background: #000;
    color: #fff;
    border: 1px solid #333;
    padding: 10px 0;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    width: 100%;
    border-radius: 3px;
    margin-top: 6px;
    transition: background 0.2s, color 0.2s;
}
#contact .form-submit:hover {
    background: #fff;
    color: #000;
    border-color: #fff;
}
#contact .contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 32px;
}
#contact .contact-link {
    background: #111;
    color: #fff;
    border: 1px solid #444;
    padding: 6px 18px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    font-family: 'Courier New', monospace;
    border-radius: 6px;
    transition: background 0.18s, color 0.18s, border-color 0.18s;
    text-align: center;
    display: inline-block;
    min-width: 90px;
    box-sizing: border-box;
    font-weight: 500;
}
#contact .contact-link:hover {
    background: #fff;
    color: #111;
    border-color: #ffd700;
}
@media (max-width: 600px) {
    #contact .contact-links {
        gap: 8px;
        margin-top: 24px;
    }
    #contact .contact-link {
        font-size: 12px;
        padding: 6px 12px;
        min-width: 70px;
    }
}

/* Footer */
footer {
    padding: 30px 0;
    text-align: center;
    border-top: 1px solid var(--section-border);
    color: var(--secondary-text);
    font-size: 11px;
    transition: border-color 0.3s, color 0.3s;
}

/* General Mobile Styles */
@media (max-width: 768px) {
    .nav-links,
    .mobile-menu-btn {
        display: none !important;
    }
    .mobile-menu {
        display: block !important;
        position: fixed;
        bottom: 16px;
        left: 50%;
        transform: translateX(-50%);
        width: calc(100vw - 24px);
        max-width: 500px;
        background: rgba(34, 34, 34, 0.85);
        border-radius: 16px;
        box-shadow: 0 4px 16px rgba(0,0,0,0.18);
        z-index: 2000;
        padding: 0;
        border: none;
        height: 48px;
    }
    .mobile-menu ul {
        display: flex;
        flex-direction: row;
        justify-content: space-around;
        align-items: stretch;
        margin: 0;
        padding: 0;
        height: 100%;
    }
    .mobile-menu li {
        flex: 1 1 0;
        margin: 0;
        height: 100%;
        display: flex;
    }
    .mobile-menu a {
        color: #fff;
        text-decoration: none;
        font-size: 10px;
        font-weight: 500;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 10px;
        text-align: center;
        transition: background 0.2s, color 0.2s;
        height: 100%;
        width: 100%;
        padding: 0;
        /* Prevent the gray tap highlight box on mobile Chrome */
        -webkit-tap-highlight-color: transparent;
    }
    /* Also remove default focus ring/box on tap for mobile navbar */
    .mobile-menu a:focus,
    .mobile-menu a:active {
        outline: none;
        box-shadow: none;
    }
    .mobile-menu a.active, .mobile-menu a:active {
        background: transparent !important;
        color: #fff;
    }

    /* Light-mode only: make mobile bottom nav light on phones */
    .light-mode .mobile-menu {
        background: rgba(255, 255, 255, 0.9) !important;
        border: 1px solid rgba(0, 0, 0, 0.08);
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    }
    .light-mode .mobile-menu a {
        color: #111 !important;
    }
    .light-mode .mobile-menu a.active,
    .light-mode .mobile-menu a:active {
        color: #111 !important;
    }
    .light-mode .mobile-menu a:focus,
    .light-mode .mobile-menu a:active {
        outline: none;
        box-shadow: none;
    }

    body {
        padding-bottom: 80px;
    }

    /* Fix for section padding on mobile */
    section {
        padding-top: 80px !important;
        min-height: calc(100vh - 80px) !important;
    }

    .section-title {
        margin-top: 0;
        padding-top: 20px;
    }

    /* Ensure content is visible on mobile */
    .container {
        padding-left: 20px;
        padding-right: 20px;
        width: 100%;
        box-sizing: border-box;
    }

    /* Adjust spacing for mobile navigation */
    nav {
        padding: 12px 0;
    }

    /* Fix for education section on mobile */
    .education-timeline {
        margin-top: 20px;
        padding-bottom: 60px;
    }

    /* Fix for projects section on mobile */
    .projects-grid {
        margin-top: 20px;
        padding-bottom: 60px;
    }

    /* Fix for contact section on mobile */
    .contact {
        padding-top: 80px !important;
        padding-bottom: 100px !important;
        min-height: calc(100vh - 80px) !important;
        justify-content: flex-start;
    }

    .contact .container {
        padding: 0 20px;
    }

    .contact .section-title {
        margin-top: 0;
        padding-top: 20px;
        margin-bottom: 30px;
    }

    .contact-info {
        margin-bottom: 30px;
        padding: 0 15px;
    }

    .contact-form {
        padding: 20px;
        margin: 0 auto 30px;
    }

    .contact-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
        padding: 0 15px;
        margin-top: 30px;
    }

    .contact-link {
        font-size: 9px;
        padding: 6px 12px;
    }

    .form-group {
        margin-bottom: 15px;
    }

    .form-submit {
        width: 100%;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Education Section */
.education {
    padding: 80px 0;
    border-top: 1px solid #333;
}

.education-timeline {
    margin-top: 40px;
}

.education-item {
    display: grid;
    grid-template-columns: 60px 1fr;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--section-border);
    transition: all 0.3s ease, border-color 0.3s;
}

.education-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.education-icon {
    width: 50px;
    height: 50px;
    background: var(--hover-bg);
    border: 1px solid var(--section-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: var(--text-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    overflow: hidden;
    border-radius: 4px;
    transition: background-color 0.3s, border-color 0.3s, color 0.3s, box-shadow 0.3s;
}

/* Enhanced education icon for light mode with texture */
.light-mode .education-icon {
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
}

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

.education-icon:hover img {
    transform: scale(1.1);
}

.education-item:hover {
    transform: translateX(5px);
}

.education-item:hover .education-icon {
    border-color: #444;
}

.education-content h3 {
    font-size: 14px;
    color: #fff;
    margin-bottom: 5px;
    font-weight: normal;
}

.light-mode .education-content h3 {
    color: #000;
    font-weight: 600;
}

.education-institution {
    font-size: 12px;
    color: #999;
    margin-bottom: 5px;
}

.light-mode .education-institution {
    color: #444;
    font-weight: 500;
}

.education-duration {
    font-size: 11px;
    color: #666;
    margin-bottom: 8px;
}

.light-mode .education-duration {
    color: #555;
}

.education-details {
    font-size: 11px;
    color: #ccc;
    line-height: 1.5;
}

.light-mode .education-details {
    color: #333;
}

.education-gpa {
    display: inline-block;
    background: #222;
    padding: 2px 6px;
    border: 1px solid #444;
    margin-top: 5px;
    font-size: 10px;
    color: #ccc;
}

/* Desktop Optimization */
@media (min-width: 768px) {
    .contact-form {
        max-width: 320px;
        padding: 25px;
    }

    .form-group {
        margin-bottom: 15px;
    }

    .form-group label {
        font-size: 8px;
        margin-bottom: 5px;
    }

    .form-group input,
    .form-group textarea {
        padding: 8px;
        font-size: 10px;
    }

    .form-group textarea {
        min-height: 80px;
    }

    .form-submit {
        padding: 8px 18px;
        font-size: 9px;
    }

    .contact-info {
        max-width: 300px;
        font-size: 10px;
    }
} 
.skill-icon i {
    color: #fff !important;
}

/* Responsive adjustments for smaller screens if needed */
@media (max-width: 480px) {
    .skills-categories {
        gap: 20px;
    }

    .skill-list {
         grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
         gap: 5px;
    }

    .skill-item {
        padding: 8px 3px;
    }

    .skill-icon {
        font-size: 1.5rem;
        height: 24px;
    }

    .skill-name {
        font-size: 8px;
    }
}

/* Desktop view on mobile browser - adjusting skills specifically */
@media screen and (max-width: 900px) and (min-resolution: 2dppx) {
     .skills-categories {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 30px;
    }

    .skill-list {
        grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
        gap: 8px;
    }

    .skill-item {
         padding: 12px 6px;
    }

    .skill-icon {
        font-size: 2rem;
        height: 35px;
    }

    .skill-name {
         font-size: 10px;
    }

    .skill-category h3 {
         font-size: 13px;
    }
}

.explore-more-btn {
    text-align: center;
    margin-top: 40px;
}

.explore-more-btn .project-link {
    display: inline-block;
    padding: 10px 20px;
    font-size: 12px;
    letter-spacing: 1px;
}

/* Style for hidden sections */
.hidden {
    display: none !important;
}

/* When a section is visible, ensure it takes full height */
section:not(.hidden) {
    min-height: 100vh;
}

/* Fit About, Contact to viewport and center content */
.about, .contact {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding-top: 0;
    padding-bottom: 0;
}
.about .container, .contact .container {
    width: 100%;
    max-width: 900px;
}
.about-content, .contact-info, .contact-form, .contact-links {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}
.about {
    padding: 0 !important;
}
.contact {
    padding: 0 !important;
}

/* Blog Section Styles */
#blog .container {
    padding-top: 80px;
    padding-bottom: 80px;
}

/* Force ALL sections to be transparent to show the html background */
section {
    background-color: transparent !important;
}

/* Ensure blog section has full height */
#blog {
    min-height: 100vh;
}

/* Remove any background styles that might interfere with the blog section */
.light-mode #blog, 
.light-mode #blog .container,
.light-mode #blog-posts-container,
.light-mode #blog-post-view {
    background-color: transparent !important;
}

.blog-section {
    width: 100%;
    min-height: 100vh;
}

#blog-posts-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    position: relative;
    z-index: 1;
}

.blog-card {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.3s, border-color 0.3s, color 0.3s;
}

/* Ensure blog cards have good contrast in light mode */
.light-mode .blog-card {
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 3px 10px rgba(0,0,0,0.12);
    border: 1px solid rgba(0,0,0,0.1);
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.blog-card-image {
    height: 240px;
    background-size: cover;
    background-position: center;
}

.blog-card-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.blog-card-content h3 {
    font-size: 1.2rem;
    margin: 0;
    line-height: 1.3;
    color: var(--text-color);
}

/* Styles for the embedded blog post view */
#blog-post-view {
    width: 100%;
}
.back-to-blog-btn {
    display: inline-block;
    margin-bottom: 20px;
    color: #ffd700;
    cursor: pointer;
    text-decoration: none;
    font-weight: bold;
}

.light-mode .back-to-blog-btn {
    color: #b8860b; /* Darker gold for light mode */
}
.back-to-blog-btn:hover {
    text-decoration: underline;
}
#blog-iframe {
    width: 100%;
    height: 80vh; /* Adjust height as needed */
    border: 1px solid #343536;
    border-radius: 8px;
    background-color: #1a1a1b; /* Dark background for the frame */
    transition: background-color 0.3s, border-color 0.3s;
}

.light-mode #blog-iframe {
    border-color: #999;
    background-color: #ffffff;
}

/* Force all section headlines to align */
section .section-title {
    text-align: center;
    font-size: 1.5rem;
    margin-top: 0 !important;
    margin-bottom: 40px !important;
    padding-top: 40px !important;
    letter-spacing: 2px;
    font-weight: normal;
}

@media (max-width: 768px) {
    section .section-title {
        padding-top: 40px !important;
        margin-top: 0 !important;
        margin-bottom: 30px !important;
    }
    section .container {
        padding-top: 0 !important;
    }
}

/* Remove extra padding from blog, contact, education containers */
#blog .container, .contact .container, .education .container {
    padding-top: 0 !important;
}

/* Add top padding to all sections for desktop to avoid navbar overlap */
section {
    padding-top: 80px;
    padding-bottom: 60px;
    border-top: 1px solid #333;
}

/* Alternating section backgrounds for light mode */
.light-mode section:nth-child(even) {
    background-image: 
        radial-gradient(#e0e0e0 1px, transparent 1px), 
        radial-gradient(#e0e0e0 1px, transparent 1px);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
    background-attachment: fixed;
}

/* Remove padding-top from .section-title on desktop */
section .section-title {
    padding-top: 0 !important;
}

@media (max-width: 768px) {
    section {
        padding-top: 60px !important;
        padding-bottom: 40px !important;
    }
    section .section-title {
        padding-top: 40px !important;
    }
}

/* Unify all section headline positions */
section {
    padding-top: 80px;
    padding-bottom: 60px;
    border-top: 1px solid var(--section-border);
    transition: border-color 0.3s;
}
#home {
    padding-top: 0;
    border-top: none;
}
.section-title {
    margin-top: 0;
    margin-bottom: 40px;
    padding-top: 0 !important;
    text-align: center;
    font-size: 1.5rem;
    letter-spacing: 2px;
    font-weight: normal;
}

/* Remove extra flex/justify from contact */
.contact {
    display: block;
    min-height: 100vh;
    align-items: initial;
    flex-direction: initial;
    justify-content: initial;
}

@media (max-width: 768px) {
    section {
        padding-top: 60px !important;
        padding-bottom: 40px !important;
    }
    .section-title {
        margin-bottom: 30px;
        font-size: 1.2rem;
    }
}

#contact .contact-form,
#contact .contact-link {
    border-radius: 0 !important;
}

#contact .contact-links {
    margin-top: 18px;
}

#contact .form-note {
    margin-bottom: 18px;
}

#contact .contact-link i {
    font-size: 20px;
    vertical-align: middle;
}

#contact .form-group input:focus,
#contact .form-group textarea:focus {
    outline: none;
    border-color: #969696;
    background: #000;
    color: #fff;
    box-shadow: none;
}

#contact .form-note {
    font-size: 10px !important;
}

#contact .form-group input::placeholder,
#contact .form-group textarea::placeholder {
    font-size: 10px;
}

#contact {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
#contact .container {
    margin: 0 auto;
}
    
