/* CSS Variables for theming */
:root {
    --background-color: #000;
    --text-color: #fff;
    --accent-color: #00ff00;
    --card-border: 1px solid var(--accent-color);
    --glow-shadow: 0 0 10px var(--accent-color);
    --button-bg: #333;
    --input-bg: #333;
    --menu-bg: #111; /* Default for dark theme */
}

/* Dark theme override */
body.dark-theme {
    --text-color: var(--accent-color);
}

/* Base styles */
body {
    background-color: var(--background-color);
    color: var(--text-color);
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    position: relative;
    transition: background-color 0.5s, color 0.5s;
}

/* Navigation */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #111;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
}

nav a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: bold;
    padding: 5px 10px;
    transition: box-shadow 0.3s ease, color 0.3s ease;
}

nav a:hover {
    box-shadow: 0 0 5px #00ff00; /* Neon-green glow */
}

nav a.active {
    color: #ff0000; /* Neon-red text */
}

nav a.active:hover {
    box-shadow: 0 0 5px #ff0000; /* Neon-red glow */
}

/* Ensure no default button styles are applied */
.theme-switch-btn {
    background: transparent; /* Changed from 'none' to 'transparent' for clarity */
    border: none;
    padding: 0;
    margin: 0; /* Added to prevent any spacing issues */
    cursor: pointer;
    -webkit-appearance: none; /* Remove browser-specific styling */
    -moz-appearance: none;
    appearance: none;
}

/* Remove any outline, shadow, or background on hover and focus */
.theme-switch-btn:hover,
.theme-switch-btn:focus {
    outline: none;
    box-shadow: none;
    background-color: transparent;
}

.theme-switch-btn:hover .theme-icon {
    filter: drop-shadow(0 0 5px var(--accent-color));
}

/* Hamburger menu */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10;
}

.hamburger span {
    width: 30px;
    height: 3px;
    background: var(--text-color);
    border-radius: 10px;
    transition: all 0.3s linear;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile menu */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
        align-items: flex-start;
    }

    .hamburger {
        display: flex;
    }

    .menu {
        display: none;
        flex-direction: column;
        width: 100%;
        background-color: var(--menu-bg); /* Theme-adaptive background */
        position: absolute;
        top: 60px;
        left: 0;
        z-index: 9;
    }

    .menu.active {
        display: flex;
    }

    .menu li {
        width: 100%;
        text-align: center;
        padding: 10px 0;
    }

    .theme-toggle {
        margin-top: 10px;
    }
}

/* Main content */
main {
    padding: 20px;
}

/* Hero section */
.hero {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-color);
}

/* Features section with responsive grid */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 270px));
    justify-content: center;
    gap: 5px;
}

/* Card styles */
.card {
    width: 30%;
    min-width: 200px;
    background-color: #222;
    padding: 20px;
    border: var(--card-border);
    border-radius: 5px;
    text-align: center;
    margin: 0 auto;
    color: var(--text-color);
}

.card:focus {
    outline: none;
    box-shadow: var(--glow-shadow);
}

.icon {
    margin-bottom: 10px;
}

/* Form styles */
.contact-form {
    max-width: 600px;
    margin: 20px auto;
    text-align: center;
}

.form-group {
    margin-bottom: 15px;
    text-align: left;
}

.form-input {
    width: 100%;
    padding: 10px;
    box-sizing: border-box;
    border: var(--card-border);
    background-color: var(--input-bg);
    border-radius: 5px;
    color: var(--text-color);
}

.form-input:focus {
    outline: none;
    box-shadow: var(--glow-shadow);
}

/* Autofill override for WebKit browsers */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px var(--input-bg) inset !important;
    -webkit-text-fill-color: var(--text-color) !important;
}

/* Button styles */
button, .btn {
    background-color: var(--button-bg);
    padding: 10px 20px;
    color: var(--text-color);
    text-decoration: none;
    display: inline-block;
    margin: 10px 0;
    border: var(--card-border);
    border-radius: 7px;
    cursor: pointer;
    font-weight: bold;
}

button:hover, .card:hover {
    outline: none;
    box-shadow: var(--glow-shadow);
}

/* Error and success pages */
.error, .success {
    text-align: center;
    padding: 40px 20px;
}

/* Footer */
footer {
    text-align: center;
    padding: 15px;
    background-color: #111;
    position: relative;
    bottom: 0;
    width: 100%;
    color: var(--text-color);
}

/* Bright theme overrides */
body.bright-theme {
    --background-color: #fff;
    --text-color: #000;
    --card-border: 1px solid #ccc;
    --glow-shadow: 0 0 10px #ccc;
    --button-bg: #eee;
    --input-bg: #fff;
    --menu-bg: #eee; /* Light background for bright theme */
}

body.bright-theme .card {
    background-color: #f9f9f9;
}

body.bright-theme .form-input {
    background-color: var(--input-bg);
    border: 1px solid #ccc;
}

body.bright-theme nav, body.bright-theme footer {
    background-color: #eee;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .features .card {
        width: 100%;
        margin: 1rem 0;
    }
}