/* General Body & Typography */
html, body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    background-color: #1e1e1e; /* Dark theme background */
    color: #e0e0e0; /* Light text color */
}

/* Container/Wrapper */
.container {
    width: 80%;
    max-width: 900px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: #2c2c2c; /* Darker container background */
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(100,100,100,0.1); /* Subtle glow shadow */
}

/* Headings */
h1 {
    text-align: center;
    color: #6cb2f7; /* Lighter, distinct color for h1 */
    margin-bottom: 1.5rem;
}

h2 {
    color: #5cadff; /* Lighter accent for h2 */
    margin-top: 2rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid #444; /* Darker border for h2 */
    padding-bottom: 0.5rem;
}

h4 { /* For "Activity Log:" */
    color: #c0c0c0; /* Light and readable for h4 */
}

/* Sections */
section {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border: 1px solid #484848; /* Darker border for sections */
    border-radius: 5px;
    background-color: #383838; /* Darker section background */
}

/* Buttons (general styling for button and a.button) */
button, a.button {
    display: inline-block;
    padding: 10px 20px;
    font-size: 1rem;
    color: #ffffff; /* Ensure button text is light */
    background-color: #0d6efd; /* Updated button background color */
    border: none;
    border-radius: 5px;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button:hover, a.button:hover {
    background-color: #3b8bf4; /* Lighter/brighter hover state */
}

button:active, a.button:active {
    background-color: #005cbf; /* Darker/more intense active state */
}

/* Disabled Button Styling */
.disabled, .disabled:hover, .disabled:active {
    background-color: #555; /* Darker gray for disabled background */
    color: #aaa; /* Lighter gray for disabled text */
    cursor: not-allowed;
}

/* Form Elements (Radio Buttons) */
/* Labels will inherit body color, which is now light. Explicit styling if needed: */
form label {
    color: #e0e0e0; /* Ensuring label text is light if it doesn't inherit correctly */
}

form div { /* Assuming radio buttons might be in a div for spacing */
    margin-bottom: 0.75rem;
}

input[type="radio"] + label {
    margin-left: 0.5rem;
}

/* Ensure each radio button and its label are on a new line for clarity */
form input[type="radio"], form label {
    display: inline; /* Keep them inline */
}
form label br { /* Hide the <br> if we want them on one line */
    /* display: none; */ /* Uncomment if you want label on same line as radio */
}
/* Or, for block display of each radio group: */
form > div, /* If radios are wrapped in divs */
form > label /* If labels are direct children and meant to group with an input */ {
    /* display: block; */ /* This would be too general */
    /* margin-bottom: 0.5rem; */ /* Handled by form div or specific wrapper */
}
/* Targeting the <br> approach used in index.html for spacing */
form input[type="radio"] ~ br {
    margin-bottom: 0.5rem; /* Add space after the <br> for each radio line */
}


/* Paragraphs & Lists */
p {
    margin-bottom: 1rem;
}

ol, ul {
    padding-left: 20px; /* Default indentation */
    margin-bottom: 1rem;
}

/* Log Area Styling */
pre#serialLog {
    background-color: #222 !important; /* Dark background for log area, !important to override inline */
    color: #d0d0d0 !important; /* Light text for log area, !important to override inline */
    border: 1px solid #444 !important; /* Darker border for log area, !important to override inline */
    /* height, overflow-y, padding, border-radius, white-space, word-wrap are still from inline style */
}

ol li, ul li {
    margin-bottom: 0.5rem; /* Spacing between list items */
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .container {
        width: 95%;
        padding: 1rem;
    }
    h1 {
        font-size: 1.8rem;
    }
    h2 {
        font-size: 1.3rem;
    }
    button, a.button {
        padding: 12px 15px; /* Adjust padding for touch targets */
        font-size: 0.95rem;
        width: 100%; /* Make buttons full width on small screens */
        box-sizing: border-box; /* Include padding and border in the element's total width and height */
    }
    form input[type="radio"] {
      margin-bottom: 0.5rem; /* Add some space below radio buttons for touch */
    }
}

/* Navigation Bar styles */
nav {
    background-color: #333;
    overflow: hidden;
    padding: 10px 0;
    text-align: center;
}

nav ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
}

nav ul li {
    display: inline;
}

nav ul li a {
    color: white;
    text-decoration: none;
    padding: 14px 16px;
    display: inline-block;
}

nav ul li a:hover {
    background-color: #555;
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.5rem;
    }
    h2 {
        font-size: 1.1rem;
    }
    .container {
        margin-top: 1rem;
        margin-bottom: 1rem;
    }
}
