/* CSS Variables for Dark/Light Mode */
:root {
    --bg-color: #121212; /* Dark background */
    --text-color: #ffffff; /* White text */
    --accent-color: #007bff; /* Blue accent */
    --secondary-bg: #1e1e1e; /* Darker sections */
    --border-color: #333;
    --hover-bg: rgba(0, 123, 255, 0.1); /* Subtle hover */
    --shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.light-mode {
    --bg-color: #ffffff; /* Light background */
    --text-color: #000000; /* Black text */
    --secondary-bg: #f8f9fa; /* Light sections */
    --border-color: #ddd;
    --hover-bg: rgba(0, 123, 255, 0.05);
    --shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

h1, h2, h3 {
    font-family: 'Poppins', sans-serif;
    margin-bottom: 1rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Navigation */
#navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: var(--secondary-bg);
    z-index: 1000;
    padding: 10px 0;
    box-shadow: var(--shadow);
    transition: box-shadow 0.3s ease;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.nav-logo:hover {
    color: var(--text-color);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 20px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    transition: color 0.3s ease, border-bottom 0.3s ease;
    padding-bottom: 5px;
}

.nav-links a:hover {
    color: var(--accent-color);
    border-bottom: 2px solid var(--accent-color);
}

#dark-mode-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
    transition: transform 0.3s ease;
}

#dark-mode-toggle:hover {
    transform: scale(1.1);
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(135deg, var(--bg-color), var(--secondary-bg));
    animation: fadeIn 1s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3rem); /* Responsive font size */
    margin-bottom: 10px;
}

.tagline {
    font-size: clamp(1rem, 3vw, 1.2rem);
    margin-bottom: 30px;
}

.cta-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    font-weight: 500;
    display: inline-block;
    min-width: 120px;
    text-align: center;
}

.btn-primary {
    background-color: var(--accent-color);
    color: white;
    box-shadow: var(--shadow);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-color);
    border: 1px solid var(--accent-color);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* Sections */
section {
    padding: 80px 0;
    background-color: var(--bg-color);
    animation: fadeInUp 0.8s ease-out;
}

section:nth-child(even) {
    background-color: var(--secondary-bg);
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.about-content {
    display: flex;
    gap: 40px;
    align-items: center;
    flex-wrap: wrap;
}

.profile-img {
    width: clamp(150px, 20vw, 200px);
    height: clamp(150px, 20vw, 200px);
    border-radius: 50%;
    object-fit: cover;
    box-shadow: var(--shadow);
}

.skills-grid, .portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.skill-category, .project-card {
    background-color: var(--secondary-bg);
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.skill-category:hover, .project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.project-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 15px;
}

/* Contact Form */
#contact-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 500px;
    margin: 0 auto;
}

input, textarea {
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: border-color 0.3s ease;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

.social-links {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

.social-links a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: var(--text-color);
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    background-color: var(--secondary-bg);
    border-top: 1px solid var(--border-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }
    .about-content {
        flex-direction: column;
        text-align: center;
    }
    .nav-links {
        display: none; /* Add hamburger menu if needed for mobile */
    }
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    .skills-grid, .portfolio-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .hero h1 {
        font-size: 2.5rem;
    }
    .about-content {
        gap: 20px;
    }
}