/* -----------------------------
   Color Mode Variables
   ----------------------------- */
:root {
    --bg-color: #f5f5f5;
    --text-color: #333;
    --link-color: #2b5797;
    --link-hover: #1d3c7d;
    --input-bg: #fff;
    --input-border: #ccc;
    --table-bg: #fff;
    --table-alt-bg: #f9f9f9;
    --table-header-bg: #2b5797;
    --table-header-color: #fff;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1e1e1e;
        --text-color: #ddd;
        --link-color: #01708f;
        --link-hover: #0581ce;
        --input-bg: #2c2c2c;
        --input-border: #555;
        --table-bg: #2c2c2c;
        --table-alt-bg: #333;
        --table-header-bg: #444;
        --table-header-color: #ddd;
    }
}

/* -----------------------------
   Container
   ----------------------------- */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 1rem;
}

/* -----------------------------
   Body
   ----------------------------- */
body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.5;
    padding: 1rem;
}

/* -----------------------------
   Headings
   ----------------------------- */
h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}
h2 {
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 0.5rem;
}

/* -----------------------------
   Links
   ----------------------------- */
a {
    color: var(--link-color);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
    color: var(--link-hover);
}

/* -----------------------------
   Forms
   ----------------------------- */
form {
    display: flex;
    flex-direction: column; /* vertical stacking */
    gap: 0.75rem;
    margin-bottom: 0rem;
}

form input[type="text"],
form input[type="number"],
form input[type="email"],
form input[type="password"] {
    flex: none;          /* don't stretch in flex layout */
    height: auto;        /* let content dictate height */
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    border: 1px solid var(--input-border);
    border-radius: 4px;
    background-color: var(--input-bg);
    color: var(--text-color);
    max-width: 400px;    /* optional max width for desktop */
    box-sizing: border-box;
}

form button {
    padding: 0.5rem 1rem;
    border: none;
    background-color: var(--link-color);
    color: white;
    border-radius: 4px;
    cursor: pointer;
    width: fit-content; /* button only as wide as its content */
}

form button:hover {
    background-color: var(--link-hover);
}

/* -----------------------------
   Tables
   ----------------------------- */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background-color: var(--table-bg);
    border-radius: 4px;
    overflow: hidden;
}

table th, table td {
    padding: 0.75rem;
    border-bottom: 1px solid #555;
    text-align: left;
    color: var(--text-color);
}

table th {
    background-color: var(--table-header-bg);
    color: var(--table-header-color);
}

table tr:nth-child(even) {
    background-color: var(--table-alt-bg);
}

/* -----------------------------
   Responsive Typography & Layout
   ----------------------------- */
@media (max-width: 768px) {
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    form input, form button { width: 100%; max-width: 100%; }
}

@media (max-width: 480px) {
    h1 { font-size: 1.25rem; }
    h2 { font-size: 1rem; }
    body { padding: 0.5rem; }
    form { gap: 0.5rem; }
}

/* Flex container for radius + unit */
.radius-flex {
    display: flex;
    align-items: center;
    gap: 0.25rem;  /* small gap between input and label */
}

.radius-flex input {
    flex: 1 1 80px; /* reasonable width, flexible */
    height: 2rem;
    padding: 0.25rem 0.5rem;
}

.radius-flex .unit-label {
    white-space: nowrap;
    font-size: 0.9rem;
    color: var(--text-color);
}

/* Delete button styling */
form button.delete-btn {
    background-color: #7e0505; /* soft red */
    color: white;
    border-radius: 4px;
    padding: 0.5rem 1rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

form button.delete-btn:hover {
    background-color: #c95c5c; /* slightly darker on hover */
}

