:root {
    --primary-color: #4f46e5;
    --secondary-color: #10b981;
    --bg-color: #f9fafb;
    --text-color: #111827;
    --card-bg: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.dark {
    --bg-color: #111827;
    --text-color: #f9fafb;
    --card-bg: #273447;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.section-title {
    font-size: clamp(2rem, 5vw, 2.5rem);
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background: var(--primary-color);
    margin: 1rem auto 0;
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow);
    z-index: 1000;
    transition: background 0.3s;
}

.dark .header {
    background: rgba(17, 24, 39, 0.95);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: clamp(1rem, 4vw, 1.25rem);
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-link {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    font-size: 1rem;
    transition: color 0.3s;
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.theme-btn, .mobile-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    color: var(--text-color);
    transition: color 0.3s;
}

.theme-btn:hover, .mobile-btn:hover {
    color: var(--primary-color);
}

.mobile-menu {
    position: fixed;
    top: 0;
    left: 100%;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background: var(--card-bg);
    padding: 2rem;
    box-shadow: -5px 0 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease-in-out;
    z-index: 1001;
}

.mobile-menu.active {
    transform: translateX(-100%);
}

.mobile-link {
    display: block;
    padding: 0.75rem 0;
    text-decoration: none;
    color: var(--text-color);
    font-size: 1.1rem;
    font-weight: 500;
    transition: color 0.3s;
}

.mobile-link:hover {
    color: var(--primary-color);
}

@media (min-width: 768px) {
    .mobile-btn, .mobile-menu {
        display: none;
    }
    .nav-links {
        display: flex;
    }
}

@media (max-width: 767px) {
    .nav-links {
        display: none;
    }
    .nav-container {
        flex-direction: row;
        align-items: center;
    }
    .mobile-btn {
        display: block;
    }
}

.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 0;
    background: linear-gradient(to bottom right, #eef2ff, #d1fae5);
    opacity: 1;
}

.dark .hero-section {
    background: linear-gradient(to bottom right, #1e3a8a, #065f46);
}

.profile-pic-container {
    text-align: center;
    margin-bottom: 1.5rem;
}

.profile-pic {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--card-bg);
    box-shadow: var(--shadow);
}

.hero-title {
    font-size: clamp(2rem, 6vw, 3rem);
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: clamp(1.2rem, 4vw, 1.5rem);
    margin-bottom: 1rem;
}

.hero-desc {
    max-width: 600px;
    margin: 0 auto 2rem;
    font-size: clamp(1rem, 3vw, 1.1rem);
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.primary {
    background: var(--primary-color);
    color: white;
}

.primary:hover {
    background: #4338ca;
}

.secondary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.secondary:hover {
    background: var(--primary-color);
    color: white;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    font-size: 1.5rem;
}

.about-section, .experience-section, .skills-section, .projects-section, .certifications-section, .contact-section {
    padding: 5rem 0;
    opacity: 1;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .about-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.feature-item {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
}

.feature-icon {
    font-size: 2rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.timeline {
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background: var(--primary-color);
}

.timeline-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    position: relative;
}

.timeline-date {
    width: 45%;
    text-align: right;
    padding-right: 2rem;
}

.timeline-content {
    width: 45%;
    background: var(--card-bg);
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
}

@media (max-width: 768px) {
    .timeline::before {
        left: 0;
    }
    .timeline-item {
        flex-direction: column;
    }
    .timeline-date, .timeline-content {
        width: 100%;
        text-align: left;
        padding: 0;
    }
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.skill-card {
    background: var(--card-bg);
    padding: 1.5rem;
    text-align: center;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    font-size: clamp(0.9rem, 2.5vw, 1rem);
    transition: transform 0.3s;
}

.skill-card:hover {
    transform: translateY(-5px);
}

.skill-card i {
    display: block;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card {
    background: var(--card-bg);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
}

.project-card:hover {
    transform: translateY(-5px);
}

.project-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.project-card h3 {
    padding: 1rem 1rem 0;
}

.project-card p {
    padding: 0 1rem;
}

.project-card a {
    display: block;
    padding: 1rem;
    text-align: center;
    color: var(--primary-color);
}

.cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.cert-card {
    background: var(--card-bg);
    padding: 1.5rem;
    text-align: center;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
}

.contact-form {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-form input, .contact-form textarea {
    padding: 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    background: var(--card-bg);
    color: var(--text-color);
}

.dark .contact-form input, .dark .contact-form textarea {
    border-color: #4b5563;
}

.footer {
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid #e5e7eb;
}

.dark .footer {
    border-color: #374151;
}

.preloader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    transition: opacity 0.5s;
}

.preloader.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--primary-color);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.animate-fade-in {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* ✅ Extra Mobile Responsiveness */
@media (max-width: 480px) {
    .hero-section {
        padding: 2rem 1rem;
    }

    .hero-title {
        font-size: 1.8rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .cert-grid {
        grid-template-columns: 1fr;
    }

    .skills-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }

    .section-title {
        font-size: 1.75rem;
        margin-bottom: 2rem;
    }

    .about-section, .experience-section, .skills-section, .projects-section, .certifications-section, .contact-section {
        padding: 3rem 0;
    }

    .contact-form input, .contact-form textarea {
        font-size: 0.9rem;
    }

    .footer {
        padding: 1.5rem 0;
        font-size: 0.9rem;
    }

    .profile-pic {
        width: 120px;
        height: 120px;
    }
}
