* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --accent: #6366f1;
    --accent-hover: #4f52e0;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --border-color: rgba(255, 255, 255, 0.1);
}

body.light {
    --bg-primary: #f5f5f5;
    --bg-secondary: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #4a4a4a;
    --glass-bg: rgba(0, 0, 0, 0.05);
    --border-color: rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    background-size: 400% 400%;
    animation: bgMove 15s ease infinite;
    color: var(--text-primary);
    min-height: 100vh;
    transition: background-color 0.3s, color 0.3s;
}

@keyframes bgMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* GLASS EFFECT */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 15px;
}

/* NAVIGATION */
nav {
    position: fixed;
    top: 20px;
    left: 20px;
    right: 20px;
    z-index: 1000;
    border-radius: 50px;
    padding: 1rem 2rem;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-primary);
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--accent);
}

.nav-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* BUTTONS */
.btn {
    padding: 0.8rem 2rem;
    border-radius: 25px;
    text-decoration: none;
    transition: all 0.3s;
    display: inline-block;
    font-weight: 500;
}

.btn-small {
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    border: 2px solid var(--accent);
    color: var(--text-primary);
}

.theme-btn, .mobile-menu {
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1.2rem;
}

/* HERO SECTION */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 2rem;
}

.hero-content {
    max-width: 800px;
    padding: 3rem;
    text-align: center;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.highlight {
    color: var(--accent);
}

.typed-text {
    font-size: 2rem;
    margin-bottom: 1rem;
    min-height: 3rem;
}

.cursor {
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* SECTIONS */
.section {
    padding: 5rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--accent);
}

/* ABOUT */
.about-container {
    padding: 3rem;
    text-align: center;
}

.about-text {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
}

.about-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 2rem;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--accent);
}

/* SKILLS */
.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.skill-card {
    padding: 2rem;
}

.skill-items {
    margin-top: 1.5rem;
}

.skill {
    margin-bottom: 1.5rem;
}

.skill span {
    display: block;
    margin-bottom: 0.5rem;
}

.skill-bar {
    height: 10px;
    background: var(--border-color);
    border-radius: 5px;
    overflow: hidden;
}

.skill-bar div {
    height: 100%;
    background: var(--accent);
    width: 0;
    transition: width 1s ease;
}

/* MODULES SECTION */
#modules {
    scroll-margin-top: 80px;
}

.modules-container {
    padding: 3rem;
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.module-category {
    background: var(--glass-bg);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    transition: transform 0.3s;
}

.module-category:hover {
    transform: translateY(-5px);
}

.module-category h3 {
    color: var(--accent);
    margin-bottom: 1.2rem;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.module-category h3 i {
    font-size: 1.2rem;
}

.module-list {
    list-style: none;
}

.module-list li {
    padding: 0.7rem 0;
    border-bottom: 1px dashed var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--text-primary);
}

.module-list li:last-child {
    border-bottom: none;
}

.module-badge {
    font-size: 1.2rem;
    min-width: 30px;
}

/* Timeline layout */
.module-timeline {
    margin: 3rem 0;
    padding: 2rem;
    background: var(--glass-bg);
    border-radius: 15px;
    border: 1px solid var(--border-color);
}

.module-timeline h3 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--accent);
}

.timeline-items {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline-items::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    height: 100%;
    width: 2px;
    background: var(--accent);
}

@media (min-width: 768px) {
    .timeline-items::before {
        left: 50%;
        transform: translateX(-50%);
    }
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
    padding-left: 50px;
}

@media (min-width: 768px) {
    .timeline-item {
        padding-left: 0;
        width: 50%;
    }
    
    .timeline-item:nth-child(even) {
        margin-left: 50%;
        padding-left: 30px;
    }
    
    .timeline-item:nth-child(odd) {
        padding-right: 30px;
        text-align: right;
    }
}

.timeline-dot {
    position: absolute;
    left: 10px;
    top: 5px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent);
    border: 3px solid var(--bg-primary);
    box-shadow: 0 0 0 3px var(--accent);
}

@media (min-width: 768px) {
    .timeline-dot {
        left: auto;
        right: -10px;
    }
    
    .timeline-item:nth-child(even) .timeline-dot {
        left: -10px;
        right: auto;
    }
}

.timeline-content {
    background: var(--glass-bg);
    padding: 1rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.timeline-content h4 {
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.timeline-content p {
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Skill tags from modules */
.module-skills {
    margin-top: 2rem;
    padding: 2rem;
    background: var(--glass-bg);
    border-radius: 15px;
    border: 1px solid var(--border-color);
}

.module-skills h3 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--accent);
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    justify-content: center;
}

.skill-tag {
    background: var(--accent);
    color: white;
    padding: 0.5rem 1.2rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s;
    cursor: default;
    opacity: 0.9;
}

.skill-tag:hover {
    transform: scale(1.05);
    opacity: 1;
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.3);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .modules-container {
        padding: 1.5rem;
    }
    
    .module-category {
        padding: 1rem;
    }
    
    .skill-tags {
        gap: 0.5rem;
    }
    
    .skill-tag {
        padding: 0.3rem 1rem;
        font-size: 0.8rem;
    }
}

/* Mobile Menu Styles - Enhanced */
@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 80px;
        left: 20px;
        right: 20px;
        background: var(--glass-bg);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        border: 1px solid var(--border-color);
        border-radius: 15px;
        padding: 1rem;
        display: none;
        flex-direction: column;
        gap: 0.5rem;
        z-index: 9999; /* High z-index to stay above content */
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
        max-height: 80vh;
        overflow-y: auto;
    }
    
    .nav-links.active {
        display: flex;
        animation: slideDown 0.3s ease;
    }
    
    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .nav-links li {
        width: 100%;
        margin: 0;
        padding: 0;
    }
    
    .nav-links a {
        display: block;
        padding: 1rem;
        text-align: center;
        border-radius: 10px;
        transition: all 0.3s;
        font-size: 1.1rem;
        color: var(--text-primary);
    }
    
    .nav-links a:hover {
        background: var(--accent);
        color: white;
        transform: translateX(5px);
    }
    
    /* Overlay to cover content when menu is open */
    .menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(3px);
        -webkit-backdrop-filter: blur(3px);
        z-index: 9998;
        display: none;
        animation: fadeIn 0.3s ease;
    }
    
    .menu-overlay.active {
        display: block;
    }
    
    @keyframes fadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }
    
    /* Ensure nav stays above content but below menu */
    nav {
        z-index: 10000;
    }
    
    /* Adjust mobile menu button */
    .mobile-menu {
        font-size: 1.5rem;
        padding: 0.5rem 1rem;
        z-index: 10001;
        position: relative;
    }
    
    /* Prevent body scroll when menu open */
    body.menu-open {
        overflow: hidden;
    }
}

/* Add to style.css */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.fa-spinner {
    animation: spin 1s linear infinite;
}

.success-message {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Desktop styles */
@media (min-width: 769px) {
    .nav-links {
        display: flex !important;
        flex-direction: row;
        position: static;
        background: none;
        backdrop-filter: none;
        border: none;
        padding: 0;
        box-shadow: none;
    }
    
    .menu-overlay {
        display: none !important;
    }
    
    .mobile-menu {
        display: none;
    }
}

/* PROJECTS */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card {
    padding: 1.5rem;
    cursor: pointer;
    transition: transform 0.3s;
}

.project-card:hover {
    transform: translateY(-10px);
}

.project-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 1rem;
}

.project-tech {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.project-tech span {
    background: var(--accent);
    color: white;
    padding: 0.2rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
}

/* MODAL */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 2rem;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-primary);
}

/* CONTACT */
.contact-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 3rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
}

/* FOOTER */
footer {
    text-align: center;
    padding: 2rem;
    background: var(--glass-bg);
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .typed-text {
        font-size: 1.5rem;
    }
    
    .about-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .mobile-menu {
        display: block;
    }
}

@media (min-width: 769px) {
    .mobile-menu {
        display: none;
    }
}