/* Reset and base styles */
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    padding: 12px;
    background: #f8f9fa;
    color: #212529;
    line-height: 1.6;
}

/* Typography */
h1 {
    color: #212529;
    font-size: 32px;
    margin-bottom: 10px;
}

h2 {
    color: #495057;
    font-size: 22px;
    margin-top: 25px;
    margin-bottom: 12px;
}

p {
    color: #6c757d;
    margin: 10px 0;
}

/* Buttons */
button, .btn {
    background: #007bff;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 0;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s;
}

button:hover, .btn:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

.btn-success {
    background: #28a745;
}

.btn-success:hover {
    background: #218838;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
}

.btn-secondary {
    background: #6c757d;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* Forms */
.form-group {
    margin: 20px 0;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
}

input, textarea {
    width: 100%;
    padding: 8px;
    font-size: 12px;
    border: 1px solid #ced4da;
    border-radius: 0;
    background: white;
    font-family: inherit;
}

input:focus, textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

textarea {
    min-height: 100px;
    resize: vertical;
}

small {
    color: #6c757d;
    font-size: 13px;
}

/* Cards and containers */
.card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0;
    padding: 12px;
    margin: 12px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.info-box {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    padding: 15px;
    margin: 20px 0;
    border-radius: 0;
}

.success-box {
    background: #d4edda;
    border-left: 4px solid #28a745;
    padding: 15px;
    margin: 20px 0;
    border-radius: 0;
    color: #155724;
}

.warning-box {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 15px;
    margin: 20px 0;
    border-radius: 0;
    color: #856404;
}

/* Navigation */
.nav {
    margin: 20px 0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.back-link {
    color: #007bff;
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 0;
    font-size: 13px;
    font-weight: 600;
}

.badge-success {
    background: #28a745;
    color: white;
}

.badge-info {
    background: #17a2b8;
    color: white;
}

/* Lists */
.item-list {
    margin: 20px 0;
}

.item {
    background: white;
    border: 1px solid #dee2e6;
    padding: 15px;
    margin: 10px 0;
    border-radius: 0;
    transition: all 0.2s;
}

.item:hover {
    border-color: #007bff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.item a {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

.item a:hover {
    text-decoration: underline;
}

/* Mode tabs */
.mode-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.mode-tab {
    padding: 10px 20px;
    background: #e9ecef;
    border: 2px solid transparent;
    cursor: pointer;
    border-radius: 0;
    font-weight: 500;
    transition: all 0.2s;
}

.mode-tab.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.mode-tab:hover {
    background: #dee2e6;
}

.mode-tab.active:hover {
    background: #0056b3;
}

.mode-content {
    display: none;
}

.mode-content.active {
    display: block;
}

.file-upload {
    margin: 10px 0;
}

/* Results page styles - Optimized for detailed image inspection */
.grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 15px 0;
}

.image-card {
    background: white;
    border: 1px solid #dee2e6;
    padding: 6px;
    border-radius: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.image-card img {
    width: 100%;
    height: auto;
    border-radius: 0;
    margin-bottom: 6px;
    cursor: pointer;
}

.rating {
    margin: 6px 0 6px 0;
    padding: 0;
    display: flex;
    gap: 4px;
}

.rating label {
    flex: 1;
    text-align: center;
    padding: 6px 4px;
    font-size: 11px;
    cursor: pointer;
    font-weight: 500;
    background: #e9ecef;
    border: 1px solid #dee2e6;
    transition: all 0.15s;
}

.rating label:hover {
    background: #dee2e6;
}

.rating input {
    display: none;
}

.rating input:checked + label {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.prompt-toggle {
    width: 100%;
    background: #e9ecef;
    border: 1px solid #dee2e6;
    padding: 4px;
    margin: 0 0 6px 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    color: #495057;
    text-align: center;
}

.prompt-toggle:hover {
    background: #dee2e6;
}

.prompt-used {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-top: none;
    padding: 6px;
    margin: -6px 0 6px 0;
    border-radius: 0;
    font-size: 12px;
    color: #495057;
    font-family: 'Courier New', monospace;
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.prompt-used.hidden {
    display: none;
}

.input-images {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.input-images img {
    width: 150px;
    height: auto;
    border-radius: 0;
    border: 2px solid #dee2e6;
}

/* Analysis page styles */
.stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 20px 0;
}

.stat-card {
    background: white;
    border: 1px solid #dee2e6;
    padding: 20px;
    border-radius: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stat-card h3 {
    margin-top: 0;
    color: #495057;
}

.stat-value {
    font-size: 36px;
    font-weight: bold;
    color: #007bff;
}

.analysis {
    background: white;
    border: 1px solid #dee2e6;
    padding: 20px;
    margin: 20px 0;
    border-radius: 0;
    white-space: pre-wrap;
    line-height: 1.6;
}

/* Versions page styles */
.version-card {
    background: white;
    border: 2px solid #dee2e6;
    padding: 20px;
    margin: 20px 0;
    border-radius: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.version-card.current {
    border-color: #28a745;
    background: #f8fff9;
}

.version-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.version-number {
    font-size: 24px;
    font-weight: bold;
    color: #007bff;
}

.current-badge {
    background: #28a745;
    color: white;
    padding: 4px 12px;
    border-radius: 0;
    font-size: 14px;
}

.metadata {
    background: #f5f5f5;
    padding: 10px;
    border-radius: 0;
    margin: 10px 0;
    font-size: 14px;
}

.metadata-item {
    margin: 5px 0;
}

.prompt-text {
    background: #f9f9f9;
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 0;
    white-space: pre-wrap;
    font-family: monospace;
    font-size: 13px;
    line-height: 1.6;
    max-height: 300px;
    overflow-y: auto;
}

.toggle-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 0;
    cursor: pointer;
    margin-top: 10px;
}

.toggle-btn:hover {
    background: #0056b3;
}

.prompt-container {
    margin-top: 15px;
}

.hidden {
    display: none;
}

/* Progress page styles */
.progress {
    background: #f0f0f0;
    height: 30px;
    border-radius: 0;
    overflow: hidden;
}

.progress-bar {
    background: #007bff;
    height: 100%;
    transition: width 0.3s;
}

.status {
    margin: 20px 0;
    font-size: 18px;
}

/* Feedback selection */
.feedback-list {
    margin: 20px 0;
}

.feedback-item {
    background: #f9f9f9;
    border: 1px solid #ddd;
    padding: 15px;
    margin: 10px 0;
    border-radius: 0;
}

.feedback-item:hover {
    background: #f0f0f0;
}

.feedback-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.feedback-prompt {
    font-weight: bold;
    color: #333;
}

.feedback-stats {
    font-size: 14px;
    color: #666;
}

.checkbox {
    margin-right: 10px;
    transform: scale(1.3);
    cursor: pointer;
    width: auto;
}
