/* Copyright (c) 2025 Michael D Henderson. All rights reserved. */

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background: #1a1a2e;
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-brand a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.25rem;
}

.app-container {
    display: flex;
    flex: 1;
    min-height: 0;
}

.sidebar {
    width: 220px;
    background: #f5f5f5;
    border-right: 1px solid #ddd;
    padding: 1rem;
    flex-shrink: 0;
}

.sidebar-nav h3,
.turn-selector h3 {
    margin: 0 0 0.75rem 0;
    font-size: 0.875rem;
    text-transform: uppercase;
    color: #666;
    letter-spacing: 0.05em;
}

.sidebar-nav ul {
    list-style: none;
    margin: 0 0 1.5rem 0;
    padding: 0;
}

.sidebar-nav li {
    margin-bottom: 0.25rem;
}

.sidebar-nav a {
    display: block;
    padding: 0.5rem 0.75rem;
    color: #1a1a2e;
    text-decoration: none;
    border-radius: 4px;
}

.sidebar-nav a:hover {
    background: #e8e8e8;
}

.sidebar-nav a.active {
    background: #1a1a2e;
    color: white;
}

.turn-selector select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    background: white;
}

.turn-selector select:focus {
    outline: none;
    border-color: #1a1a2e;
}

main {
    flex: 1;
    padding: 2rem;
    max-width: 1000px;
    overflow-y: auto;
}

footer {
    background: #f5f5f5;
    padding: 1rem 2rem;
    text-align: center;
    color: #666;
}

h1 {
    color: #1a1a2e;
}

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

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

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

tr:hover {
    background: #f9f9f9;
}

/* Login styles */
.login-container {
    max-width: 400px;
    margin: 2rem auto;
    padding: 2rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
}

.login-container h1 {
    margin-top: 0;
    text-align: center;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: #1a1a2e;
}

button[type="submit"] {
    width: 100%;
    padding: 0.75rem;
    background: #1a1a2e;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
}

button[type="submit"]:hover {
    background: #2d2d4a;
}

.error-message {
    background: #fee;
    border: 1px solid #fcc;
    color: #c00;
    padding: 0.75rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

/* User info in header */
.user-info {
    float: right;
    font-size: 0.9rem;
}

.user-info a {
    margin-left: 1rem;
}

/* Clickable table rows */
.clickable-row {
    cursor: pointer;
}

.clickable-row:hover {
    background: #e8f4f8;
}

/* Detail pages */
.unit-detail, .tile-detail {
    max-width: 900px;
}

.unit-summary, .tile-summary {
    background: #f9f9f9;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
}

.unit-summary dl, .tile-summary dl {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.5rem 1rem;
    margin: 0;
}

.unit-summary dt, .tile-summary dt {
    font-weight: 600;
    color: #666;
}

.act-section {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.act-section h3 {
    margin-top: 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.steps-table {
    font-size: 0.9rem;
}

.status-ok {
    color: #28a745;
    font-weight: bold;
}

.status-fail {
    color: #dc3545;
    font-weight: bold;
}

.special-marker {
    color: #ffc107;
    margin-left: 0.25rem;
}

.label {
    color: #666;
    font-size: 0.9em;
    margin-left: 0.25rem;
}

/* Upload page styles */
.upload-container {
    max-width: 700px;
}

.upload-config {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.drop-zone {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    margin-bottom: 1.5rem;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: #1a1a2e;
    background: #f0f4f8;
}

.drop-zone-content p {
    margin: 0.5rem 0;
}

.drop-icon {
    font-size: 2.5rem;
}

.drop-hint {
    color: #888;
    font-size: 0.9rem;
}

.upload-list {
    margin-bottom: 1rem;
}

.upload-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: #f9f9f9;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.upload-name {
    flex: 1;
    font-weight: 500;
}

.upload-status {
    font-size: 0.9rem;
}

.upload-status.uploading {
    color: #666;
}

.upload-status.success {
    color: #28a745;
}

.upload-status.error {
    color: #dc3545;
}

.upload-progress {
    width: 100px;
    height: 6px;
    background: #ddd;
    border-radius: 3px;
    overflow: hidden;
}

.upload-progress-bar {
    height: 100%;
    background: #1a1a2e;
    width: 0;
    transition: width 0.2s;
}

.upload-results {
    margin-top: 1rem;
}

.upload-result {
    padding: 0.75rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.result-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.result-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}
