/* General Styles */
:root {
    --primary-color: #4CAF50;
    --secondary-color: #45a049;
    --light-gray: #dcdcdc;
    --dark-gray: #333;
    --border-radius: 8px;
    --transition-speed: 0.3s;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: #333;
    height: auto;
    overflow-x: hidden;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    width: 80%;
    margin: 0 auto;
    flex-grow: 1;
    overflow: hidden;
}

/* Header Styles */
header {
    background: var(--primary-color);
    color: #fff;
    padding: 10px 0; /* Reduced padding for mobile */
    text-align: center;
}

header h1 {
    margin: 0;
    font-size: 2em; /* Smaller font size for compact look */
}

header nav ul {
    list-style: none;
    padding: 0;
    margin: 10px 0 0; /* Reduced margin */
    display: flex;
    justify-content: center;
    flex-wrap: wrap; /* Allow nav items to wrap */
    gap: 10px; /* Adjust spacing */
}

header nav ul li a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9em; /* Slightly smaller font */
    transition: color var(--transition-speed) ease;
}

header nav ul li a:hover,
header nav ul li a:focus {
    color: var(--light-gray);
    outline: none;
}

/* Section Styles */
section {
    padding: 20px 0;
    border-bottom: 1px solid #ddd;
}

h2 {
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 20px;
}

#about p {
    text-align: center;
    font-size: 1.1em;
}

/* Projects Grid */
#projects .projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.project {
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    padding: 15px;
    background: #fff;
    transition: box-shadow var(--transition-speed) ease;
}

.project:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.project h3 {
    margin-top: 0;
}

.project img {
    width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    transition: transform var(--transition-speed) ease;
}

.project img:hover {
    transform: scale(1.05);
}

.project a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
    transition: color var(--transition-speed) ease;
}

.project a:hover {
    color: var(--secondary-color);
}

/* Contact Form Styles */
form {
    max-width: 600px;
    margin: 20px auto;
    background: #fff;
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

form label {
    display: block;
    margin: 10px 0 5px;
    font-weight: bold;
}

form input,
form textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1em;
}

form textarea {
    resize: vertical;
}

form button {
    width: 100%;
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 10px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1.1em;
    transition: background var(--transition-speed) ease;
}

form button:hover {
    background: var(--secondary-color);
}

/* Footer Styles */
footer {
    background: var(--dark-gray);
    color: #fff;
    text-align: center;
    padding: 10px 0;
    margin-top: auto;
    font-size: 0.9em;
}

/* Media Queries for Mobile */
@media (max-width: 768px) {
    .container {
        width: 90%; /* Adjust container width for small screens */
    }

    header h1 {
        font-size: 1.8em; /* Smaller font size for mobile */
    }

    header nav ul {
        margin: 5px 0 0; /* Reduce top margin */
        gap: 8px; /* Adjust spacing between nav items */
    }

    header nav ul li a {
        font-size: 0.8em; /* Smaller font for nav links */
    }

    h2 {
        font-size: 1.5em; /* Reduce section heading size */
    }

    form button {
        font-size: 1em; /* Adjust button font size for mobile */
    }
}