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

body, html {
    overflow: hidden;
    font-family: 'Roboto', sans-serif;
    color: white;
    background-color: #0a0a14;
}

#canvas {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 0;
}

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #0a0a14;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    transition: opacity 1s ease;
}

.loading-bar-container {
    width: 300px;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    margin-top: 20px;
    position: relative;
}

.loading-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #4284fd, #6b57ff);
    transition: width 0.3s ease;
}

.content {
    position: relative;
    z-index: 1;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

header {
    padding: 30px;
    pointer-events: auto;
}

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

.nav-logo {
    font-weight: 700;
    font-size: 1.5rem;
    color: white;
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

/* Mobile navigation menu */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 20;
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 10, 20, 0.95);
    z-index: 15;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.mobile-menu .nav-link {
    font-size: 1.2rem;
    padding: 15px 30px;
}

/* Specific styles for the main content area */
.main-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 10%;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease, transform 1s ease;
    flex: 1;
    z-index: 5; /* Lower z-index than sections */
}

.main-content.visible {
    opacity: 1;
    transform: translateY(0);
}

.section h2 {
    font-size: 2rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #6b57ff;
}

.job-experience, .project {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.job-experience:last-child, .project:last-child {
    border-bottom: none;
}

.job-title, .project-title {
    font-size: 1.4rem;
    color: #6b57ff;
    margin-bottom: 10px;
}

.job-company, .project-tech {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 10px;
}

.job-period {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 15px;
}

.job-description, .project-description {
    font-size: 1rem;
    line-height: 1.6;
}

.job-description li, .project-description li {
    margin-bottom: 10px;
    margin-left: 20px;
}

.close-button {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-button:hover {
    color: white;
}

.hero-title {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.1;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 30px;
}

.hero-description {
    font-size: 1.1rem;
    max-width: 600px;
    line-height: 1.6;
    margin-bottom: 40px;
    color: rgba(255, 255, 255, 0.9);
}

.cta-buttons {
    display: flex;
    gap: 20px;
    pointer-events: auto;
}

.cta-button {
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.cta-button.primary {
    background: linear-gradient(90deg, #4284fd, #6b57ff);
    color: white;
    border: none;
}

.cta-button.secondary {
    background: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.cta-button.primary:hover {
    background: linear-gradient(90deg, #5090ff, #7c68ff);
}

.cta-button.secondary:hover {
    border-color: white;
}

.skills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
}

.skill-tag {
    padding: 8px 16px;
    background: rgba(106, 87, 255, 0.2);
    border-radius: 50px;
    font-size: 0.9rem;
    color: white;
    display: inline-block;
}

.tech-stack {
    margin-top: 30px;
}

.tech-category {
    margin-bottom: 20px;
}

.tech-category h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: #6b57ff;
}

.contact-info {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.contact-item a {
    color: #6b57ff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-item a:hover {
    color: white;
    text-decoration: underline;
}

.scene-controls {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    gap: 15px;
    pointer-events: auto;
    z-index: 20; /* Increased z-index to be higher than mobile menu */
}

.scene-control {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(10, 10, 20, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.scene-control:hover {
    background: rgba(106, 87, 255, 0.3);
    transform: scale(1.1);
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(106, 87, 255, 0.5);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(106, 87, 255, 0.8);
}

/* Tooltip styles */
.tooltip {
    position: absolute;
    background: rgba(10, 10, 20, 0.9);
    color: white;
    padding: 10px 15px;
    border-radius: 4px;
    font-size: 0.9rem;
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    max-width: 200px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(106, 87, 255, 0.5);
}

.particle-counter {
    position: fixed;
    bottom: 30px;
    left: 30px;
    background: rgba(10, 10, 20, 0.7);
    padding: 10px 15px;
    border-radius: 50px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    pointer-events: auto;
    z-index: 10;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Ensure sections have proper overflow handling */
.section {
    position: fixed;
    width: 80%;
    max-width: 1000px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 40px;
    background: rgba(10, 10, 20, 0.95);
    border-radius: 10px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    z-index: 10;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    max-height: 80vh;
    overflow-y: auto;
    overflow-x: hidden;
    
    /* These properties help with touch scrolling */
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    overscroll-behavior: contain;
}

.section.active {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

/* When overlay is active, disable pointer events on canvas */
body.overlay-active #canvas {
    pointer-events: none;
}

/* Ensure 3D objects remain clickable when no overlay is active */
#canvas {
    pointer-events: auto !important;
}

/* IMPROVED MOBILE STYLES */
@media (max-width: 768px) {
    header {
        padding: 20px;
    }
    
    /* Hide desktop navigation and show mobile menu button */
    .nav-links {
        display: none;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .mobile-menu.active {
        display: flex;
    }
    
    /* Hero content adjustments */
    .hero-title {
        font-size: 2.5rem;
        margin-bottom: 15px;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
        margin-bottom: 20px;
    }
    
    .hero-description {
        font-size: 1rem;
        margin-bottom: 30px;
    }
    
    /* CTA buttons for mobile */
    .cta-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .cta-button {
        width: 100%;
        text-align: center;
        padding: 15px;
    }
    
    /* Section adjustments */
    .section {
        width: 95%;
        padding: 25px 20px;
        max-height: 85vh;
    }
    
    .section h2 {
        font-size: 1.8rem;
    }
    
    /* Adjust scene controls positioning */
    .scene-controls {
        bottom: 20px;
        right: 20px;
        gap: 10px;
    }
    
    .scene-control {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .particle-counter {
        bottom: 20px;
        left: 20px;
        font-size: 0.8rem;
    }
    
    /* Adjust contact info for mobile */
    .contact-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    /* Adjust tooltip for mobile */
    .tooltip {
        max-width: 150px;
        font-size: 0.8rem;
        padding: 8px 12px;
    }
    
    /* Additional spacing for touch targets */
    .job-description li, .project-description li {
        margin-bottom: 15px;
    }
    
    .skill-tag {
        margin-bottom: 5px;
    }
}

/* Specific adjustments for very small screens */
@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .main-content {
        padding: 0 5%;
    }
    
    .section {
        padding: 20px 15px;
    }
}

/* Portrait orientation adjustments for mobile */
@media (max-height: 600px) and (orientation: landscape) {
    .hero-title {
        font-size: 2rem;
        margin-bottom: 10px;
    }
    
    .hero-subtitle {
        margin-bottom: 15px;
    }
    
    .hero-description {
        margin-bottom: 20px;
    }
    
    .section {
        max-height: 80vh;
    }
}

.project-link {
    margin-top: 15px;
}

.project-link a {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(106, 87, 255, 0.2);
    border-radius: 4px;
    color: #6b57ff;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(106, 87, 255, 0.3);
}

.project-link a:hover {
    background: rgba(106, 87, 255, 0.4);
    color: white;
    transform: translateY(-2px);
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .project-link a {
        width: 100%;
        text-align: center;
    }
}

/* Education Section Styles */
.education-experience {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.education-title {
    font-size: 1.4rem;
    color: #6b57ff;
    margin-bottom: 10px;
}

.education-degree {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 5px;
}

.education-period {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 15px;
}

.education-details {
    margin-top: 20px;
}

.education-details h4 {
    font-size: 1.1rem;
    color: #6b57ff;
    margin-bottom: 10px;
    margin-top: 20px;
}

.education-activities {
    list-style-type: disc;
    padding-left: 20px;
    line-height: 1.6;
}

.education-activities li {
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.9);
}