* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

:root {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-color: #f8fafc;
    --main-color: #3b82f6;
    --accent-color: #8b5cf6;
}

body {
    background: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
    padding-top: 70px;
    /* Prevents fixed button from overlapping content */
}

.back-home {
    position: fixed;
    top: 1.5rem;
    left: 1.5rem;
    background: rgba(59, 130, 246, 0.2);
    color: var(--main-color);
    padding: 0.8rem 1.5rem;
    border-radius: 3rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 1000;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.back-home:hover {
    transform: translateY(-2px);
    background: rgba(59, 130, 246, 0.3);
    box-shadow: 0 0 1rem var(--main-color);
}

.page-header {
    text-align: center;
    padding: 6rem 1rem 4rem;
    position: relative;
    overflow: hidden;
}

.page-header h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, var(--main-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle {
    font-size: 1.2rem;
    max-width: 500px;
    margin: 0 auto 2rem;
    opacity: 0.8;
    color: #94a3b8;
}

.tech-stack {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
}

.tech-icon {
    background: rgba(59, 130, 246, 0.1);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: var(--main-color);
    border: 1px solid rgba(59, 130, 246, 0.3);
    transition: all 0.3s ease;
}

.tech-icon:hover {
    transform: translateY(-3px);
    background: rgba(59, 130, 246, 0.2);
    box-shadow: 0 0 1rem var(--main-color);
}

.projects-grid {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card {
    background: var(--card-bg);
    border-radius: 1.5rem;
    overflow: hidden;
    transition: all 0.4s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.project-card:hover {
    transform: translateY(-8px);
    border-color: var(--main-color);
    box-shadow: 0 1rem 2rem rgba(59, 130, 246, 0.2);
}

.project-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--main-color);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 2rem;
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 2;
}

.project-preview {
    height: 180px;
    width: 100%;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.preview-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1.5rem;
}

.dashboard-preview {
    height: 180px;
    overflow: hidden;
    position: relative;
}

.dashboard-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    /* Make the image responsive */
    max-width: 100%;
    height: auto;
}

.project-card:hover .dashboard-preview img {
    transform: scale(1.05);
}

.dashboard-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 50%, rgba(0, 0, 0, 0.7) 100%);
    display: flex;
    align-items: flex-end;
    padding: 1rem;
}

.dashboard-title {
    color: white;
    font-size: 1.3rem;
    font-weight: 600;
}

.project-content {
    padding: 1.5rem;
}

.project-title {
    font-size: 1.5rem;
    margin-bottom: 0.8rem;
    color: var(--text-color);
}

.project-description {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.2rem;
    opacity: 0.8;
    color: #cbd5e1;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.2rem;
}

.tech-tag {
    background: rgba(59, 130, 246, 0.1);
    color: var(--main-color);
    padding: 0.3rem 0.8rem;
    border-radius: 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.project-links {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: 3rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    flex: 1;
    justify-content: center;
    min-width: 120px;
}

.project-link.live {
    background: var(--main-color);
    color: white;
}

.project-link.code {
    background: transparent;
    color: var(--text-color);
    border: 1px solid var(--main-color);
}

.project-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 1rem var(--main-color);
}

.features-section {
    max-width: 1000px;
    margin: 4rem auto;
    padding: 3rem 1rem;
}

.features-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 3rem;
    color: var(--main-color);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.feature-card:hover {
    border-color: var(--main-color);
    transform: translateY(-5px);
}

.feature-icon {
    font-size: 2.5rem;
    color: var(--main-color);
    margin-bottom: 1.5rem;
}

.feature-title {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.feature-desc {
    font-size: 0.95rem;
    line-height: 1.6;
    opacity: 0.8;
    color: #cbd5e1;
}

.cta-section {
    text-align: center;
    padding: 4rem 1rem;
    background: linear-gradient(135deg, var(--card-bg) 0%, #253148 100%);
    margin-top: 4rem;
}

.cta-title {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.cta-title span {
    background: linear-gradient(45deg, var(--main-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cta-description {
    font-size: 1.1rem;
    max-width: 500px;
    margin: 0 auto 2rem;
    line-height: 1.6;
    opacity: 0.9;
    color: #cbd5e1;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.cta-btn {
    padding: 0.8rem 2rem;
    border-radius: 3rem;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
}

.cta-btn.primary {
    background: var(--main-color);
    color: white;
}

.cta-btn.secondary {
    background: transparent;
    color: var(--text-color);
    border: 1px solid var(--main-color);
}

.cta-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 1rem var(--main-color);
}

/* ========== UPDATED & IMPROVED MOBILE STYLES ========== */
/* This media query targets screens with a maximum width of 768px (typical for mobile)[citation:1] */
@media only screen and (max-width: 768px) {
    body {
        padding-top: 0;
        /* Reset padding for mobile layout */
    }

    .back-home {
        position: relative;
        /* Change from fixed to relative for better flow */
        top: 0;
        left: 0;
        margin: 1rem auto;
        /* Center the button */
        display: inline-flex;
        width: fit-content;
    }

    .page-header {
        padding: 4rem 1rem 2.5rem;
        /* Adjusted padding for mobile */
    }

    .page-header h1 {
        font-size: 2.2rem;
        /* Slightly reduced font size */
        line-height: 1.2;
    }

    .page-subtitle {
        font-size: 1rem;
        padding: 0 0.5rem;
        margin-bottom: 1.5rem;
    }

    .tech-stack {
        gap: 0.6rem;
    }

    .tech-icon {
        width: 40px;
        height: 40px;
        font-size: 1.4rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        /* Single column on mobile */
        gap: 1.8rem;
        padding: 0 1rem;
        margin-top: 1rem;
    }

    .project-preview,
    .dashboard-preview {
        height: 160px;
    }

    .project-content {
        padding: 1.3rem;
    }

    .project-title {
        font-size: 1.35rem;
    }

    .project-description {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .feature-card {
        padding: 1.8rem;
    }

    .cta-title {
        font-size: 1.8rem;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
        gap: 0.8rem;
    }

    .cta-btn {
        width: 100%;
        max-width: 280px;
        justify-content: center;
        padding: 0.75rem 1.5rem;
    }
}