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

html {
    overflow-x: hidden;
}

body {
    overflow-x: hidden;
    width: 100%;
}

:root {
    --primary-color: #8b5cf6;
    --secondary-color: #7c3aed;
    --text-color: #e5e7eb;
    --text-light: #9ca3af;
    --bg-color: #0f172a;
    --bg-secondary: #1e293b;
    --border-color: #334155;
}

[data-theme="light"] {
    --primary-color: #7c3aed;
    --secondary-color: #6d28d9;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --bg-color: #ffffff;
    --bg-secondary: #f9fafb;
    --border-color: #e5e7eb;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Navigation */
nav {
    background: var(--bg-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

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

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

nav .logo:hover {
    color: var(--secondary-color);
}

.theme-toggle {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 2rem;
    padding: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

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

.theme-toggle-btn {
    background: var(--primary-color);
    border: none;
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: transform 0.3s;
}

.theme-toggle-btn:hover {
    transform: rotate(20deg);
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
    align-items: center;
}

nav a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s;
}

nav a:hover {
    color: var(--primary-color);
}

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

/* Hero Section */
.hero {
    padding: 6rem 0;
    text-align: center;
    background: linear-gradient(135deg, var(--bg-color) 0%, var(--bg-secondary) 100%);
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.hero .subtitle {
    font-size: 1.5rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s;
    border: 2px solid var(--primary-color);
}

.btn:hover {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

.btn-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Section */
section {
    padding: 4rem 0;
}

section h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-align: center;
}

section .section-subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 3rem;
    font-size: 1.1rem;
}

/* About Section */
#about {
    background: var(--bg-secondary);
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.about-content p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-light);
    margin-bottom: 1rem;
}

/* Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.skill-card {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    border: 1px solid var(--border-color);
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
}

.skill-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
    border-color: var(--primary-color);
}

.skill-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.skill-card ul {
    list-style: none;
}

.skill-card li {
    padding: 0.5rem 0;
    color: var(--text-light);
}

.skill-card li:before {
    content: "▹ ";
    color: var(--primary-color);
    font-weight: bold;
}

/* Projects Section */
#projects {
    background: var(--bg-secondary);
}

/* Project Subsections */
.projects-subsection {
    margin-bottom: 4rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid var(--border-color);
}

.projects-subsection:last-child {
    border-bottom: none;
}

.subsection-title {
    font-size: 1.8rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.subsection-subtitle {
    color: var(--text-light);
    margin-bottom: 2rem;
    font-size: 1rem;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

/* Project Cards - Minimal Design */
.project-card {
    background: var(--bg-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.15);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
}

.project-card h4 {
    font-size: 1.3rem;
    color: var(--text-color);
    margin: 0;
    flex: 1;
}

.project-description {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    flex-grow: 1;
    line-height: 1.6;
    font-size: 0.95rem;
}

.project-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.tag {
    background: rgba(139, 92, 246, 0.1);
    padding: 0.35rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    color: var(--primary-color);
    border: 1px solid rgba(139, 92, 246, 0.3);
    white-space: nowrap;
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-completed {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-active {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.status-archived {
    background: rgba(107, 114, 128, 0.15);
    color: #6b7280;
    border: 1px solid rgba(107, 114, 128, 0.3);
}

.status-backlog {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

/* Button variants */
.btn-small {
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
}

[data-theme="light"] .status-completed {
    background: rgba(34, 197, 94, 0.1);
    color: #15803d;
    border: 1px solid rgba(34, 197, 94, 0.4);
}

[data-theme="light"] .status-active {
    background: rgba(59, 130, 246, 0.1);
    color: #1d4ed8;
    border: 1px solid rgba(59, 130, 246, 0.4);
}

[data-theme="light"] .status-archived {
    background: rgba(107, 114, 128, 0.1);
    color: #374151;
    border: 1px solid rgba(107, 114, 128, 0.4);
}

[data-theme="light"] .status-backlog {
    background: rgba(168, 85, 247, 0.1);
    color: #5b21b6;
    border: 1px solid rgba(168, 85, 247, 0.4);
}

/* Projects CTA */
.projects-cta {
    text-align: center;
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 2px solid var(--border-color);
}

.projects-count {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-weight: 500;
}

/* CV Section */
#cv {
    text-align: center;
}

.cv-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem;
    background: var(--bg-secondary);
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
}

.cv-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

/* Timeline Section */
#timeline {
    background: var(--bg-secondary);
}

.timeline {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    padding: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 100%;
    background: var(--primary-color);
    opacity: 0.3;
}

.timeline-item {
    margin-bottom: 3rem;
    position: relative;
}

.timeline-content {
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    width: calc(50% - 2rem);
    position: relative;
    transition: all 0.3s;
}

.timeline-content:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}

.timeline-item:nth-child(even) .timeline-content {
    margin-left: auto;
}

.timeline-date {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.timeline-content h3 {
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.timeline-content p {
    color: var(--text-light);
    line-height: 1.6;
}

.timeline-marker {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border: 4px solid var(--bg-color);
    border-radius: 50%;
    top: 1.5rem;
    z-index: 1;
}

.timeline-item:nth-child(even) .timeline-content::before {
    content: '';
    position: absolute;
    left: -15px;
    top: 1.5rem;
    width: 0;
    height: 0;
    border-right: 15px solid var(--border-color);
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
}

.timeline-item:nth-child(odd) .timeline-content::before {
    content: '';
    position: absolute;
    right: -15px;
    top: 1.5rem;
    width: 0;
    height: 0;
    border-left: 15px solid var(--border-color);
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
}

/* Contact Section */
#contact {
    background: var(--bg-color);
}

.contact-content {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.1rem;
    transition: color 0.3s, transform 0.3s;
}

.contact-link:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
}

.contact-link svg {
    transition: transform 0.3s;
}

.contact-link:hover svg {
    transform: scale(1.1);
}

/* Footer */
footer {
    background: var(--bg-secondary);
    color: var(--text-light);
    text-align: center;
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
}

/* Responsive */
@media (max-width: 768px) {
    nav .container {
        padding: 0.75rem 1rem;
        gap: 0.5rem;
    }

    nav .logo {
        font-size: 1.2rem;
    }

    nav ul {
        gap: 0.5rem;
        font-size: 0.75rem;
        flex-wrap: wrap;
    }

    nav a {
        font-size: 0.85rem;
    }

    .theme-toggle {
        padding: 0.25rem;
    }

    .theme-toggle-btn {
        width: 1.5rem;
        height: 1.5rem;
        font-size: 0.75rem;
    }

    .container {
        padding: 0 1rem;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

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

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

    section h2 {
        font-size: 1.75rem;
    }

    section {
        padding: 3rem 0;
    }

    .btn-group {
        flex-direction: column;
        align-items: center;
    }

    .skills-grid,
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .timeline::before {
        left: 30px;
    }

    .timeline-marker {
        left: 30px;
    }

    .timeline-content {
        width: calc(100% - 80px);
        margin-left: 80px !important;
    }

    .timeline-item:nth-child(odd) .timeline-content::before,
    .timeline-item:nth-child(even) .timeline-content::before {
        left: -15px;
        border-right: 15px solid var(--border-color);
        border-left: none;
    }

    .contact-links {
        gap: 1rem;
    }

    .contact-link {
        font-size: 0.95rem;
    }

    .projects-count {
        font-size: 1rem;
    }

    .subsection-title {
        font-size: 1.4rem;
    }

    .project-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .status-badge {
        font-size: 0.7rem;
    }
}
