/* ======================================= */
/* 0. CSS Custom Properties (Variables)    */
/* ======================================= */

/* Light Theme Variables */
:root,
body.light-theme {
    --bg-primary: #f8f9fa; /* Very light gray */
    --bg-secondary: #ffffff; /* White for cards/header */
    --text-primary: #212529; /* Dark gray for main text */
    --text-secondary: #495057; /* Muted gray for less important text */
    --accent-color: #007bff; /* Primary blue for links/highlights */
    --accent-hover: #0056b3; /* Darker blue on hover */
    --border-color: #e9ecef; /* Light border */
    --shadow-color: rgba(0, 0, 0, 0.08); /* Subtle shadow */
}

/* Dark Theme Variables */
body.dark-theme {
    --bg-primary: #1a202c; /* Dark charcoal */
    --bg-secondary: #2d3748; /* Slightly lighter dark for cards/header */
    --text-primary: #e2e8f0; /* Light gray for main text */
    --text-secondary: #a0aec0; /* Muted light gray */
    --accent-color: #63b3ed; /* Vibrant blue for links/highlights */
    --accent-hover: #4299e1; /* Darker blue on hover */
    --border-color: #4a5568; /* Dark border */
    --shadow-color: rgba(0, 0, 0, 0.3); /* More pronounced shadow for dark mode */
}


/* ======================================= */
/* 1. General/Base Styles                */
/* ======================================= */

body {
    font-family: 'Inter', Arial, sans-serif;
    margin: 0;
    padding: 0; /* Remove padding from body, use padding on main/sections */
    line-height: 1.6;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.4s ease, color 0.4s ease; /* Smoother transition */
    min-height: 100vh; /* Ensure body takes full viewport height */
    display: flex;
    flex-direction: column;
}

main {
    flex-grow: 1; /* Allows main content to fill available space */
    padding: 2rem; /* Consistent padding around main content */
    max-width: 1200px; /* Max width for content readability */
    margin: 0 auto; /* Center the content */
    width: 100%; /* Ensure it takes full width up to max-width */
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    margin-top: 1.5em;
    margin-bottom: 0.8em;
    font-weight: 600; /* Slightly bolder headings */
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

p {
    margin-bottom: 1em;
    color: var(--text-secondary); /* Use secondary color for paragraphs */
}

a {
    text-decoration: none;
    color: var(--accent-color);
    transition: color 0.3s ease;
}

a:hover,
a:focus {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* ======================================= */
/* 2. Header & Navigation                */
/* ======================================= */

header {
    background-color: var(--bg-secondary);
    padding: 1.5rem 2rem; /* More generous padding */
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 8px var(--shadow-color); /* Subtle shadow for depth */
    transition: background-color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

header h1 {
    margin: 0; /* Remove default margin */
}

header h1 a {
    font-size: 1.8rem; /* Slightly smaller for header h1 */
    color: var(--text-primary); /* Ensure header link color is primary text */
    font-weight: 700;
    text-decoration: none; /* Remove underline by default */
}

header h1 a:hover {
    color: var(--accent-color); /* Hover effect for site title */
    text-decoration: none; /* Keep no underline on hover */
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 1.5rem; /* Increased gap for better spacing */
}

nav a {
    color: var(--text-secondary); /* Muted link color for nav */
    font-weight: 500;
    position: relative; /* For underline animation */
}

nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    left: 0;
    bottom: -5px;
    transition: width 0.3s ease;
}

nav a:hover::after,
nav a:focus::after {
    width: 100%;
}

nav a:hover,
nav a:focus {
    color: var(--accent-color); /* Highlight color on hover */
    text-decoration: none; /* Ensure no default underline */
}


/* ======================================= */
/* 3. Theme Toggle Button                */
/* ======================================= */

.theme-toggle {
    background-color: var(--bg-primary); /* Matches body background */
    border: 1px solid var(--border-color);
    border-radius: 50%; /* Make it circular */
    width: 40px; /* Fixed size */
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    outline: none;
    transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 2px 5px var(--shadow-color);
}

.theme-toggle:hover {
    background-color: var(--bg-secondary); /* Slight background change on hover */
    border-color: var(--accent-color);
    transform: translateY(-2px); /* Lift effect */
}

.theme-toggle:active {
    transform: translateY(0); /* Press effect */
    box-shadow: none;
}

.theme-toggle img {
    width: 20px; /* Slightly smaller icon */
    height: 20px;
    transition: transform 0.3s ease; /* Smooth icon rotation/scale */
}

/* You could add a subtle animation to the icon, e.g., on click */
.theme-toggle:active img {
    transform: scale(0.9);
}

/* Basic Footer Styling */
.site-footer {
    background-color: #f2f2f2; /* Light grey background */
    color: #333; /* Dark grey text */
    padding: 20px 0;
    text-align: center;
    margin-top: 40px; /* Space above the footer */
}

/* Social Links Container */
.social-links {
    margin-bottom: 15px;
}

/* Individual Social Link (the 'a' tag) */
.social-links a {
    display: inline-block; /* Allows side-by-side display */
    margin: 0 10px; /* Space between icons */
    transition: transform 0.3s ease; /* Smooth hover effect */
}

/* Social Icon (the 'img' or 'i' tag inside the link) */
.social-links img {
    width: 30px; /* Size of your icons */
    height: 30px; /* Maintain aspect ratio */
    vertical-align: middle; /* Align nicely with text if any */
}

/* Hover effect for icons */
.social-links a:hover {
    transform: translateY(-3px); /* Slightly lift on hover */
}

/* If using Font Awesome or SVG and you want to style the icon directly */
/*
.social-links i {
    font-size: 30px;
    color: #555;
}

.social-links i:hover {
    color: #007bff; // Example hover color
}
*/

/* ======================================= */
/* 4. Section & Card Styles              */
/* ======================================= */

.intro {
    text-align: center;
    padding: 3rem 0;
    margin-bottom: 2rem;
}

.intro h2 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--accent-color); /* Highlight intro heading */
}

.intro p {
    font-size: 1.15rem;
    max-width: 700px;
    margin: 0 auto;
    color: var(--text-secondary);
}


.quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Responsive grid */
    gap: 1.5rem; /* Spacing between cards */
}

.card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px; /* Slightly more rounded corners */
    padding: 1.5rem;
    box-shadow: 0 4px 12px var(--shadow-color); /* More prominent shadow for cards */
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.4s ease, border-color 0.4s ease;
    display: flex; /* For consistent height */
    flex-direction: column;
    justify-content: space-between; /* Push content to top, footer to bottom if any */
}

.card:hover {
    transform: translateY(-5px); /* Lift effect on hover */
    box-shadow: 0 8px 20px var(--shadow-color); /* Stronger shadow on hover */
}

.card h3 {
    margin-top: 0;
    margin-bottom: 0.8em;
    font-size: 1.35rem;
}

.card h3 a {
    color: var(--text-primary); /* Card title links are primary text color */
    font-weight: 600;
}

.card h3 a:hover {
    color: var(--accent-color); /* Highlight card title on hover */
    text-decoration: underline;
}

.card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
}


/* ======================================= */
/* 5. Footer                             */
/* ======================================= */

footer {
    background-color: var(--bg-secondary);
    padding: 1.5rem 2rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
    margin-top: 3rem; /* Space above footer */
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: background-color 0.4s ease, border-color 0.4s ease, color 0.4s ease;
}


/* ======================================= */
/* 6. Responsive Adjustments             */
/* ======================================= */

@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }

    main {
        padding: 1.5rem;
    }

    .intro h2 {
        font-size: 2.2rem;
    }

    .intro p {
        font-size: 1rem;
    }

    .quick-links {
        grid-template-columns: 1fr; /* Stack cards on small screens */
    }
}

@media (max-width: 480px) {
    header h1 a {
        font-size: 1.5rem;
    }

    nav a {
        font-size: 0.9rem;
    }

    .intro h2 {
        font-size: 1.8rem;
    }
}
