/* --- Global Styles --- */
body { 
    font-family: sans-serif; 
    margin: 0; 
    padding: 20px; 
    background-color: #f9f9f9;
    text-align: center;
}

h2 { font-size: 1.8rem; color: #333; margin-top: 10px; }

/* --- Layout Containers --- */
.search-box, .nav-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 600px;
    margin: 0 auto 20px auto;
}

@media (min-width: 600px) {
    .nav-container { flex-direction: row; justify-content: center; gap: 15px; }
}

/* --- Global Inputs & Tips --- */
input {
    font-size: 1.5rem;
    padding: 15px;
    border: 2px solid #008000;
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
}

.tips {
    font-size: 1rem;
    color: #555;
    line-height: 1.6;
    max-width: 500px;
    margin: 0 auto;
    text-align: left;
    background: #eee;
    padding: 15px;
    border-radius: 8px;
}

/* --- Buttons --- */
.btn-submit, .btn-nav, .btn-danger {
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    text-align: center;
    text-decoration: none;
}

.btn-submit { font-size: 1.5rem; padding: 15px; background-color: #008000; color: white; width: 100%; }
.btn-nav { font-size: 1.2rem; padding: 20px; background-color: #008000; color: white; flex: 1; }

.btn-danger {
    background-color: #B22222 !important;
    color: white !important;
    padding: 10px 5px;
    font-size: 0.9rem;
    width: 100%;
}

/* --- Sticky Header --- */
.sticky {
    position: sticky;
    top: 0;
    background-color: #cae8ca;
    border-bottom: 2px solid #4CAF50;
    padding: 0; /* Keeps table headers aligned to edges */
    z-index: 100;
}

/* --- Tables (Results & Admin) --- */
#results, .fixed-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1.1rem;
    table-layout: fixed;
}

#results th, #results td, 
.fixed-table th, .fixed-table td {
    padding: 15px 10px;
    border-bottom: 1px solid #ddd;
    text-align: left;
    vertical-align: top;
    white-space: normal;
    word-wrap: break-word;
    box-sizing: border-box;
}

/* Three columns for results/history */
.fixed-table th, .fixed-table td { width: 33.333%; }

/* Four columns for Admin */
.admin-table th, .admin-table td { width: 25%; }

/* Table Row Styling */
tr:nth-child(even) { background: #f2f2f2; }
table#results tr:not(:first-child) { cursor: pointer; }
table#results tr:not(:first-child):hover { background-color: #ddd; }
table#results tr:active { background-color: #4CAF50 !important; color: white; }

/* Header Specifics */
.fixed-table th { font-weight: bold; background-color: #cae8ca; }

/* Utilities */
.admin-link { margin-top: 40px; opacity: 0.5; }
.mt-20 { margin-top: 20px; }
