/* Basic reset-ish styling */
body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #0f172a; /* dark blue */
    color: #e5e7eb;      /* light gray */
}

/* Top navigation bar */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background: #020617; /* darker */
    border-bottom: 1px solid #1f2937;
    position: sticky;
    top: 0;
    z-index: 10;
}

.nav-logo {
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.nav-links {
    display: flex;
    gap: 1rem;
}

.nav-link {
    color: #9ca3af;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    transition: background 0.2s, color 0.2s;
}

.nav-link:hover {
    background: #111827;
    color: #e5e7eb;
}

.nav-link.active {
    background: #2563eb;
    color: white;
}

/* Page layout */
.page-content {
    display: flex;
    justify-content: center;
    padding: 2rem 1rem;
}

/* Panels (NATO / Binary sections) */
.panel {
    width: 100%;
    display: flex;
    justify-content: center;   /* Center the converter panel */
}

.panel[hidden] {
    display: none;
}

/* Shared converter form styling */
.converter-form {
    width: 60%;               /* ~60% width */
    max-width: 900px;
    min-width: 280px;
    margin: 0 auto;           /* ⭐ Center horizontally */
    padding: 1.5rem 1.75rem;
    background: #020617;
    border-radius: 0.75rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    border: 1px solid #1f2937;
}

/* Titles & labels */
.converter-form h1 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    text-align: center;
}

.field-label {
    display: block;
    margin: 1rem 0 0.25rem;
    font-size: 0.9rem;
    color: #9ca3af;
}

/* Input box */
.text-input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid #4b5563;
    background: #020617;
    color: #e5e7eb;
    font-size: 0.95rem;
    box-sizing: border-box;
}

.text-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 1px #2563eb;
}

/* Result box */
.outputBox {
    width: 100%;
    min-height: 4rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid #4b5563;
    background: #020617;
    color: #e5e7eb;
    box-sizing: border-box;
    word-wrap: break-word;
    margin-top: 0.25rem;
}

.outputBox a {
    color: #38bdf8;
    text-decoration: none;
}

.outputBox a:hover {
    text-decoration: underline;
}

/* Radio mode selector */
.mode-select {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.mode-select label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* Buttons */
.button-row {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.button-row button {
    flex: 0 0 auto;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    border: 1px solid #2563eb;
    background: #2563eb;
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s, box-shadow 0.1s;
}

.button-row button:hover {
    background: #1d4ed8;
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
}

.button-row button:active {
    transform: translateY(1px);
    box-shadow: none;
}

/* Error message text */
.error-message {
    margin: 0.35rem 0 0.5rem;
    min-height: 1em;
    font-size: 0.85rem;
    color: #fecaca; /* light red text */
}

/* Soft red highlight for validation errors */
.text-input.has-error,
.outputBox.has-error {
    border-color: #fca5a5;                           /* soft red border */
    background-color: rgba(248, 113, 113, 0.06);     /* very light red bg */
    box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.3);  /* subtle glow */
}
