/* Root colors for light mode */
:root {
    --primary-color: #d32f2f; /* red */
    --secondary-color: #ffffff; /* background */
    --text-color: #333333;
    --card-bg: #ffffff;
    --footer-bg: #222222;
}

/* Dark mode variables */
body.dark-mode {
    --primary-color: #b71c1c; /* darker red */
    --secondary-color: #121212;
    --text-color: #e0e0e0;
    --card-bg: #1e1e1e;
    --footer-bg: #111111;
}

/* General styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--secondary-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Header / Navbar */
header {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem 2rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    position: sticky;
    top: 0;          
    z-index: 1000;    
    box-shadow: 0 2px 6px rgba(0,0,0,0.1); 
}

/* Site title */
header h1 {
    margin: 0 2rem 0 0;
    font-size: 1.8rem;
}

/* Navbar links left-aligned */
header nav {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

header nav a {
    color: white;
    font-weight: bold;
    text-decoration: none;
}

header nav a:hover {
    text-decoration: underline;
}

/* Dark/light mode toggle button right-aligned */
#mode-toggle {
    margin-left: auto; /* pushes button to far right */
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    background-color: white;
    color: var(--primary-color);
    font-weight: bold;
    cursor: pointer;
    border: none;
    flex-shrink: 0;
}

#mode-toggle:hover {
    background-color: #f0f0f0;
}

/* Sections */
section {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 1rem;
    flex: 1; /* pushes footer down */
}

/* Cards */
.card {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

/* Titles */
h1, h2 {
    color: var(--primary-color);
}

h3 {
    color: #a10f0f;
}

/* Buttons */
.button {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    margin-top: 0.5rem;
    font-weight: bold;
    text-align: center;
}

.button:hover {
    background-color: #a10f0f;
}

/* Images */
.card img {
    width: 100%;
    border-radius: 8px;
    margin-top: 1rem;
    transition: transform 0.2s;
}

.card img:hover {
    transform: scale(1.03);
}

/* Footer */
footer {
    text-align: center;
    padding: 1.5rem;
    background-color: var(--footer-bg);
    color: white;
    margin-top: auto;
}

/* Skills / Progress Bars */
.skills-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.skill-container {
    margin-bottom: 1rem;
}

.skill-container span {
    font-weight: bold;
    display: block;
    margin-bottom: 0.3rem;
}

.progress {
    background-color: #ddd;
    border-radius: 8px;
    overflow: hidden;
    height: 20px;
}

.progress-bar {
    background-color: var(--primary-color);
    height: 100%;
    border-radius: 8px 0 0 8px;
    transition: width 0.5s ease-in-out;
}

/* Achievements List */
.achievements-list {
    list-style: none;
    padding: 0;
    margin-top: 1rem;
}

.achievements-list li {
    background-color: var(--card-bg);
    border-left: 4px solid var(--primary-color);
    padding: 0.5rem 1rem;
    margin-bottom: 1rem;
    border-radius: 6px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.achievements-list li:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Responsive */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: flex-start;
    }
    header nav {
        flex-direction: column;
        width: 100%;
        margin-top: 0.5rem;
    }
    #mode-toggle {
        margin-left: 0;
        margin-top: 0.5rem;
    }
    .project-images img {
        width: 100% !important;
        max-width: 100% !important;
    }
    .skills-grid {
        flex-direction: column;
    }
}
