/* Default Light Theme */
:root {
    --bg-color: #ffffff;
    --text-color: #222;
    --nav-bg: #f8f9fa;
    --btn-bg: #007bff;
    --btn-hover: #0056b3;
}

/* Dark Mode */
.dark-theme {
    --bg-color: #1e1e1e;
    --text-color: #fff;
    --nav-bg: #333;
    --btn-bg: #ff9800;
    --btn-hover: #e68a00;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    transition: background 0.3s, color 0.3s;
    scroll-behavior: smooth;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--nav-bg);
    padding: 15px 20px;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

/* Logo */
.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-color);
}

/* Navigation Links */
.nav-links {
    list-style: none;
    display: flex;
    gap: 20px;
    padding: 0;
    margin: 0;
    justify-content: center;
    flex: 1;
}

.nav-links li {
    display: inline;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-size: 1rem;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--btn-hover);
}

/* Theme Toggle Button */
.theme-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
}

#theme-toggle {
    background: var(--btn-bg);
    color: white;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 1rem;
    border-radius: 5px;
    transition: background 0.3s;
    margin-left: auto;
    margin-right: 10px;
}

#theme-toggle:hover {
    background: var(--btn-hover);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 120px 20px;
}

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

.hero p {
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.btn {
    background: var(--btn-bg);
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    font-size: 1.2rem;
    border-radius: 5px;
    transition: background 0.3s;
}

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

/* Portfolio Section */
.portfolio-preview {
    text-align: center;
    padding: 50px 20px;
}

.portfolio-preview h2 {
    font-size: 2rem;
    margin-bottom: 20px;
}

.grid {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.card {
    width: 250px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s;
    background: var(--nav-bg);
}

.card img {
    width: 100%;
    height: auto;
}

.card p {
    padding: 10px;
    font-size: 1rem;
}

.card:hover {
    transform: scale(1.05);
}

/* Contact Form */
.contact-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 50px 20px;
    background: var(--nav-bg);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin: 20px;
}

.contact-form h2 {
    font-size: 2rem;
    margin-bottom: 20px;
}

.contact-form form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    max-width: 600px;
}

.contact-form label {
    font-weight: bold;
}

.contact-form input, .contact-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

.contact-form button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    background-color: var(--btn-bg);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
}

.contact-form button:hover {
    background-color: var(--btn-hover);
}

.error {
    color: red;
    font-size: 0.9rem;
}

#success-message {
    margin-top: 20px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    background: var(--nav-bg);
    color: var(--text-color);
    position: relative;
    bottom: 0;
    width: 100%;
}

/* Responsive Fix */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        text-align: center;
    }

    .nav-links {
        flex-direction: column;
        padding: 10px 0;
        gap: 10px;
    }

    .nav-links li {
        margin-bottom: 10px;
    }

    /* Center Theme Button in Mobile */
    .theme-container {
        width: 100%;
        justify-content: center;
        margin-top: 10px;
    }

    #theme-toggle {
        width: 100px;
        margin: 0 auto;
    }

    .grid {
        flex-direction: column;
        align-items: center;
    }

    .card {
        width: 90%;
    }
}
