/**
 * Minimalist Style Sheet
 * Black, white, gray color palette
 */

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

/* Base */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
}

/* Header */
header {
    background-color: #fff;
    border-bottom: 1px solid #e0e0e0;
    padding: 1rem 0;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
}

.logo a {
    color: #000;
    text-decoration: none;
}

/* Navigation */
.main-nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.main-nav a {
    color: #666;
    text-decoration: none;
    transition: color 0.2s;
}

.main-nav a:hover {
    color: #000;
}

/* Main Content */
main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
    min-height: calc(100vh - 200px);
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    flex-direction: row;
}

.form-group label {
    min-width: 160px;
    width: 160px;
    margin-right: 12px;
    margin-bottom: 0;
    color: #333;
    font-weight: 500;
    display: block;
    flex-shrink: 0;
}

.form-group input,
.form-group select,
.form-group textarea {
    flex: 1;
    max-width: 400px;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

/* Checkbox and radio button groups */
.form-group-checkbox,
.form-group:has(input[type="checkbox"]),
.form-group:has(input[type="radio"]) {
    align-items: center;
}

.form-group input[type="checkbox"],
.form-group input[type="radio"] {
    margin-right: 6px;
    margin-left: 0;
    margin-top: 0;
    margin-bottom: 0;
    flex-shrink: 0;
    width: auto;
    max-width: none;
}

.form-group-checkbox label,
.form-group label:has(input[type="checkbox"]),
.form-group label:has(input[type="radio"]) {
    min-width: auto;
    width: auto;
    font-weight: normal;
    display: flex;
    align-items: center;
    margin-right: 0;
    line-height: 1.5;
}

/* Textarea should take more space */
.form-group textarea {
    max-width: 600px;
    min-height: 100px;
}

/* Special handling for nested wrappers (like company search) */
.form-group .company-search-wrapper,
.form-group .search-wrapper {
    flex: 1;
    max-width: 400px;
}

.form-group .company-search-wrapper input,
.form-group .search-wrapper input {
    max-width: 100%;
}

/* Form rows (for multi-column layouts) */
.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 200px;
    margin-bottom: 0;
}

/* Small form groups (for shorter fields like state, zip) */
.form-group-small input,
.form-group-small select {
    max-width: 150px;
}

/* Medium form groups */
.form-group-medium input,
.form-group-medium select {
    max-width: 250px;
}

.btn-primary {
    background-color: #000;
    color: #fff;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: #333;
}

/* Login */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.login-box {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.login-box h1 {
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Footer */
footer {
    background-color: #f5f5f5;
    border-top: 1px solid #e0e0e0;
    padding: 1rem 0;
    text-align: center;
    color: #666;
    margin-top: 4rem;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

table th,
table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

table th {
    background-color: #f5f5f5;
    font-weight: 600;
}

/* Sortable headers */
.sortable-header {
    color: #333;
    text-decoration: none;
    cursor: pointer;
    display: inline-block;
    padding-right: 0.5rem;
    transition: color 0.2s;
}

.sortable-header:hover {
    color: #000;
    text-decoration: underline;
}

/* Comments */
.comments-list {
    margin-top: 1rem;
}

.comment-item {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 1rem;
    background-color: #f9f9f9;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.comment-date {
    color: #666;
    font-size: 0.9rem;
}

.comment-content {
    margin-top: 0.5rem;
}

/* Detail sections */
.detail-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background-color: #fff;
}

.detail-section h2 {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.detail-section dl {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 0.5rem 1rem;
}

.detail-section dt {
    font-weight: 600;
    color: #666;
}

.detail-section dd {
    margin: 0;
}

/* Form actions */
.form-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    background-color: #666;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.2s;
}

.btn-small:hover {
    background-color: #333;
}

.btn-secondary {
    background-color: #666;
    color: #fff;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.2s;
}

.btn-secondary:hover {
    background-color: #333;
}

.btn-danger {
    background-color: #d32f2f;
    color: #fff;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.btn-danger:hover {
    background-color: #b71c1c;
}

/* Utilities */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }

/* Loading Spinner */
.loading-spinner {
    text-align: center;
    padding: 2rem;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #333;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner p {
    color: #666;
    margin: 0;
}

.error {
    color: #d32f2f;
    padding: 1rem;
    background-color: #ffebee;
    border-radius: 4px;
}

.debug-info {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background-color: #f5f5f5;
    border-left: 3px solid #666;
    font-family: monospace;
    font-size: 0.85rem;
    color: #666;
}

