/* Photo Stack Finder Orchestrator Styles */

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem;
    background: linear-gradient(135deg, var(--primary-color), #3b82f6);
    color: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

main {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.config-section,
.progress-section {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

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

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.input-with-button {
    display: flex;
    gap: 0.5rem;
}

.input-with-button input {
    flex: 1;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input[type="text"]:focus,
.form-group input[type="number"]:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.form-group input[type="checkbox"] {
    margin-right: 0.5rem;
    width: auto;
}

/* Advanced Options */
.advanced-options {
    margin: 2rem 0;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1rem;
}

.advanced-options summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 1.1rem;
    padding: 0.5rem;
    user-select: none;
    color: var(--primary-color);
}

.advanced-options summary:hover {
    color: var(--primary-hover);
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 1.5rem;
}

.option-group h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

/* Action Buttons */
.actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-primary,
.btn-secondary,
.btn-danger {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    flex: 1;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

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

.btn-danger {
    background-color: var(--error-color);
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

.btn-browse {
    background-color: var(--secondary-color);
    color: white;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-browse:hover {
    background-color: #475569;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Status Badge (for non-interactive pipeline status display) */
.status-badge {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: #e9ecef;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    color: #495057;
    font-size: 1rem;
    font-weight: 600;
    cursor: default;
    user-select: none;
}

.status-badge:hover {
    background-color: #e9ecef;
    cursor: default;
    transform: none;
    box-shadow: none;
}

/* Progress Section */
/* Error Display */
.error-container {
    background-color: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.error-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.error-header strong {
    color: #856404;
    font-size: 1.1rem;
}

.btn-copy {
    background-color: #ffc107;
    color: #856404;
    border: 1px solid #856404;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background-color 0.2s;
}

.btn-copy:hover {
    background-color: #ffca2c;
}

.error-text {
    background-color: #fff;
    border: 1px solid #ffc107;
    border-radius: 4px;
    padding: 1rem;
    margin: 0;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    color: #721c24;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.stage-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.stage {
    display: grid;
    grid-template-columns: 2rem 1fr auto auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: background-color 0.2s;
}

.stage-icon {
    font-size: 1.5rem;
    text-align: center;
}

.stage-name {
    font-weight: 500;
}

.stage-status {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.stage-review-btn {
    padding: 0.5rem 1rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    white-space: nowrap;
}

.stage-review-btn:hover:not(:disabled) {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.stage-review-btn:disabled {
    background-color: var(--secondary-color);
    cursor: not-allowed;
    opacity: 0.5;
}

/* Stage states */
.stage.pending {
    background-color: var(--bg-color);
}

.stage.running {
    background-color: #dbeafe;
    border-color: var(--primary-color);
}

.stage.completed {
    background-color: #d1fae5;
    border-color: var(--success-color);
}

.stage.error {
    background-color: #fee2e2;
    border-color: var(--error-color);
}

/* Footer */

/* Directory Browser Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-secondary);
    line-height: 1;
    padding: 0;
    width: 2rem;
    height: 2rem;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.breadcrumb {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    padding: 0.5rem;
    background-color: var(--bg-color);
    border-radius: 4px;
    word-break: break-all;
}

.directory-list {
    min-height: 200px;
}

.dir-item {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dir-item:hover {
    background-color: var(--bg-color);
    border-color: var(--primary-color);
}

.dir-item.parent {
    background-color: var(--bg-color);
}

.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 1rem;
}

.modal-footer button {
    flex: 1;
}

/* Benchmark Method List */

/* Method states */

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    header h1 {
        font-size: 1.75rem;
    }

    .options-grid {
        grid-template-columns: 1fr;
    }

    .actions {
        flex-direction: column;
    }

    .modal-content {
        width: 95%;
        max-height: 90vh;
    }
}

/* Info Section (Getting Started) */
.info-section {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border-left: 4px solid var(--primary-color);
    border-radius: 8px;
    padding: 0;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.info-section details summary {
    padding: 1rem 1.5rem;
    cursor: pointer;
    user-select: none;
    font-size: 1.1rem;
    color: var(--primary-color);
    list-style: none;
}

.info-section details summary::-webkit-details-marker {
    display: none;
}

.info-section details[open] summary {
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.info-section .info-content {
    padding: 0 1.5rem 1.5rem 1.5rem;
}

.info-section h3 {
    color: var(--text-primary);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.info-section ul, .info-section ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.info-section li {
    margin-bottom: 0.5rem;
}

.info-section .checklist {
    list-style: none;
    margin-left: 0;
}

.info-section .checklist li {
    padding-left: 1.5rem;
    position: relative;
}

.info-section code {
    background: rgba(0, 0, 0, 0.05);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9em;
}

.info-section a {
    color: var(--primary-color);
    text-decoration: none;
}

.info-section a:hover {
    text-decoration: underline;
}
