/* Base Styles */

:root {
    --dark-bg: #121212;
    --dark-surface: #1e1e1e;
    --primary: #bb86fc;
    --secondary: #03dac6;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
}

/* Light Theme */
[data-theme="light"] {
    --dark-bg: #f5f5f5;
    --dark-surface: #ffffff;
    --primary: #6200ee;
    --secondary: #018786;
    --text-primary: #212121;
    --text-secondary: #666666;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--dark-bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Performance Optimization */
.animate-item,
.project-card,
.skill-level {
    will-change: transform, opacity;
}

.animate-visible {
    will-change: auto;
}

/* Enhanced Animation Elements */

.animate-item {
    opacity: 0;
    transform: translateY(30px);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-visible {
    animation: fadeInUp 0.8s ease forwards;
}

.animate-delay-1 {
    animation-delay: 0.2s;
}

.animate-delay-2 {
    animation-delay: 0.4s;
}

.animate-delay-3 {
    animation-delay: 0.6s;
}

.animate-delay-4 {
    animation-delay: 0.8s;
}

/* Navigation */

nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background-color: rgba(18, 18, 18, 0.9);
    backdrop-filter: blur(10px);
    z-index: 100;
    transition: all 0.3s ease;
}

[data-theme="light"] nav {
    background-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

nav.scrolled {
    padding: 1rem 2rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--primary);
    transition: width 0.3s ease;
}

.nav-links a:hover,
.nav-links a:focus {
    color: var(--primary);
}

.nav-links a:focus {
    outline: 2px solid var(--primary);
    outline-offset: 4px;
    border-radius: 2px;
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-links a.active {
    color: var(--primary);
}

.nav-links a.active::after {
    width: 100%;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 101;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--text-primary);
    margin: 3px 0;
    transition: all 0.3s ease;
    border-radius: 3px;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Profile Photo */

.profile-container {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.profile-photo {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--primary);
    box-shadow: 0 0 25px rgba(187, 134, 252, 0.5);
    animation: pulse 2s infinite;
}

.profile-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(187, 134, 252, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(187, 134, 252, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(187, 134, 252, 0);
    }
}

/* Hero Section */

#home {
    position: relative;
    background-color: var(--dark-bg);
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.hero-title {
    font-size: 4rem;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 2rem;
}

.hero-description {
    max-width: 600px;
    margin: 0 auto 2rem;
    color: var(--text-secondary);
}

.highlight {
    color: var(--primary);
}

.cta-button {
    display: inline-block;
    padding: 0.8rem 2rem;
    background-color: var(--primary);
    color: #121212;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.cta-button:hover {
    background-color: #a160e0;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.cta-button:focus {
    outline: 2px solid var(--primary);
    outline-offset: 4px;
}

/* About Section */

#about {
    background-color: var(--dark-surface);
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -10px;
    width: 50px;
    height: 4px;
    background-color: var(--primary);
}

.skills {
    display: flex;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.skill-tag {
    background-color: rgba(187, 134, 252, 0.1);
    color: var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 30px;
    margin: 0.5rem;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.skill-tag:hover {
    background-color: rgba(187, 134, 252, 0.3);
    transform: translateY(-5px);
}

/* Skills Section */

#skills {
    background-color: var(--dark-bg);
}

.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.skills-category {
    background-color: var(--dark-surface);
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.skills-category:hover {
    transform: translateY(-10px);
}

.skills-category-title {
    margin-bottom: 1.5rem;
    color: var(--primary);
    font-size: 1.3rem;
    position: relative;
    display: inline-block;
}

.skills-category-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -8px;
    width: 30px;
    height: 3px;
    background-color: var(--primary);
}

.skills-grid {
    display: grid;
    gap: 1.5rem;
}

.skill-item {
    margin-bottom: 1rem;
}

.skill-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.skill-bar {
    height: 8px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

[data-theme="light"] .skill-bar {
    background-color: rgba(0, 0, 0, 0.1);
}

.skill-level {
    height: 100%;
    background-color: var(--primary);
    border-radius: 10px;
    width: 0;
    transition: width 1.5s ease-in-out;
}

.skill-level.other {
    background-color: var(--secondary);
}

/* Experience Section */

#experience {
    background-color: var(--dark-surface);
}

.experience-timeline {
    position: relative;
    max-width: 800px;
    margin: 2rem auto 0;
}

.experience-timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    background-color: rgba(187, 134, 252, 0.3);
}

.experience-item {
    position: relative;
    margin-bottom: 3rem;
    width: 100%;
    display: flex;
    justify-content: center;
}

.experience-item::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 2.5rem;
    width: 16px;
    height: 16px;
    background-color: var(--primary);
    border-radius: 50%;
    transform: translateX(-50%);
    z-index: 1;
    box-shadow: 0 0 0 4px var(--dark-surface);
}

.experience-date {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--primary);
    color: #121212;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: bold;
    z-index: 2;
    white-space: nowrap;
    font-size: 0.9rem;
}

.experience-content {
    background-color: rgba(30, 30, 30, 0.7);
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 3rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    width: 85%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

[data-theme="light"] .experience-content {
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.experience-content:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.experience-title {
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.experience-company {
    color: var(--secondary);
    font-weight: 500;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.experience-description {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Projects Section */

#projects {
    background-color: var(--dark-bg);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.project-card {
    background-color: var(--dark-surface);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.5s ease, box-shadow 0.5s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}

.project-card:hover {
    transform: translateY(-15px) scale(1.03);
    box-shadow: 0 20px 30px rgba(0, 0, 0, 0.3);
}

.project-img {
    width: 100%;
    height: 200px;
    background-color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    position: relative;
    overflow: hidden;
}

.project-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.project-card:hover .project-img img {
    transform: scale(1.05);
}

.project-img::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.7s ease;
    z-index: 1;
}

.project-card:hover .project-img::before {
    left: 100%;
}

.project-info {
    padding: 1.5rem;
}

.project-title {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    margin: 1rem 0;
}

.project-tag {
    background-color: rgba(3, 218, 198, 0.1);
    color: var(--secondary);
    padding: 0.3rem 0.6rem;
    border-radius: 30px;
    margin: 0.3rem;
    font-size: 0.8rem;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.project-tag:hover {
    background-color: rgba(3, 218, 198, 0.2);
    transform: translateY(-2px);
}

/* Contact Section */

#contact {
    background-color: var(--dark-surface);
}

/* Updated Contact Options */

.contact-options {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 3rem;
    gap: 2rem;
}

.mail-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background-color: var(--primary);
    color: #121212;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    box-shadow: 0 10px 25px rgba(187, 134, 252, 0.3);
}

.mail-button:hover {
    background-color: #a160e0;
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(187, 134, 252, 0.4);
}

.mail-button:focus {
    outline: 2px solid var(--primary);
    outline-offset: 4px;
}

.mail-button svg {
    transition: transform 0.3s ease;
}

.mail-button:hover svg {
    transform: translateX(-3px);
}

#contact .social-links {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
}

#contact .social-link {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="light"] #contact .social-link {
    background-color: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

#contact .social-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--primary);
    border-radius: 50%;
    transform: scale(0);
    transition: transform 0.3s ease;
    z-index: -1;
}

#contact .social-link:hover {
    transform: translateY(-5px);
    color: #121212;
}

#contact .social-link:focus {
    outline: 2px solid var(--primary);
    outline-offset: 4px;
}

#contact .social-link:hover::before {
    transform: scale(1);
}

/* Footer */

footer {
    background-color: var(--dark-bg);
    padding: 2rem;
    text-align: center;
}

.made-with-love {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.heart {
    color: #ff4d6d;
    display: inline-block;
    animation: heartBeat 1.5s infinite;
}

@keyframes heartBeat {
    0% {
        transform: scale(1);
    }
    14% {
        transform: scale(1.3);
    }
    28% {
        transform: scale(1);
    }
    42% {
        transform: scale(1.3);
    }
    70% {
        transform: scale(1);
    }
}

/* Particles.js */

#particles-js {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 0;
}

[data-theme="light"] #particles-js {
    opacity: 0.3;
}

/* Dark mode toggle button */

.theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    border: none;
}

.theme-toggle:hover {
    transform: scale(1.1);
}

.theme-toggle:focus {
    outline: 2px solid var(--primary);
    outline-offset: 4px;
}

.theme-toggle svg {
    width: 24px;
    height: 24px;
    color: #121212;
}

/* Scroll to top button */

.scroll-top {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
    background-color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    border: none;
}

.scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    transform: translateY(-5px);
}

.scroll-top:focus {
    outline: 2px solid var(--primary);
    outline-offset: 4px;
}

.scroll-top svg {
    width: 24px;
    height: 24px;
    color: #121212;
}

/* Loading animation */

.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--dark-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
}

.loader-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(187, 134, 252, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loader-text {
    color: var(--primary);
    font-size: 1.2rem;
    letter-spacing: 3px;
}

/* Responsive Design */

@media (max-width: 1280px) {
    .container {
        max-width: 1024px;
    }
}

@media (max-width: 992px) {
    .hero-title {
        font-size: 3rem;
    }
    
    .experience-timeline::before {
        left: 30px;
    }
    
    .experience-item::before {
        left: 30px;
        transform: none;
    }
    
    .experience-date {
        left: 70px;
        transform: none;
        text-align: left;
    }
    
    .experience-content {
        width: calc(100% - 60px);
        margin-left: 60px;
    }
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }
    
    .nav-links {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background-color: var(--dark-surface);
        flex-direction: column;
        align-items: center;
        padding: 2rem 0;
        transition: left 0.3s ease;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    }
    
    .nav-links.active {
        left: 0;
    }
    
    .nav-links li {
        margin: 1rem 0;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .skills-container {
        grid-template-columns: 1fr;
    }
    
    #contact .social-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .theme-toggle,
    .scroll-top {
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 640px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .profile-photo {
        width: 150px;
        height: 150px;
    }
    
    section {
        padding: 1.5rem;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    .experience-date {
        font-size: 0.75rem;
        padding: 0.4rem 0.8rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.8rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    nav {
        padding: 1rem 1.5rem;
    }
    
    .mail-button {
        padding: 0.8rem 2rem;
        font-size: 1rem;
    }
    
    .project-card {
        margin: 0 auto;
        max-width: 100%;
    }
}

@media (min-width: 1536px) {
    .container {
        max-width: 1400px;
    }
    
    .hero-title {
        font-size: 4.5rem;
    }
}
