/* Core Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f4f4f9;
    color: #333;
    line-height: 1.6;
    padding: 20px;
}

/* Header and Footer */
header, footer {
    text-align: center;
    padding: 10px 0;
    margin-bottom: 20px;
}

header h1 {
    color: #1a1a40;
    font-size: 2em;
}

header p, footer p {
    color: #666;
}

/* Main Container */
main {
    max-width: 1000px;
    margin: 0 auto;
    background-color: #ffffff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

/* Form Styling */
form {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

input[type="text"] {
    flex-grow: 1;
    padding: 12px;
    font-size: 16px;
    border: 2px solid #ccc;
    border-radius: 4px 0 0 4px;
    max-width: 400px;
}

button[type="submit"] {
    padding: 12px 25px;
    font-size: 16px;
    background-color: #1a1a40;
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button[type="submit"]:hover {
    background-color: #3c3c78;
}

/* Results Container */
#results-container h2 {
    margin-top: 25px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
    color: #1a1a40;
}

/* Structured Table Output */
.results-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.results-table th, .results-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.results-table thead th.section-header {
    background-color: #f0f0f5;
    font-size: 1.1em;
    font-weight: bold;
    color: #1a1a40;
    border-top: 2px solid #1a1a40;
    border-bottom: 1px solid #1a1a40;
}

.key-cell {
    width: 30%;
    font-weight: 600;
    background-color: #f9f9f9;
}

/* Raw Output */
.raw-output-container {
    background-color: #2b2b2b;
    color: #e0e0e0;
    padding: 15px;
    border-radius: 4px;
    overflow-x: auto;
    font-size: 0.9em;
}

.raw-output-container pre {
    white-space: pre-wrap; /* Ensures long lines wrap */
    word-wrap: break-word;
    margin: 0;
}

/* Error Styling */
.error-container {
    text-align: center;
    padding: 50px;
}

.error-message {
    background-color: #ffebeb;
    border: 1px solid #ff0000;
    color: #cc0000;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

a {
    color: #1a1a40;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}