/* Modern CSS Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Custom Properties */
:root {
    --primary-color: #2563eb;
    --secondary-color: #3b82f6;
    --accent-color: #60a5fa;
    --background-color: #f8fafc;
    --text-color: #1e293b;
    --text-light: #64748b;
    --white: #ffffff;
    --max-width: 1200px;
    --section-padding: 5rem 2rem;
}

/* Base Styles */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

header {
    background-color: var(--white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav .logo {
    font-size: 1.5em;
    font-weight: bold;
}

nav ul {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

nav ul li {
    margin-left: 20px;
}

nav ul li a {
    color: #fff;
    text-decoration: none;
    padding: 5px 10px;
    transition: background-color 0.3s;
}

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

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.875rem 1.75rem;
    border-radius: 0.5rem;
    font-weight: 500;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

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

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    text-align: center;
    padding: calc(4rem + 80px) 2rem 4rem;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

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

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.skill-item {
    text-align: center;
    padding: 1rem;
    background: var(--white);
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.skill-item:hover {
    transform: translateY(-5px);
}

.skill-item i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

/* Project Tags */
.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.tag {
    background-color: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
}

/* Blog Section */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.blog-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 0.5rem;
}

.blog-meta {
    display: flex;
    gap: 1rem;
    color: var(--text-light);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

/* Contact Section */
.contact-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 4rem;
    align-items: start;
}

.contact-info {
    background: var(--white);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

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

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

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-weight: 500;
}

/* Notifications */
.notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    background: var(--white);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.notification.success {
    background: #10b981;
    color: var(--white);
}

.notification.error {
    background: #ef4444;
    color: var(--white);
}

.notification.show {
    transform: translateY(0);
    opacity: 1;
}

/* Animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.animate {
    opacity: 1;
    transform: translateY(0);
}


/* Dark Theme Support */
@media (prefers-color-scheme: dark) {
    :root {
        --background-color: #0f172a;
        --text-color: #f8fafc;
        --text-light: #cbd5e1;
        --white: #1e293b;
    }

    .notification {
        background: #1e293b;
        color: #f8fafc;
    }

    .skill-item,
    .project-card,
    .blog-post,
    .contact-info {
        background: #1e293b;
    }

    .tag {
        background-color: rgba(96, 165, 250, 0.1);
    }
}

/* Image Optimization */
img {
    max-width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    object-position: center;
    aspect-ratio: 16/9;
}

.project-card img,
.blog-image img {
    aspect-ratio: 16/9;
    width: 100%;
    height: 250px;
    transition: transform 0.3s ease;
}

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

/* Base Container */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

/* Responsive Design - Large Screens */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }

    .project-grid,
    .blog-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Responsive Design - Medium Screens */
@media (max-width: 992px) {
    :root {
        --section-padding: 4rem 1.5rem;
    }

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

    .project-grid,
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .skills-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
}

/* Responsive Design - Small Screens */
@media (max-width: 768px) {
    :root {
        --section-padding: 3rem 1rem;
    }

    .hero {
        padding: calc(3rem + 80px) 1rem 3rem;
    }

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

    .about-grid,
    .contact-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .project-grid,
    .blog-grid {
        grid-template-columns: 1fr;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        padding: 1rem;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }

    .nav-links.active {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .menu-toggle {
        display: block;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .social-links {
        justify-content: center;
    }
}

/* Responsive Design - Extra Small Screens */
@media (max-width: 480px) {
    :root {
        --section-padding: 2.5rem 1rem;
    }

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

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

    .project-card,
    .blog-post {
        padding: 1rem;
    }

    .contact-form {
        padding: 1.5rem;
    }

    .notification {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
        text-align: center;
    }
}

/* Loading State for Images */
.image-loading {
    position: relative;
    background: var(--text-light);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { opacity: 0.5; }
    50% { opacity: 0.8; }
    100% { opacity: 0.5; }
}