/* CSS Variables for Theming */
:root {
    --primary-color: #3498db;      /* Original button color */
    --secondary-color: #2c3e50;
    --accent-color: #e74c3c;       /* Hover color */
    --light-color: #ecf0f1;
    --dark-color: #34495e;
    --font-stack: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --light-color: #2c3e50;
        --dark-color: #ecf0f1;
        --secondary-color: #ecf0f1;
        --primary-color: #d3d3ca;
        --accent-color: #504f58;
    }
}

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

/* Body Styles */
body {
    font-family: var(--font-stack);
    color: var(--dark-color);
    background-color: var(--light-color);
    line-height: 1.6;
    scroll-behavior: smooth;
}

/* Navigation Bar */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--secondary-color);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}
nav .logo {
    color: var(--light-color);
    font-size: 1.5rem;
    font-weight: bold;
}
nav .nav-links {
    list-style: none;
    display: flex;
}
nav .nav-links li {
    margin-left: 1.5rem;
}
nav .nav-links a {
    color: var(--light-color);
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.3s;
}
nav .nav-links a:hover {
    color: #e74c3c ;
}

/* Hamburger Menu (Mobile) */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}
.hamburger .line {
    width: 25px;
    height: 3px;
    background: var(--light-color);
    margin: 4px 0;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(270deg, #3498db, #8e44ad, #e74c3c, #0ff122);
    background-size: 800% 800%;
    animation: gradientAnimation 15s ease infinite;
    color: var(--light-color);
    text-align: center;
    padding: 5rem 2rem;
}
@keyframes gradientAnimation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
.hero-section h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: fadeInDown 2s;
}
.hero-section p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    animation: fadeInUp 2s;
}
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    } to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    } to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Updated Button Styles */

/* Hero Section Button */
.hero-section .btn {
    background: var(--primary-color);
    color: var(--light-color);
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s ease, color 0.3s ease; /* Add color transition */
}

.hero-section .btn:hover {
    background-color: var(--accent-color);
    color: white; /* Change font color to white on hover */
}

/* About Section */
#about {
    padding: 4rem 2rem;
    background-color: var(--light-color);
}
#about h2 {
    text-align: center;
    margin-bottom: 2rem;
}
#about p {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.1rem;
    text-align: center;
}
#about img {
    display: block;
    margin: 0 auto;
    height: 600px; /* Ensure the image retains its intended height */
    padding-bottom: 50px;
}

/* Projects Section */
#projects {
    padding: 4rem 2rem;
    background-color: var(--dark-color);
    color: var(--light-color);
}

#projects h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.project-cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.card {
    background: var(--secondary-color);
    padding: 2rem;
    margin: 1rem;
    border-radius: 10px;
    width: 300px;
    text-align: center;
    transition: transform 0.3s, border 0.3s; /* Add border transition */
    position: relative;
    overflow: hidden;
    border: 2px solid transparent; /* Initial border */
}

.card:hover {
    transform: translateY(-5px);
    border: 2px solid var(--accent-color); /* Accent border on hover */
}

.card h3 {
    margin-bottom: 1rem;
}

.card p {
    margin-bottom: 1.5rem;
}

/* Project Card Button */
.card .btn {
    background: var(--primary-color);
    color: var(--light-color);
    padding: 0.5rem 1rem;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.card .btn:hover {
    background-color: var(--accent-color);
}

/* Footer */
footer {
    background: var(--secondary-color);
    color: var(--light-color);
    text-align: center;
    padding: 1rem 0;
}

/* Project Page Styles */
.project-page .container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.project-page h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--primary-color);
}

.project-page h2 {
    font-size: 1.75rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--secondary-color);
}

.project-page .summary p,
.project-page .steps .step p,
.project-page .images .image p {
    font-size: 1.1rem;
    line-height: 1.6;
}

.project-page .steps {
    counter-reset: step;
}

.project-page .steps .step {
    margin-bottom: 1.5rem;
}

.project-page .steps .step::before {
    counter-increment: step;
    content: "Step " counter(step) ": ";
    font-weight: bold;
    display: block;
    margin-bottom: 0.5rem;
}

.project-page .images .image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.project-page .images .image {
    position: relative;
}

.project-page .images .image img,
.project-page .images .image video { /* Add video styling */
    width: 100%; /* Ensures the video takes full width of the container */
    height: auto; /* Maintains aspect ratio */
    border-radius: 5px;
    transition: transform 0.3s;
}

.project-page .images .image img:hover,
.project-page .images .image video:hover { /* Ensure hover effect applies to both */
    transform: scale(1.05);
}

.project-page .images .image p {
    position: absolute;
    bottom: 0;
    left: 0;
    background: rgba(255, 255, 255, 0.7);
    color: var(--light-color);
    width: 100%;
    padding: 0.5rem;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.3s;
}

.project-page .images .image:hover p {
    opacity: 1;
}

/* Custom code section styling */
.code {
    background-color: #2d2d2d;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    overflow-x: auto;
}

.code pre {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
}


/* Responsive Design */
@media (max-width: 768px) {
    nav .nav-links {
        flex-direction: column;
        background: var(--secondary-color);
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        display: none;
    }
    nav .nav-links li {
        margin: 1rem 0;
    }
    nav .nav-links.active {
        display: flex;
    }
    .hamburger {
        display: flex;
    }
    .project-cards {
        flex-direction: column;
        align-items: center;
    }
    .project-page .images .image-gallery {
        grid-template-columns: 1fr;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: var(--light-color);
}
::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}
