/* CSS Variables for Theme Colors */
:root {
    --primary-color: #3498db;
    --text-color: #333;
    --bg-color: #fff;
    --card-bg: #fff;
    --nav-bg: rgba(255, 255, 255, 0.95);
    --shadow-color: rgba(0, 0, 0, 0.1);
    --gradient-start: #f5f7fa;
    --gradient-end: #c3cfe2;
}

[data-theme="dark"] {
    --primary-color: #64b5f6;
    --text-color: #fff;
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --nav-bg: rgba(30, 30, 30, 0.95);
    --shadow-color: rgba(0, 0, 0, 0.5);
    --gradient-start: #1e1e1e;
    --gradient-end: #121212;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: 0 2px 10px var(--shadow-color);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.profile-image {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
    transition: transform 0.3s ease;
}

.profile-image:hover {
    transform: scale(1.1);
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-color);
    font-family: Arial, Helvetica, sans-serif;
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin: 0 1.5rem;
}

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

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

/* Theme Toggle */
.theme-toggle {
    cursor: pointer;
    padding: 0.5rem;
    margin-right: 1rem;
    color: var(--text-color);
    transition: color 0.3s ease;
}

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

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0 5%;
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    transition: background 0.3s ease;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--primary-color) 0%, transparent 0.5%);
    background-size: 20px 20px;
    opacity: 0.1;
    animation: backgroundMove 20s linear infinite;
    z-index: 0;
}

.hero::after {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--primary-color) 0%, transparent 0.5%);
    background-size: 15px 15px;
    opacity: 0.05;
    animation: backgroundMove 15s linear infinite reverse;
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4rem;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

.hero-left {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-right {
    flex: 1;
    text-align: left;
}

.hero-profile-image {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center top;
    border: 4px solid var(--primary-color);
    box-shadow: 0 5px 15px var(--shadow-color);
    transition: transform 0.3s ease;
    animation: float 6s ease-in-out infinite;
}

.hero-profile-image:hover {
    transform: scale(1.05);
}

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

.highlight {
    color: var(--primary-color);
}

.typing-text {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: var(--text-color);
    position: relative;
}

.typing-text::after {
    content: '|';
    position: absolute;
    right: -5px;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    margin: 0 1rem;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 500;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px var(--shadow-color);
}

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

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

/* About Section */
.about {
    padding: 5rem 10%;
    background: var(--bg-color);
    transition: background-color 0.3s ease;
}

.about h2 {
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-color);
    font-size: 2.5rem;
    position: relative;
    padding-bottom: 1rem;
}

.about h2:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
}

.about-text {
    margin-bottom: 2rem;
}

.about-text p {
    margin-bottom: 2rem;
    color: var(--text-color);
    font-size: 1.1rem;
    line-height: 1.8;
    text-align: center;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.skills h3 {
    margin-bottom: 1.5rem;
    color: var(--text-color);
    font-size: 1.8rem;
    text-align: center;
    position: relative;
    padding-bottom: 0.5rem;
}

.skills h3:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
}

.skill-tags {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    padding: 1rem;
}

.skill-item {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(52, 152, 219, 0.1);
    box-shadow: 0 2px 8px var(--shadow-color);
}

.skill-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px var(--shadow-color);
    border-color: var(--primary-color);
}

.skill-item i {
    font-size: 2rem;
    color: var(--primary-color);
    transition: transform 0.3s ease;
}

.skill-item:hover i {
    transform: scale(1.1);
}

.skill-item span {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-color);
    text-align: center;
}

.about-image img {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 5px 15px var(--shadow-color);
}

.education-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--primary-color);
}

.education-section h3 {
    color: var(--text-color);
    font-size: 1.8rem;
    margin-bottom: 2rem;
    text-align: center;
}

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

.education-card {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 5px 15px var(--shadow-color);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    border: 1px solid rgba(52, 152, 219, 0.1);
}

.education-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px var(--shadow-color);
    border-color: var(--primary-color);
}

.education-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    text-align: center;
}

.education-info {
    flex: 1;
}

.education-info h3 {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-size: 1.4rem;
    text-align: left;
}

.education-info .degree {
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.education-info .year {
    color: var(--text-color);
    opacity: 0.8;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.education-info .description {
    color: var(--text-color);
    line-height: 1.6;
    font-size: 1rem;
}

.educatin_link {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease, opacity 0.3s ease;
    position: relative;
    opacity: 0.9;
}

.educatin_link:hover {
    color: var(--primary-color);
    opacity: 1;
}

.educatin_link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.educatin_link:hover::after {
    width: 100%;
}

/* Projects Section */
.projects {
    padding: 5rem 10%;
    background: var(--card-bg);
    transition: background-color 0.3s ease;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2.5rem;
}

.project-card {
    background: var(--card-bg);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px var(--shadow-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 25px var(--shadow-color);
}

.project-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.project-info {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.project-info h3 {
    margin-bottom: 0.8rem;
    color: var(--text-color);
    font-size: 1.4rem;
}

.project-info p {
    color: var(--text-color);
    margin-bottom: 1.2rem;
    line-height: 1.6;
    flex-grow: 1;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.2rem;
}

.tech-stack span {
    font-size: 0.8rem;
    padding: 0.3rem 0.8rem;
    background: var(--card-bg);
    color: var(--text-color);
    border-radius: 15px;
}

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

.project-links a {
    color: var(--primary-color);
    font-size: 1.2rem;
    transition: color 0.3s ease, transform 0.3s ease;
}

.project-links a:hover {
    color: var(--primary-color);
    transform: scale(1.2);
}

/* Contact Section */
.contact {
    padding: 5rem 10%;
    background: var(--bg-color);
    transition: background-color 0.3s ease;
}

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

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.contact-item i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-form input,
.contact-form textarea {
    padding: 1rem;
    border: 1px solid var(--text-color);
    border-radius: 5px;
    font-size: 1rem;
    background: var(--card-bg);
    color: var(--text-color);
    transition: border-color 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.contact-form textarea {
    height: 150px;
    resize: vertical;
}

/* Footer */
footer {
    background: var(--card-bg);
    color: var(--text-color);
    text-align: center;
    padding: 2rem;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.social-links {
    margin-bottom: 1rem;
}

.social-links a {
    color: var(--text-color);
    font-size: 1.5rem;
    margin: 0 1rem;
    transition: color 0.3s ease, transform 0.3s ease;
}

.social-links a:hover {
    color: var(--primary-color);
    transform: scale(1.2);
}

/* Mobile Navigation */
.burger {
    display: none;
    cursor: pointer;
}

.burger div {
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    margin: 5px;
    transition: all 0.3s ease;
}

/* Animation Keyframes */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-50px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Apply animations */
.about, .projects, .contact {
    animation: fadeIn 1s ease forwards;
}

.project-card {
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
}

.project-card:nth-child(1) { animation-delay: 0.1s; }
.project-card:nth-child(2) { animation-delay: 0.2s; }
.project-card:nth-child(3) { animation-delay: 0.3s; }
.project-card:nth-child(4) { animation-delay: 0.4s; }
.project-card:nth-child(5) { animation-delay: 0.5s; }
.project-card:nth-child(6) { animation-delay: 0.6s; }

/* Media Queries */
@media screen and (max-width: 1200px) {
    .project-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media screen and (max-width: 992px) {
    .project-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .contact-content {
        grid-template-columns: 1fr;
    }
    
    .contact-info {
        flex-direction: row;
        justify-content: space-around;
    }

    .hero-content {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }

    .hero-right {
        text-align: center;
    }

    .hero-profile-image {
        width: 250px;
        height: 250px;
    }

    .hero-content h1 {
        font-size: 2.8rem;
    }
}

@media screen and (max-width: 768px) {
    .nav-links {
        position: fixed;
        right: -100%;
        top: 70px;
        height: calc(100vh - 70px);
        background: var(--nav-bg);
        flex-direction: column;
        width: 100%;
        text-align: center;
        transition: 0.5s;
        z-index: 999;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links li {
        margin: 2rem 0;
    }

    .burger {
        display: block;
    }

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

    .hero-profile-image {
        width: 200px;
        height: 200px;
    }

    .hero-content h1 {
        font-size: 2.2rem;
    }

    .typing-text {
        font-size: 1.2rem;
    }
    
    .contact-info {
        flex-direction: column;
    }
    
    .about h2, .projects h2, .contact h2 {
        font-size: 2rem;
    }
    
    .about, .projects, .contact {
        padding: 4rem 5%;
    }

    .education-content {
        grid-template-columns: 1fr;
        max-width: 500px;
        margin: 0 auto;
    }

    .education-section h3 {
        font-size: 1.5rem;
    }

    .skill-tags {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 1rem;
    }
    
    .skill-item {
        padding: 1rem;
    }
    
    .skill-item i {
        font-size: 1.8rem;
    }
    
    .skill-item span {
        font-size: 0.9rem;
    }
}

@media screen and (max-width: 480px) {
    .project-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .btn {
        padding: 0.7rem 1.5rem;
        margin: 0 0.5rem;
    }
    
    .cta-buttons {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
    
    .cta-buttons .btn {
        margin: 0;
    }
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    opacity: 0;
    animation: fadeIn 1s ease forwards 1s;
}

.mouse {
    width: 30px;
    height: 50px;
    border: 2px solid var(--text-color);
    border-radius: 15px;
    position: relative;
}

.wheel {
    width: 4px;
    height: 8px;
    background: var(--text-color);
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
    animation: scroll 2s infinite;
}

.arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.arrow span {
    display: block;
    width: 10px;
    height: 10px;
    border-bottom: 2px solid var(--text-color);
    border-right: 2px solid var(--text-color);
    transform: rotate(45deg);
    animation: arrow 2s infinite;
    opacity: 0;
}

.arrow span:nth-child(2) {
    animation-delay: 0.2s;
}

.arrow span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes scroll {
    0% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
}

@keyframes arrow {
    0% {
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.leetcode-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: var(--text-color);
    transition: color 0.3s ease, transform 0.3s ease;
}

.leetcode-icon:hover {
    color: var(--primary-color);
    transform: scale(1.2);
}

.leetcode-icon svg {
    width: 100%;
    height: 100%;
}

.popup {
    position: fixed;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.success-popup {
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 1rem 2rem;
    background: #28a745;
    color: white;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

@keyframes backgroundMove {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(-50%, -50%);
    }
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
    100% {
        transform: translateY(0px);
    }
}