/* NMR Sample Manager Styles - Modern Layout */

html {
    font-size: 14px !important;
}

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

body {
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.5;
    height: 100vh;
    overflow: hidden;
    font-size: 1rem;
}

/* App Container */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Header */
.app-header {
    background: #303D4F;
    color: white;
    padding: 0.75rem 2rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.app-header h1 {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: #fff;
    margin: 0;
    white-space: nowrap;
}

/* App nav links */
.app-nav {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    align-items: center;
}

.app-nav .nav-link {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #76BDDA;
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    line-height: 1;
}

.app-nav .nav-link:hover {
    background: rgba(118, 189, 218, 0.15);
    color: #fff;
}

.app-nav .nav-link.active {
    background: #fff;
    color: #303D4F;
    font-weight: 600;
}

/* Main Content Layout */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 350px;
    background: white;
    border-right: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e9ecef;
}

/* Folder Section */
.folder-section {
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

.folder-display {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Directory Grid Layout */
.directory-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.directory-row {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    align-items: center;
    gap: 0.5rem;
}

.directory-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #6c757d;
    text-align: right;
}

.directory-path {
    font-size: 0.875rem;
    color: #495057;
    padding: 0.25rem 0.5rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-height: 1.75rem;
    display: flex;
    align-items: center;
}

/* Remove root folder bold styling */

/* Legacy support */
#current-folder,
#root-folder {
    flex: 1;
}

/* Sample List Section */
.sample-list-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    overflow: hidden;
}

.sample-list {
    flex: 1;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: #fafafa;
    margin-bottom: 1rem;
}

.sample-list .placeholder {
    padding: 2rem 1rem;
    text-align: center;
    color: #6c757d;
    font-style: italic;
}

.sample-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #e9ecef;
    transition: all 0.15s ease;
}

.sample-item:last-child {
    border-bottom: none;
}

.sample-item:hover {
    background-color: #f1f3f4;
}

.sample-item.selected {
    background-color: #e3f2fd;
    border-left: 3px solid #2196f3;
}

.sample-item input[type="radio"] {
    margin-right: 0.75rem;
}

.sample-label {
    flex: 1;
    font-size: 1rem;
    color: #495057;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sample-status {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    text-transform: uppercase;
    margin-left: 0.5rem;
    flex-shrink: 0;
}

.status-ejected {
    background-color: #fee;
    color: #d32f2f;
    border: 1px solid #ffcdd2;
}

/* Sample Actions */
.sample-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.sample-actions .btn {
    width: 100%;
}

/* Content Area */
.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
    overflow: hidden;
}

.content-header {
    padding: 1.5rem 2rem 1rem;
    border-bottom: 1px solid #e9ecef;
}

.content-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #495057;
    margin: 0;
}

.content-body {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

/* Welcome Message */
.welcome-message {
    text-align: justify;
    padding: 3rem 2rem;
    color: #6c757d;
}

.welcome-message h3 {
    color: #495057;
    margin-bottom: 1rem;
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    transition: all 0.15s ease;
    display: inline-block;
    color: white;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
}

.btn-primary {
    background-color: #4a90a4;
    /* Muted teal-blue */
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: #3a7a8a;
    /* Darker muted teal */
}

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background-color: #1e7e34;
}

.btn-warning {
    background-color: #ffc107;
    color: #212529;
}

.btn-warning:hover:not(:disabled) {
    background-color: #e0a800;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background-color: #c82333;
}

/* Sample Details View */
.sample-details {
    background: white;
    border-radius: 6px;
    overflow: hidden;
}

.sample-details-header {
    background: #f8f9fa;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #dee2e6;
}

.sample-details-header h3 {
    margin: 0;
    color: #495057;
    font-size: 1.125rem;
}

.sample-details-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* New two-column layout */
.detail-row {
    display: flex;
    align-items: flex-start;
    min-height: 2rem;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 0.5rem;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    width: 120px;
    flex-shrink: 0;
    font-weight: 700;
    color: #495057;
    font-size: 0.9rem;
    padding-top: 0.1rem;
}

.detail-content {
    flex: 1;
    color: #333;
    line-height: 1.4;
    padding-left: 1rem;
}

.detail-subgrid {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.15rem 0.75rem;
    align-items: baseline;
    margin: 0;
    padding: 0;
    list-style: none;
}

.detail-subgrid dt {
    font-weight: 600;
    white-space: nowrap;
}

.detail-subgrid dd {
    margin: 0;
}

.experiments-section {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 2px solid #e9ecef;
}

.experiments-section h4 {
    margin-bottom: 1rem;
    color: #495057;
}

/* Legacy styles for experiments table */
.detail-section {
    margin-bottom: 2rem;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.detail-section h4 {
    color: #495057;
    font-size: 1rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e9ecef;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.detail-item {
    display: flex;
    align-items: flex-start;
}

.detail-label {
    font-weight: 600;
    color: #6c757d;
    min-width: 100px;
    margin-right: 0.75rem;
    font-size: 1rem;
    /* 0.875rem */
}

.detail-value {
    flex: 1;
    color: #495057;
    font-size: 1rem;
    /* 0.875rem */
}

.detail-value.empty {
    color: #adb5bd;
    font-style: italic;
}

/* Component Lists */
.detail-section ul {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
    padding-left: 0;
}

.detail-section li {
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

/* Component Array (legacy) */
.component-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.component-item {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 0.75rem;
}

/* Let JSON Schema Forms use their default fonts */

/* Error and Loading States */
.error {
    color: #dc3545;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 0.75rem 1rem;
    margin: 1rem 0;
}

.form-placeholder {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 2rem;
}

/* Scrollbar Styling */
.sample-list::-webkit-scrollbar,
.content-body::-webkit-scrollbar {
    width: 6px;
}

.sample-list::-webkit-scrollbar-track,
.content-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.sample-list::-webkit-scrollbar-thumb,
.content-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.sample-list::-webkit-scrollbar-thumb:hover,
.content-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Timeline Section */
.timeline-section {
    margin-top: 0.5rem;
}

.btn-timeline {
    background-color: #28a745;
    color: white;
    width: 100%;
    padding: 0.75rem;
    font-weight: 500;
}

.btn-timeline:hover:not(:disabled) {
    background-color: #1e7e34;
    color: white;
}

.btn-timeline:focus {
    background-color: #1e7e34;
    color: white !important;
    outline: none;
}

/* Timeline View */
.timeline-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.9rem;
}

.timeline-table th,
.timeline-table td {
    padding: 0.5rem;
    text-align: left;
    border: 1px solid #ddd;
}

.timeline-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
}

.timeline-group-0 {
    background-color: #e3f2fd;
    /* Light blue */
}

.timeline-group-1 {
    background-color: #fff3e0;
    /* Light orange */
}

.timeline-group-0:hover {
    background-color: #bbdefb;
    /* Slightly darker blue on hover */
}

.timeline-group-1:hover {
    background-color: #ffe0b2;
    /* Slightly darker orange on hover */
}

.timeline-sample-created {
    font-weight: bold;
}

/* Timeline View */
.timeline-view {
    padding: 1rem;
}

.timeline-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.9rem;
}

.timeline-table th,
.timeline-table td {
    padding: 0.5rem;
    text-align: left;
    border: 1px solid #ddd;
}

.timeline-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
}

.timeline-group-0 {
    background-color: #e3f2fd;
    /* Light blue */
}

.timeline-group-1 {
    background-color: #fff3e0;
    /* Light orange */
}

.timeline-group-0:hover {
    background-color: #bbdefb;
    /* Slightly darker blue on hover */
}

.timeline-group-1:hover {
    background-color: #ffe0b2;
    /* Slightly darker orange on hover */
}

.timeline-sample-created {
    font-weight: bold;
}

.timeline-footer {
    margin-top: 1rem;
    font-style: italic;
    color: #6c757d;
    text-align: center;
}

/* ── Responsive header/nav ───────────────────────────── */
@media (max-width: 640px) {
    .app-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 0.75rem 1rem;
    }

    .app-header h1 {
        font-size: 1.1rem;
    }

    .app-nav {
        gap: 2px;
    }

    .app-nav .nav-link {
        padding: 5px 10px;
        font-size: 0.8rem;
    }
}