/* CSS Variables for Themes */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --background-color: #ffffff;
    --text-color: #333333;
    --section-bg: #f8f9fa;
    --card-bg: #ffffff;
    --border-color: #dee2e6;
    --shadow: rgba(0, 0, 0, 0.1);
    --link-color: #007bff;
    --link-hover: #0056b3;
}

[data-theme="dark"] {
    --background-color: #121212;
    --text-color: #e0e0e0;
    --section-bg: #1e1e1e;
    --card-bg: #2a2a2a;
    --border-color: #404040;
    --shadow: rgba(0, 0, 0, 0.3);
    --link-color: #4dabf7;
    --link-hover: #339af0;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    transition: background-color 0.3s, color 0.3s;
}

h1, h2, h3, h4 {
    margin-bottom: 1rem;
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: var(--link-hover);
}

/* Header */
header {
    background-color: var(--card-bg);
    box-shadow: 0 2px 4px var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#theme-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
    transition: color 0.3s;
}

.nav-buttons {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav-btn {
    background-color: transparent;
    color: var(--text-color);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
    opacity: 0.8;
}

.nav-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    opacity: 1;
    transform: translateY(-2px);
}

/* Main Content */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

section {
    margin-bottom: 3rem;
}

.container {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--shadow);
}

/* Hero Section */
#hero {
    text-align: center;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 4rem 1rem;
    border-radius: 8px;
    margin-bottom: 3rem;
}

.hero-container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(45deg, #ffffff, #e0e0e0, #ffffff);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease-in-out infinite;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
    margin-bottom: 1rem;
    letter-spacing: 1px;
    white-space: nowrap;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.profile-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    margin-bottom: 1rem;
    border: 5px solid white;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease;
}

.profile-photo:hover {
    transform: scale(1.05);
}

.hero-text h2 {
    margin-bottom: 1rem;
    font-size: 2rem;
}

.social-links {
    margin: 1rem 0;
}

.social-links a {
    margin: 0 0.5rem;
    font-size: 1.5rem;
    color: white;
}

.btn {
    background-color: white;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 350;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 123, 255, 0.3), transparent);
    transition: left 0.6s;
}

.btn:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 123, 255, 0.3);
}

.btn:hover::before {
    left: 100%;
}

.btn:active {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
}

/* Timeline for Experience */
.timeline {
    position: relative;
    padding-left: 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 2rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--primary-color);
}

.timeline-item {
    margin-bottom: 2rem;
    padding-left: 3rem;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 1.5625rem;
    top: 0.3125rem;
    width: 1rem;
    height: 1rem;
    background-color: var(--primary-color);
    border-radius: 50%;
}

.timeline-item h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.duration {
    color: var(--secondary-color);
    font-size: 0.9rem;
    font-weight: normal;
}

.company {
    font-style: italic;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.location {
    font-style: italic;
    color: var(--secondary-color);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.work-type {
    color: var(--secondary-color);
    font-weight: normal;
    font-size: 0.9rem;
}

.timeline-item ul {
    list-style: none;
    padding-left: 0;
}

.timeline-item li {
    margin-bottom: 0.5rem;
    position: relative;
    padding-left: 1.5rem;
}

.timeline-item li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary-color);
}

/* Education */
.education-item {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.education-item:last-child {
    border-bottom: none;
}

.education-item h4 {
    color: var(--primary-color);
}

.education-item ul {
    list-style: none;
    padding-left: 0;
    margin-top: 0.5rem;
}

.education-item li {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--secondary-color);
}

.activity-item {
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background-color: var(--section-bg);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease;
}

.activity-item:hover {
    background-color: var(--hover-bg);
}

.activity-arrow {
    transition: transform 0.3s ease;
    font-size: 0.8rem;
}

.activity-description {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background-color: var(--card-bg);
    border-radius: 4px;
    border-left: 3px solid var(--primary-color);
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Email Dropdown */
.email-dropdown {
    margin-top: 1rem;
    padding: 1rem;
    background-color: var(--card-bg);
    border-radius: 8px;
    border: 2px solid var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-align: center;
    animation: fadeIn 0.3s ease-in-out;
}

.email-dropdown p {
    margin: 0.5rem 0;
    font-size: 0.95rem;
}

.email-dropdown strong {
    color: var(--primary-color);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Skills */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.skill-category h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.skill-category ul {
    list-style: none;
    padding-left: 0;
}

.skill-item {
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background-color: var(--section-bg);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease;
}

.skill-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex: 1;
    margin-right: 1rem;
}

.skill-name {
    flex: 0 0 auto;
}

.skill-level {
    color: var(--secondary-color);
    font-style: italic;
    font-weight: normal;
    font-size: 0.85rem;
    flex: 0 0 auto;
}

.skill-item:hover {
    background-color: var(--hover-bg);
}

.skill-arrow {
    transition: transform 0.3s ease;
    font-size: 0.8rem;
}

/* Interests */
.interests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    text-align: center;
}

.interest-item {
    background-color: var(--section-bg);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

.interest-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px var(--shadow);
}

.interest-item i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.interest-item h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

/* Key Highlights */
.highlights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.highlight-card {
    background-color: var(--section-bg);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px var(--shadow);
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.highlight-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px var(--shadow);
}

.highlight-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.highlight-card h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.highlight-card p {
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Projects */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card {
    background-color: var(--section-bg);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px var(--shadow);
    transition: transform 0.3s;
}

.project-card:hover {
    transform: translateY(-5px);
}

.project-card h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.project-card a {
    display: inline-block;
    margin-top: 1rem;
    font-weight: bold;
}

/* Articles */
.article-card {
    background-color: var(--section-bg);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px var(--shadow);
    margin-bottom: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.article-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.article-card h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.article-card h4 a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.article-card h4 a:hover {
    color: var(--accent-color);
}

.article-card p {
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

/* Contact */
.contact-message {
    margin-bottom: 2rem;
    font-style: italic;
    color: var(--secondary-color);
    font-size: 0.8rem;
    line-height: 1.5;
    text-align: center;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    display: block;
}

.contact-grid {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

.contact-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 1rem;
    background-color: var(--section-bg);
    border-radius: 8px;
    width: 220px;
    height: 90px;
    box-sizing: border-box;
    flex-shrink: 0;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.contact-item:hover {
    background-color: var(--card-bg);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.contact-item i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.contact-item span {
    font-size: 0.85rem;
    word-break: break-all;
    text-align: center;
}

.contact-item a {
    color: var(--link-color);
    text-decoration: none;
}

.contact-item a:hover {
    color: var(--link-hover);
}

.contact-button-container {
    text-align: center;
    margin-top: 2rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.contact-button-container .btn {
    display: inline-block;
    margin: 0 auto;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    background-color: var(--card-bg);
    color: var(--secondary-color);
}

/* Back to Top Button */
#back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 1000;
}

#back-to-top.show {
    opacity: 1;
    visibility: visible;
}

#back-to-top:hover {
    background-color: var(--link-hover);
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
        padding: 0.5rem;
    }

    .nav-buttons {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }

    .nav-btn {
        font-size: 0.75rem;
        padding: 0.4rem 0.8rem;
    }

    main {
        padding: 1rem 0.5rem;
    }

    .container {
        padding: 1rem;
    }

    .hero-container {
        text-align: center;
        padding: 2rem 1rem;
    }

    .hero-title {
        font-size: 1.8rem;
        white-space: normal;
        letter-spacing: 0.5px;
    }

    .profile-photo {
        width: 120px;
        height: 120px;
    }

    .hero-text h2 {
        font-size: 1.2rem;
    }

    .social-links {
        margin: 1rem 0;
    }

    .social-links a {
        margin: 0 0.3rem;
        font-size: 1.2rem;
    }

    .btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }

    .highlights-grid,
    .skills-grid,
    .projects-grid,
    .interests-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .highlight-card,
    .interest-item {
        padding: 1.5rem;
    }

    .highlight-card i,
    .interest-item i {
        font-size: 2rem;
    }

    .timeline {
        padding-left: 0;
    }

    .timeline::before {
        left: 1.5rem;
    }

    .timeline-item {
        padding-left: 2rem;
    }

    .timeline-item::before {
        left: 1rem;
    }

    .timeline-item h4 {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .company {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .contact-grid {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .contact-item {
        width: 100%;
        max-width: 300px;
        height: auto;
        padding: 1rem;
    }

    .contact-message {
        font-size: 0.9rem;
    }

    .article-card {
        padding: 1rem;
    }

    #back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.5rem;
    }

    .profile-photo {
        width: 100px;
        height: 100px;
    }

    .hero-text h2 {
        font-size: 1rem;
    }

    .hero-title {
        font-size: 0.8rem;
        word-break: break-all;
        max-width: 100%;
        overflow-wrap: break-word;
        -webkit-background-clip: initial;
        background-clip: initial;
        -webkit-text-fill-color: initial;
        background: none;
        color: white;
        animation: none;
    }

    .social-links a {
        font-size: 1rem;
    }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .container {
        padding: 0.75rem;
    }

    .highlight-card,
    .interest-item {
        padding: 1rem;
    }

    .timeline-item h4 {
        font-size: 1rem;
    }

    .contact-item span {
        font-size: 0.8rem;
    }

    .timeline {
        padding-left: 0;
    }

    .timeline::before {
        left: 1rem;
    }

    .timeline-item {
        padding-left: 1.5rem;
    }

    .timeline-item::before {
        left: 0.5rem;
    }
}

@media (max-width: 360px) {
    .hero-title {
        font-size: 0.6rem;
    }
}