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

:root {
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --background: #ffffff;
    --surface: #f9fafb;
    --border: #e5e7eb;
    --shadow: rgba(0, 0, 0, 0.1);
    --gradient: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

[data-theme="dark"] {
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --background: #111827;
    --surface: #1f2937;
    --border: #374151;
    --shadow: rgba(0, 0, 0, 0.3);
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background);
    transition: all 0.3s ease;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Particle Background */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(135deg, var(--background) 0%, var(--surface) 100%);
    transition: all 0.3s ease;
}

[data-theme="dark"] #particle-canvas {
    background: linear-gradient(135deg, var(--background) 0%, var(--surface) 100%);
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    transition: all 0.3s ease;
}

[data-theme="dark"] .navbar {
    background: rgba(17, 24, 39, 0.95);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.logo-accent {
    color: var(--primary-color);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--gradient);
    border-radius: 1px;
}

.theme-toggle {
    background: none;
    border: 2px solid var(--border);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

/* Hero Section*/
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    background: transparent;
}

.hero-container {
    max-width: 800px;
    padding: 0 2rem;
    position: relative;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    color: var(--text-primary);
}

/*Gradient Text Highlights */
.name-highlight,
.skill-highlight {
    color: #6366f1; /* Fallback */
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.1);
}

/* Typing cursor effect */
.skill-highlight {
    border-right: 2px solid currentColor;
    padding-right: 4px;
    animation: blink 0.7s step-end infinite;
}

[data-theme="dark"] .name-highlight,
[data-theme="dark"] .skill-highlight {
    text-shadow: 0 0 2px rgba(255, 255, 255, 0.1);
}

/* Blink animation */
@keyframes blink {
    50% { border-color: transparent; }
}

@supports not (-webkit-background-clip: text) {
    .name-highlight,
    .skill-highlight {
        color: #6366f1;
    }
}

/* Description*/
.hero-description {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin: 0 auto 2.5rem;
    max-width: 600px;
}

/* Buttons*/
.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.cta-button {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    border: none;
    background: var(--gradient);
    color: white;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    position: relative;
    z-index: 2;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.cta-button:focus {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

.cta-button.secondary {
    background: #4b5563; /* Neutral color */
}

/*Scroll Indicator*/
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: var(--text-secondary);
    animation: bounce 2s infinite;
    z-index: 2;
    cursor: pointer;
}

.scroll-indicator:hover,
.scroll-indicator:focus {
    color: #6366f1;
}

.scroll-arrow {
    font-size: 1.5rem;
    margin-top: 0.5rem;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .scroll-indicator {
        animation: none;
    }
}

/* Accessibility*/
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/*Responsive*/
@media (max-width: 480px) {
    .hero-title {
        font-size: clamp(1.8rem, 4vw, 2.5rem);
    }
}


/* General Section Styles */
section {
    padding: clamp(2rem, 5vw, 5rem) 0;
    position: relative;
    z-index: 1;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    color: var(--text-primary);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--gradient);
    border-radius: 2px;
}

/* About Section */
.about {
    background: var(--surface);
}

.about-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-text p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

.stat {
    text-align: center;
}

.stat h3 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.about-image img {
    width: 100%;
    border-radius: 20px;
    box-shadow: 0 20px 40px var(--shadow);
}

/* Skills Section */
.skills {
    background: transparent;
}

.skills-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 3rem;
    align-items: start;
}

.skills-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 100px;
}

.skill-category-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 15px;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    width: 100%;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px var(--shadow);
}

.skill-category-btn:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--shadow);
}

.skill-category-btn.active {
    background: var(--gradient);
    color: white;
    border-color: transparent;
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
}

.skill-category-btn i {
    font-size: 1.2rem;
    width: 20px;
}

.skills-content {
    position: relative;
    min-height: 500px;
}

.skill-group {
    display: none;
    flex-direction: column;
    gap: 1.5rem;
    animation: fadeInUp 0.5s ease;
}

.skill-group.active {
    display: flex;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.skill-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--surface);
    border-radius: 15px;
    box-shadow: 0 5px 15px var(--shadow);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
}

.skill-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px var(--shadow);
    border-color: var(--primary-color);
}

.skill-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: var(--gradient);
    border-radius: 12px;
    color: white;
    font-size: 1.5rem;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.skill-info {
    flex: 1;
}

.skill-info h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.skill-progress {
    width: 100%;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: var(--gradient);
    border-radius: 4px;
    transition: width 1s ease;
    animation: progressAnimation 2s ease;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes progressAnimation {
    from {
        width: 0%;
    }
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Projects Section */
.projects {
    background: var(--surface);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.project-card {
    background: var(--background);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px var(--shadow);
    transition: all 0.3s ease;
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px var(--shadow);
    border-color: var(--primary-color);
}

.project-image {
    position: relative;
    overflow: hidden;
}

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

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(99, 102, 241, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-card:hover .project-overlay {
    opacity: 1;
}

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

.project-links {
    display: flex;
    gap: 1rem;
}

.project-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: white;
    color: var(--primary-color);
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.project-link:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.project-content {
    padding: 2rem;
}

.project-content h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.project-content p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.project-tech span {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* Contact Section */
.contact {
    background: transparent;
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.contact-info h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.contact-info p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1.1rem;
    line-height: 1.6;
}

.contact-details {
    margin-bottom: 2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    padding: 0.5rem 0;
}

.contact-item i {
    color: var(--primary-color);
    margin-right: 1rem;
    width: 20px;
    font-size: 1.1rem;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: var(--gradient);
    color: white;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.social-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.contact-form {
    background: var(--surface);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px var(--shadow);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: var(--background);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.submit-btn {
    width: 100%;
    background: var(--gradient);
    color: white;
    border: none;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Footer */
.footer {
    background: var(--surface);
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid var(--border);
    position: relative;
    z-index: 1;
}

.footer p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Scroll Animations */
.skill-card, .stat, .contact-item {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.skill-card.reveal, .stat.reveal, .contact-item.reveal {
    opacity: 1;
    transform: translateY(0);
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 2s infinite;
}

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

::-webkit-scrollbar-track {
    background: var(--surface);
}

::-webkit-scrollbar-thumb {
    background: var(--gradient);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Selection */
::selection {
    background: var(--primary-color);
    color: white;
}

::-moz-selection {
    background: var(--primary-color);
    color: white;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .skills-container {
        grid-template-columns: 250px 1fr;
        gap: 2rem;
    }
    
    .skill-category-btn {
        padding: 1rem 1.25rem;
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: var(--background);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px var(--shadow);
        padding: 2rem 0;
        backdrop-filter: blur(10px);
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .nav-toggle.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .about-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }

    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .skills-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .skills-sidebar {
        position: static;
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 1rem;
        gap: 0.75rem;
    }

    .skill-category-btn {
        min-width: 150px;
        flex-shrink: 0;
        padding: 0.875rem 1rem;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-description {
        font-size: 1.1rem;
    }

    .section-title {
        font-size: 2rem;
    }

    section {
        padding: 3rem 0;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .nav-container {
        padding: 0 1rem;
    }

    .hero-container {
        padding: 0 1rem;
    }

    .about-stats {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .skills-sidebar {
        flex-direction: column;
        overflow-x: visible;
    }

    .skill-category-btn {
        min-width: auto;
    }

    .skill-card {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .skill-info {
        width: 100%;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .contact-form {
        padding: 1.5rem;
    }

    .project-content {
        padding: 1.5rem;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .skill-icon,
    .project-link,
    .social-link {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .scroll-indicator {
        animation: none;
    }
    
    .progress-bar::after {
        animation: none;
    }
}

/* Print Styles */
@media print {
    #particle-canvas,
    .navbar,
    .scroll-indicator,
    .theme-toggle {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .hero {
        min-height: auto;
        padding: 2rem 0;
    }
    
    section {
        padding: 2rem 0;
        break-inside: avoid;
    }
    
    .project-card,
    .skill-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* Focus Styles for Accessibility */
.nav-link:focus,
.theme-toggle:focus,
.skill-category-btn:focus,
.cta-button:focus,
.submit-btn:focus,
.project-link:focus,
.social-link:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --shadow: rgba(0, 0, 0, 0.5);
        --border: #000000;
    }
    
    [data-theme="dark"] {
        --shadow: rgba(255, 255, 255, 0.3);
        --border: #ffffff;
    }
    
    .skill-card,
    .project-card,
    .contact-form {
        border-width: 2px;
    }
}