:root {
    /* Pando Brand Colors */
    --pando-teal: #3BB3B1;
    --pando-teal-dark: #2A9896;
    --pando-orange: #F5A623;
    --pando-orange-dark: #E09000;
    
    --primary-color: #3BB3B1;
    --primary-dark: #2A9896;
    --secondary-color: #64748b;
    --accent-color: #F5A623;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --text-color: #333;
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --bg-tertiary: #eeeeee;
    --light-bg: #f5f5f5;
    --border-color: #e0e0e0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

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

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-bg);
    overflow-x: hidden;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 30px 30px 30px;
}

/* Navigation Bar */
.navbar {
    display: flex;
    align-items: center;
    background-color: var(--secondary-color);
    height: 64px;
    padding: 0 clamp(0.4rem, 1.5vw, 1.5rem);
    margin: 0 -30px 20px -30px;
    border-radius: 0;
    box-sizing: border-box;
    gap: clamp(0.3rem, 1vw, 1rem);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.navbar-logo {
    height: clamp(28px, 5vw, 50px);
    width: auto;
    object-fit: contain;
    mix-blend-mode: screen;
}

.navbar-title {
    font-size: clamp(0.75rem, 1.8vw, 1.3rem);
    font-weight: 600;
    color: white;
}

.navbar-brand:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.navbar-brand:hover .navbar-logo {
    opacity: 0.85;
}

.navbar-brand:hover .navbar-title {
    color: var(--pando-teal);
}

.navbar-links {
    display: flex;
    align-items: center;
    gap: clamp(0.2rem, 0.8vw, 1rem);
    margin-left: auto;
}

.navbar-links a {
    color: white;
    text-decoration: none;
    padding: 0.85rem 1rem;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    line-height: 1.2;
    white-space: nowrap;
    background-color: #4a4a4a;
}

.navbar-links a:hover {
    color: white;
    background-color: var(--primary-color);
    text-decoration: none;
}

.navbar-links .docs-btn {
    background-color: var(--pando-teal);
}

.navbar-links .docs-btn:hover {
    background-color: var(--pando-teal-dark);
}

.navbar-links .home-btn {
    background-color: #28a745;
}

.navbar-links .home-btn:hover {
    background-color: #218838;
}

.navbar-links .logout-link {
    background-color: #e74c3c;
}

.navbar-links .logout-link:hover {
    background-color: #c0392b;
}

.user-info {
    color: #bdc3c7;
    font-size: 0.9rem;
    margin-right: 0.5rem;
    display: flex;
    align-items: center;
    line-height: 1.2;
    white-space: nowrap;
}

/* ── Responsive navbar — always one row ────────────────────────── */
.navbar {
    flex-wrap: nowrap;
}

@media (max-width: 768px) {
    .container {
        padding: 0 10px 20px 10px;
    }

    .navbar {
        padding: 0 0.4rem;
        margin: 0 -10px 12px -10px;
        width: calc(100% + 20px);
    }

    .navbar-brand {
        gap: 0.25rem;
        min-width: 0;
        flex-shrink: 1;
        overflow: hidden;
    }

    .navbar-logo {
        height: 32px;
        flex-shrink: 0;
    }

    .navbar-title {
        font-size: 0.9rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .navbar-links {
        gap: 0.3rem;
        flex-shrink: 0;
        margin-left: auto;
    }

    .navbar-links a {
        padding: 0.85rem 0.6rem;
        font-size: 0.8rem;
    }

    .user-info {
        display: none;
    }
}


h1 {
    color: #000000;
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.info-box {
    background-color: #d4edda;
    color: #155724;
    padding: 15px;
    border: 1px solid #c3e6cb;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.info-box strong {
    color: #155724;
}

.form-container {
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 30px;
}

/* Island-style form sections */
.form-section {
    margin-bottom: 25px;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #f9f9f9;
}

.form-section h3 {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid var(--pando-teal);
    padding-bottom: 10px;
}

.parameter-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 15px;
}

.parameter-group.compact {
    display: flex;
    flex-wrap: nowrap;
    gap: 15px;
    margin-top: 10px;
    max-width: 600px;
}

.parameter-group.compact .form-group {
    flex: 1;
    min-width: 0;
}

.parameter-group.compact .form-group:last-child {
    flex: 2;
}

.parameter-group.compact .form-group input {
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .parameter-group {
        grid-template-columns: 1fr;
    }
    .parameter-group.compact {
        gap: 10px;
    }
}

/* Project Information section – compact layout with de-bolded auto-filled labels */
.project-info {
    padding: 10px 15px;
    margin-bottom: 15px;
}
.project-info h3 {
    padding-bottom: 6px;
    margin-bottom: 0;
}
.project-info .parameter-group.compact {
    margin-top: 4px;
}
.project-info .form-group {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
}
.project-info .form-group input {
    margin-top: auto;
}
.project-info .form-group label {
    font-weight: normal;
}
.project-info .form-group label[for="experiment_id"] {
    font-weight: 600;
}

.help-text {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    font-style: italic;
}

.file-input-container {
    position: relative;
}

.file-list {
    margin-top: 10px;
    padding: 10px;
    background-color: #f0f0f0;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
}

.submit-section {
    text-align: center;
    margin-top: 30px;
    margin-bottom: 40px;
    padding-top: 20px;
    border-top: 2px solid #ddd;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: inline-block;
    font-weight: bold;
    margin-bottom: 2px;
    color: var(--secondary-color);
}

.form-group textarea,
.form-group input[type="file"] {
    width: 100%;
    padding: 1px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.form-group input[type="text"],
.form-group input[type="number"] {
    width: 100%;
    padding: 4px 8px;
    height: 32px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
    box-sizing: border-box;
}

.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.submit-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 20px;
    font-size: 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.submit-btn:hover {
    background-color: #2980b9;
}

.error-message {
    background-color: #fde2e2;
    color: var(--error-color);
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    border-left: 4px solid var(--error-color);
}

.warning-message {
    background-color: #fff3cd;
    color: #856404;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    border-left: 4px solid #f39c12;
}

/* API Info Section */
.api-info {
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

.api-info h2 {
    color: var(--secondary-color);
    margin-bottom: 15px;
}

.api-info h3 {
    margin-top: 15px;
    margin-bottom: 5px;
    color: var(--primary-color);
}

.api-info pre {
    background-color: #f4f6f8;
    padding: 10px;
    border-radius: 4px;
    overflow-x: auto;
    margin-bottom: 10px;
    font-family: 'Courier New', monospace;
}

.api-info ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.api-info code {
    background-color: #f4f6f8;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}

/* Results Page Styling */
.results-container {
    margin-bottom: 30px;
}

.result-card {
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
}

.result-header {
    color: var(--primary-color);
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

/* Homepage Styling */
.homepage h1 {
    font-size: clamp(1.1rem, 4.5vw, 2.2rem);
    text-align: center;
    margin-bottom: 4px;
    margin-top: 0;
    color: #000000;
    border-bottom: none;
}

.tagline {
    text-align: center;
    font-size: clamp(0.85rem, 2.5vw, 1.1rem);
    color: var(--text-secondary);
    margin-bottom: 0.2rem;
}

/* Grid Controls */
.grid-controls {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.3rem;
}

/* Search Input */
.service-search-input {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    width: 250px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.service-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.service-search-input::placeholder {
    color: var(--text-tertiary);
}

.reset-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reset-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Services Grid */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.2rem;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .services-grid {
        grid-template-columns: 1fr;
    }
}

/* Service Card - Pando Compute Style */
.service-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.2rem;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    min-height: 280px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    cursor: grab;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1); /* Visual feedback on tap */
    touch-action: manipulation; /* Disable double-tap zoom, enable fast taps */
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--border-color);
    transition: all 0.3s ease;
}

.service-card.local::before {
    background: var(--pando-teal);
}

.service-card.ondemand::before {
    background: linear-gradient(90deg, var(--pando-orange), var(--pando-orange-dark));
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

/* Local service cards - light teal background on hover */
.service-card.local:hover {
    background-color: #e6f7f7;
}

/* AWS Batch service cards - light orange background on hover */
.service-card.ondemand:hover {
    background-color: #fff8ed;
}

.service-card:active {
    cursor: grabbing;
}

.service-card:visited {
    color: inherit;
    text-decoration: none;
}

.service-card:focus {
    outline: 2px solid var(--pando-teal);
    outline-offset: 2px;
}

/* Service Icon - Bigger */
.service-icon {
    font-size: 3.5rem;
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Service Card Text */
.service-card h4 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.service-card h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.service-card p {
    color: var(--text-secondary);
    margin-bottom: 0.6rem;
    line-height: 1.5;
    flex-grow: 1;
    font-size: 0.9rem;
}

/* Service Status */
.service-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: auto;
    margin-bottom: 0.6rem;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-badge.local {
    background: rgba(59, 179, 177, 0.15);
    color: var(--pando-teal-dark);
}

.status-badge.ondemand {
    background: linear-gradient(135deg, var(--pando-orange), var(--pando-orange-dark));
    color: white;
}

.status-badge.new-badge {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    animation: pulse-new 2s infinite;
}

.status-badge.updated-badge {
    background: linear-gradient(135deg, #27ae60, #219a52);
    color: white;
    animation: pulse-new 2s infinite;
}

@keyframes pulse-new {
    0%, 100% { 
        opacity: 1;
        transform: scale(1);
    }
    50% { 
        opacity: 0.8;
        transform: scale(1.05);
    }
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success-color);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Service Button - Pando Brand Style */
.service-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.6rem 1rem;
    background: var(--pando-teal);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    pointer-events: none; /* Prevent button from intercepting clicks since card is clickable */
    transition: all 0.3s ease;
}

.service-btn:hover {
    background: var(--pando-teal-dark);
    transform: translateY(-1px);
    text-decoration: none;
}

/* Local service buttons - Pando Teal */
.service-card.local .service-btn {
    background: var(--pando-teal);
}

.service-card.local .service-btn:hover {
    background: var(--pando-teal-dark);
}

/* AWS Batch service buttons - Pando Orange */
.service-card.ondemand .service-btn {
    background: var(--pando-orange);
}

.service-card.ondemand .service-btn:hover {
    background: var(--pando-orange-dark);
}

/* Sortable Styles */
.sortable-ghost {
    opacity: 0.4;
    background: var(--bg-secondary);
}

.sortable-chosen {
    box-shadow: var(--shadow-xl);
}

.sortable-drag {
    opacity: 0.9;
}

/* Service Categories */
.service-category {
    margin-top: 0.1rem;
    margin-bottom: 3rem;
    width: 100%;
    box-sizing: border-box;
}

.category-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    margin-top: 0.5rem;
    color: var(--text-primary);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.category-title:first-of-type {
    margin-top: 0.5rem;
}

.about-section {
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-top: 30px;
    margin-bottom: 30px;
}

.info-section {
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-top: 30px;
    margin-bottom: 30px;
}

.about-section h2 {
    color: var(--secondary-color);
    margin-bottom: 10px;
}

/* Error page styling */
.error-page {
    text-align: center;
    padding: 40px 20px;
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.error-page h1 {
    font-size: 3rem;
    color: var(--secondary-color);
    margin-bottom: 20px;
    border-bottom: none;
}

.error-icon {
    font-size: 5rem;
    margin: 20px 0;
}

.error-page .error-message {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 30px;
}

.mutations-section {
    margin-bottom: 20px;
}

.mutations-section h3 {
    color: var(--secondary-color);
    margin-bottom: 5px;
}

.back-button {
    text-align: center;
    margin-top: 30px;
}

.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: bold;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #2980b9;
}

.btn-success {
    background-color: #28a745;
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: bold;
    display: inline-block;
    margin-left: 10px;
}

.btn-success:hover {
    background-color: #218838;
    text-decoration: none;
    color: white;
}

/* Radio Button Group */
.radio-group {
    display: flex;
    gap: 20px;
    margin: 8px 0;
}

.radio-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.radio-group input[type="radio"] {
    margin-right: 6px;
    cursor: pointer;
}

/* Make radio button options stand out */
.form-group label {
    font-weight: 500;
    display: inline-block;
    margin-bottom: 2px;
}

/* Table Info */
.table-info {
    margin: 20px 0;
    padding: 15px;
    background-color: #e8f4fd;
    border: 1px solid #bee5eb;
    border-radius: 4px;
}

.table-info p {
    margin: 0;
    font-size: 14px;
    color: #0c5460;
}

/* Results Table */
.results-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 4px;
    overflow: hidden;
}

.results-table th,
.results-table td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
}

.results-table th {
    background-color: var(--secondary-color);
    color: white;
    font-weight: bold;
    position: sticky;
    top: 0;
}

.results-table tr:nth-child(even) {
    background-color: #f8f9fa;
}

.results-table tr:hover {
    background-color: #e8f4fd;
}

.results-table td {
    word-wrap: break-word;
    max-width: 200px;
}

/* Column-specific widths */
.results-table th:nth-child(1),
.results-table td:nth-child(1) { width: 8%; } /* Project # */
.results-table th:nth-child(2),
.results-table td:nth-child(2) { width: 10%; } /* Experiment ID */
.results-table th:nth-child(3),
.results-table td:nth-child(3) { width: 15%; } /* Description */
.results-table th:nth-child(4),
.results-table td:nth-child(4) { width: 12%; } /* Filename */
.results-table th:nth-child(5),
.results-table td:nth-child(5) { width: 15%; } /* Header */
.results-table th:nth-child(6),
.results-table td:nth-child(6) { width: 20%; } /* NT Mutations */
.results-table th:nth-child(7),
.results-table td:nth-child(7) { width: 20%; } /* AA Mutations */
.results-table th:nth-child(8),
.results-table td:nth-child(8) { width: 10%; } /* Timestamp */

/* Table Actions */
.table-actions {
    margin: 15px 0 20px 0;
    text-align: center;
}

.table-actions .btn {
    margin: 0 10px;
}

.btn-secondary {
    background-color: #6c757d;
}

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

/* Protein Comparer Results Styles */
.results-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.comparison-mode-info {
    background: #e3f2fd;
    border: 1px solid #2196f3;
    border-radius: 5px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.comparison-mode-info p {
    margin: 0;
    color: #1976d2;
    font-size: 1rem;
}

.summary-box {
    background: var(--light-bg);
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 2rem;
}

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

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    background: white;
    border-radius: 3px;
    border: 1px solid #e0e0e0;
}

.stat-label {
    font-weight: bold;
    color: var(--secondary-color);
}

.stat-value {
    color: var(--primary-color);
    font-weight: bold;
}

.sequences-section, .comparisons-section {
    margin-bottom: 2rem;
}

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

.sequence-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 1rem;
}

.sequence-card h4 {
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.seq-description {
    color: #666;
    font-style: italic;
    margin-bottom: 0.5rem;
}

.seq-length {
    color: var(--primary-color);
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.seq-sequence {
    background: #f8f9fa;
    padding: 0.5rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    word-break: break-all;
}

.comparisons-table {
    overflow-x: auto;
    margin-top: 1rem;
}

.comparisons-table table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.comparisons-table th,
.comparisons-table td {
    padding: 0.75rem;
    text-align: left;
    border: 1px solid var(--border-color);
}

.comparisons-table th {
    background: var(--secondary-color);
    color: white;
    font-weight: bold;
}

.comparisons-table tr:nth-child(even) {
    background: #f8f9fa;
}

.comparisons-table tr:hover {
    background: #e3f2fd;
}

.btn-small {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.8rem;
}

.btn-small:hover {
    background: #2980b9;
}

.alignment-row {
    background: #f0f8ff !important;
}

.alignment-display {
    padding: 1rem;
    background: white;
    border-radius: 5px;
    margin: 0.5rem 0;
}

.alignment-display h4 {
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.alignment-display pre {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 3px;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Identity Matrix Styles */
.identity-matrix-section {
    margin-bottom: 2rem;
}

.matrix-container {
    background: white;
    border-radius: 5px;
    padding: 1rem;
    overflow-x: auto;
}

.identity-matrix {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.matrix-header {
    background: var(--secondary-color);
    color: white;
    padding: 0.5rem;
    text-align: center;
    font-weight: bold;
    border: 1px solid var(--border-color);
    min-width: 40px;
}

.matrix-row-header {
    background: var(--light-bg);
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    font-weight: bold;
    width: auto; /* fit content */
    max-width: none;
    min-width: 0;
    white-space: nowrap; /* narrow to content */
    position: relative;
}

.row-number {
    font-weight: bold;
    color: var(--secondary-color);
    margin-right: 0.5rem;
}

.row-name {
    font-size: 0.8rem;
    color: #333;
}

.matrix-cell {
    padding: 0.5rem;
    text-align: center;
    border: 1px solid var(--border-color);
    font-weight: 600;
    color: #000000; /* black text */
    text-shadow: none; /* remove shadow */
    min-width: 40px;
    aspect-ratio: 1 / 1; /* keep cells square */
    cursor: pointer;
    transition: all 0.2s ease;
}

.matrix-cell:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    z-index: 10;
    position: relative;
}

.matrix-legend {
    background: var(--light-bg);
    padding: 1rem;
    border-radius: 5px;
    margin-top: 1rem;
}

.matrix-legend h4 {
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
}

.legend-item {
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
}

.legend-number {
    font-weight: bold;
    margin-right: 0.5rem;
    color: var(--primary-color);
    min-width: 20px;
}

.legend-name {
    font-size: 0.9rem;
    word-wrap: break-word;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .results-table {
        font-size: 12px;
    }
    
    .results-table th,
    .results-table td {
        padding: 8px 4px;
    }
    
    .table-actions {
        flex-direction: column;
    }
    
    .table-actions .btn {
        margin: 5px 0;
        display: block;
        width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .sequences-grid {
        grid-template-columns: 1fr;
    }
    
    .comparisons-table {
        font-size: 0.9rem;
    }
    
    .comparisons-table th,
    .comparisons-table td {
        padding: 0.5rem 0.25rem;
    }
    
    .identity-matrix {
        font-size: 0.8rem;
    }
    
    .matrix-cell {
        min-width: 50px;
        padding: 0.3rem;
    }
    
    .matrix-row-header {
        max-width: 150px;
        padding: 0.3rem;
    }
    
    .matrix-legend {
        padding: 0.5rem;
    }
    
    .legend-name {
        font-size: 0.8rem;
    }
}

/* Progress Bar Styles */
.progress-container {
    margin: 20px 0;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background-color: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #007bff, #28a745);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 10px;
}

.progress-text {
    text-align: center;
    font-weight: 500;
    color: #495057;
    font-size: 14px;
}

/* Enhanced Auto-scaling for Identity Matrix */
.identity-matrix-section {
    max-width: 100%;
    overflow-x: auto;
}

.matrix-container {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 15px;
}

.identity-matrix {
    width: 100%;
    max-width: 100%;
    table-layout: auto; /* allow first column to size to content */
    font-size: clamp(10px, 1.2vw, 14px);
    border-collapse: collapse;
}

.matrix-cell {
    padding: clamp(2px, 0.5vw, 8px);
    min-width: clamp(30px, 4vw, 60px);
    max-width: clamp(30px, 4vw, 60px);
    font-size: clamp(9px, 1vw, 12px);
    text-align: center;
    font-weight: 600;
    border: 1px solid #dee2e6;
    white-space: nowrap;
    overflow: hidden;
    color: #000;
    text-shadow: none;
    aspect-ratio: 1 / 1; /* square */
}

.matrix-header {
    padding: clamp(4px, 0.7vw, 10px);
    font-size: clamp(10px, 1.1vw, 13px);
    background-color: #343a40;
    color: white;
    font-weight: 600;
    text-align: center;
    border: 1px solid #495057;
    min-width: clamp(30px, 4vw, 60px);
    max-width: clamp(30px, 4vw, 60px);
}

.matrix-row-header {
    background-color: #ffffff; /* white background for first column */
    color: #000000;            /* black text for readability */
    font-weight: 600;
    padding: clamp(4px, 0.7vw, 10px);
    border: 1px solid #dee2e6; /* light border to match matrix cells */
    max-width: none;
    min-width: 0;
    white-space: nowrap; /* ensure no wrap */
}

/* Fixed Page Layout */
.container {
    max-width: 100vw;
    margin: 0 auto;
    padding: 0 15px;
    overflow-x: hidden;
}

.results-section {
    max-width: 100%;
    overflow-x: auto;
}

.comparisons-table {
    max-width: 100%;
    overflow-x: auto;
    margin-top: 20px;
}

.comparisons-table table {
    width: 100%;
    min-width: 900px;
    table-layout: auto;
}

/* Table Info */
.table-info {
    margin: 20px 0;
    padding: 15px;
    background-color: #e8f4fd;
    border: 1px solid #bee5eb;
    border-radius: 4px;
}

.table-info p {
    margin: 0;
    font-size: 14px;
    color: #0c5460;
}

/* Results Table */
.results-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 4px;
    overflow: hidden;
}

.results-table th,
.results-table td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
}

.results-table th {
    background-color: var(--secondary-color);
    color: white;
    font-weight: bold;
    position: sticky;
    top: 0;
}

.results-table tr:nth-child(even) {
    background-color: #f8f9fa;
}

.results-table tr:hover {
    background-color: #e8f4fd;
}

.results-table td {
    word-wrap: break-word;
    max-width: 200px;
}

/* Column-specific widths */
.results-table th:nth-child(1),
.results-table td:nth-child(1) { width: 8%; } /* Project # */
.results-table th:nth-child(2),
.results-table td:nth-child(2) { width: 10%; } /* Experiment ID */
.results-table th:nth-child(3),
.results-table td:nth-child(3) { width: 15%; } /* Description */
.results-table th:nth-child(4),
.results-table td:nth-child(4) { width: 12%; } /* Filename */
.results-table th:nth-child(5),
.results-table td:nth-child(5) { width: 15%; } /* Header */
.results-table th:nth-child(6),
.results-table td:nth-child(6) { width: 20%; } /* NT Mutations */
.results-table th:nth-child(7),
.results-table td:nth-child(7) { width: 20%; } /* AA Mutations */
.results-table th:nth-child(8),
.results-table td:nth-child(8) { width: 10%; } /* Timestamp */

/* Table Actions */
.table-actions {
    margin: 15px 0 20px 0;
    text-align: center;
}

.table-actions .btn {
    margin: 0 10px;
}

.btn-secondary {
    background-color: #6c757d;
}

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

/* Mobile responsiveness */
@media (max-width: 768px) {
    .results-table {
        font-size: 12px;
    }
    
    .results-table th,
    .results-table td {
        padding: 8px 4px;
    }
    
    .table-actions {
        flex-direction: column;
    }
    
    .table-actions .btn {
        margin: 5px 0;
        display: block;
        width: 100%;
    }
}

/* ============================================
   CONSOLIDATED STYLES FOR BATCH APPS
   Common UI patterns for AWS Batch services:
   boltz2, evcouplings, clustering_ssn, search_pando_db
   ============================================ */

/* Two-Column Layout (Submit + History panels) */
.main-content {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

@media (max-width: 900px) {
    .main-content {
        flex-direction: column;
    }
}

/* Submit Panel */
.submit-panel {
    flex: 1;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 25px;
    display: flex;
    flex-direction: column;
}

.submit-panel form {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.submit-panel .btn-primary {
    margin-top: auto;
}

/* History Panel */
.history-panel {
    flex: 1;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 25px;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.15s ease-in;
}

.history-panel.visible {
    opacity: 1;
}

/* Panel Title */
.panel-title {
    color: var(--secondary-color);
    font-size: 1.3rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--pando-orange);
}

/* Job List */
.job-list {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* Job Item */
.job-item {
    background-color: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.job-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

/* Job Header */
.job-header {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 8px;
}

.job-header .job-status {
    margin-left: auto;
}

.job-id {
    font-weight: bold;
    color: var(--secondary-color);
    font-size: 0.95rem;
}

.job-icon {
    width: 1.1em;
    height: 1.1em;
    vertical-align: -0.15em;
    margin-right: 2px;
}

/* Job Status Badges */
.job-status {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
}

.status-running,
.status-submitted {
    background-color: #fff3cd;
    color: #856404;
    animation: batch-pulse 2s infinite;
}

.status-completed,
.status-succeeded {
    background-color: #d4edda;
    color: #155724;
}

.status-failed {
    background-color: #f8d7da;
    color: #721c24;
}

.status-queued,
.status-pending {
    background-color: #e2e3e5;
    color: #383d41;
}

.status-retrieving_sequences {
    background-color: #cce5ff;
    color: #004085;
    animation: batch-pulse 2s infinite;
}

@keyframes batch-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(20px); }
}

/* Job action toast — appears inside the history panel */
.job-toast {
    padding: 10px 14px;
    margin: 8px 0;
    border-radius: 8px;
    font-size: 0.85rem;
    line-height: 1.4;
    animation: toastIn 0.3s ease, toastOut 0.4s ease 3.6s forwards;
    display: flex;
    align-items: center;
    gap: 8px;
}
.job-toast.success {
    background: #eafbe7;
    border: 1px solid #b7e1a1;
    color: #2e6b1e;
}
.job-toast.error {
    background: #fde8e8;
    border: 1px solid #f1b0b0;
    color: #8b1a1a;
}
@keyframes toastIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes toastOut {
    from { opacity: 1; }
    to   { opacity: 0; height: 0; padding: 0; margin: 0; border-width: 0; overflow: hidden; }
}

/* Job Details */
.job-details {
    font-size: 0.85rem;
    color: #666;
}

.job-details p {
    margin: 4px 0;
}

/* Job Actions */
.job-actions {
    margin-top: 10px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Batch App Buttons */
.btn-view,
.btn-download,
.btn-delete,
.btn-input,
.btn-yaml {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    white-space: nowrap;
}

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

.btn-view:hover {
    background-color: #2980b9;
}

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

.btn-download:hover {
    background-color: #218838;
}

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

.btn-delete:hover {
    background-color: #c82333;
}

.btn-input {
    background-color: #17a2b8;
    color: white;
}

.btn-input:hover {
    background-color: #138496;
}

.btn-yaml {
    background-color: #6c757d;
    color: white;
}

.btn-yaml:hover {
    background-color: #5a6268;
}

.btn-rename {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 2px 6px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.btn-rename:hover {
    opacity: 1;
}

/* Primary Submit Button - Orange for AWS Batch */
.btn.btn-primary {
    background: linear-gradient(135deg, var(--pando-orange) 0%, var(--pando-orange-dark) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(245, 166, 35, 0.3);
}

.btn.btn-primary:hover {
    background: linear-gradient(135deg, var(--pando-orange-dark) 0%, #c17800 100%);
    box-shadow: 0 6px 20px rgba(245, 166, 35, 0.4);
    transform: translateY(-2px);
}

.btn.btn-primary:active {
    transform: translateY(1px) scale(0.98);
}

/* Batch Info Tags */
.batch-info {
    margin-top: 10px;
    padding: 8px 10px;
    background-color: #e8f4fd;
    border-radius: 6px;
    font-size: 0.8rem;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.batch-tag,
.instance-tag,
.resource-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
}

.batch-tag {
    background-color: #fff;
    border: 1px solid #2196f3;
    color: #1565c0;
}

.instance-tag {
    background-color: #e8f5e9;
    border: 1px solid #4caf50;
    color: #2e7d32;
}

.resource-tag {
    background-color: #fff3e0;
    border: 1px solid #ff9800;
    color: #e65100;
}

/* Progress Bar (Slim) */
.progress-wrapper {
    margin-top: 8px;
}

.progress-bar-slim {
    width: 100%;
    height: 6px;
    background-color: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill-slim {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #28a745);
    transition: width 0.3s ease;
}

.progress-label {
    font-size: 0.75rem;
    color: #666;
    margin-top: 4px;
}

/* Progress Bar (Standard) - For local services */
.progress-container-standard {
    display: none;
    margin-top: 1rem;
}

.progress-container-standard.active {
    display: block;
}

.progress-bar-wrapper-standard {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.progress-bar-standard {
    flex: 1;
    height: 24px;
    background-color: #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.progress-bar-standard-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    border-radius: 12px;
    transition: width 0.3s ease;
}

.progress-text-standard {
    min-width: 60px;
    font-weight: 500;
    text-align: right;
}

.progress-status-standard {
    margin-top: 0.5rem;
    color: #666;
    font-size: 0.9rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* Loading Spinner */
.loading-spinner {
    display: none;
    margin: 20px auto;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

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

/* Refresh Button */
.refresh-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 1rem;
    padding: 5px;
    transition: transform 0.3s;
}

.refresh-btn:hover {
    transform: rotate(180deg);
}

.refresh-btn.spinning {
    animation: spin 1s linear infinite;
}

/* ============================================
   TOOLTIP STYLES
   ============================================ */

.tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 280px;
    background-color: #555;
    color: #fff;
    text-align: left;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -140px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.85rem;
    font-weight: normal;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* ============================================
   FORM ENHANCEMENTS
   ============================================ */

/* Info Text */
.info-text {
    font-size: 0.9em;
    color: #555;
    margin-top: 5px;
}

/* Form Notes */
.form-note {
    font-size: 0.9em;
    color: #666;
    margin: 5px 0 15px 0;
    line-height: 1.4;
}

/* Form Row */
.form-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

/* Monospace Textarea */
.form-group textarea.monospace {
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 13px;
}

/* Select Styling */
.form-group select {
    width: 100%;
    padding: 4px 8px;
    height: 32px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
    box-sizing: border-box;
}

/* ============================================
   MODAL STYLES
   ============================================ */

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

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background-color: white;
    border-radius: 10px;
    width: 90%;
    max-width: 1000px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
    background-color: var(--secondary-color);
    color: white;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.modal-close:hover {
    opacity: 1;
}

.modal-body {
    padding: 25px;
    max-height: calc(85vh - 140px);
    overflow-y: auto;
}

.modal-footer {
    padding: 15px 25px;
    background-color: #f8f9fa;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ============================================
   STAT CARDS
   ============================================ */

.results-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
    border-left: 4px solid var(--primary-color);
}

.stat-card.highlight {
    border-left-color: #28a745;
}

.stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--secondary-color);
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: #666;
    margin-top: 4px;
}

/* ============================================
   DROP ZONE STYLES
   ============================================ */

.drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    transition: all 0.3s ease;
    background-color: #fafafa;
}

.drop-zone.dragover {
    border-color: var(--primary-color);
    background-color: #e8f4fd;
}

.drop-zone-text {
    color: #666;
    margin-bottom: 10px;
}

.drop-zone-icon {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

/* ============================================
   DOCUMENTATION PAGE STYLES
   ============================================ */

.docs-layout {
    display: flex;
    min-height: calc(100vh - 64px);
}

.docs-sidebar {
    width: 280px;
    background-color: #f8f9fa;
    border-right: 1px solid var(--border-color);
    padding: 20px;
    position: sticky;
    top: 64px;
    height: calc(100vh - 64px);
    overflow-y: auto;
}

.docs-sidebar-header h3 {
    color: var(--secondary-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--pando-teal);
}

.docs-nav-section {
    margin-bottom: 20px;
}

.docs-nav-section h4 {
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
}

.docs-nav-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.docs-nav-section li {
    margin-bottom: 5px;
}

.docs-nav-section a {
    display: block;
    padding: 8px 12px;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s;
}

.docs-nav-section a:hover {
    background-color: #e9ecef;
}

.docs-nav-section a.active {
    background-color: var(--pando-teal);
    color: white;
}

.docs-content {
    flex: 1;
    padding: 30px 40px;
    max-width: 900px;
}

.docs-service-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.docs-service-icon img {
    width: 64px;
    height: 64px;
}

.docs-service-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 10px;
}

.docs-service-badge.local {
    background-color: rgba(59, 179, 177, 0.15);
    color: var(--pando-teal-dark);
}

.docs-service-badge.batch {
    background: linear-gradient(135deg, var(--pando-orange), var(--pando-orange-dark));
    color: white;
}

.docs-try-btn {
    display: inline-block;
    padding: 12px 24px;
    background: var(--pando-teal);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    margin: 20px 0;
    transition: all 0.2s;
}

.docs-try-btn:hover {
    background: var(--pando-teal-dark);
    transform: translateY(-2px);
}

.docs-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.docs-table th,
.docs-table td {
    padding: 12px;
    text-align: left;
    border: 1px solid var(--border-color);
}

.docs-table th {
    background-color: var(--secondary-color);
    color: white;
}

.docs-table tr:nth-child(even) {
    background-color: #f8f9fa;
}

.docs-table code {
    background-color: #f4f6f8;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}

.docs-steps {
    padding-left: 20px;
    margin: 20px 0;
}

.docs-steps li {
    margin-bottom: 10px;
    line-height: 1.6;
}

.docs-code {
    background-color: #f4f6f8;
    padding: 15px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 15px 0;
}

.docs-code code {
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 0.9rem;
    white-space: pre-wrap;
}

.docs-tip {
    background-color: #d4edda;
    border-left: 4px solid #28a745;
    padding: 15px;
    border-radius: 0 6px 6px 0;
    margin: 20px 0;
}

.docs-warning {
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 15px;
    border-radius: 0 6px 6px 0;
    margin: 20px 0;
}

.docs-info {
    background-color: #e8f4fd;
    border-left: 4px solid #2196f3;
    padding: 15px;
    border-radius: 0 6px 6px 0;
    margin: 20px 0;
}

@media (max-width: 768px) {
    .docs-layout {
        flex-direction: column;
    }
    
    .docs-sidebar {
        width: 100%;
        position: relative;
        top: 0;
        height: auto;
    }
    
    .docs-content {
        padding: 20px;
    }
}

/* Protein Comparer - Reduced whitespace */
.protein-comparer-form .form-section {
    padding: 12px;
    margin-bottom: 15px;
}

.protein-comparer-form .parameter-group.compact {
    margin-top: 8px;
    gap: 12px;
}

.protein-comparer-form .form-group {
    margin-bottom: 12px;
}

.protein-comparer-form .help-text {
    margin-top: 4px;
    margin-bottom: 0;
}

.protein-comparer-form .submit-section {
    margin-top: 20px;
    margin-bottom: 30px;
    padding-top: 15px;
}

.tblocks-encoder-form .form-section {
    padding: 12px;
    margin-bottom: 15px;
}

.tblocks-encoder-form .encoding-options-section h3 {
    margin-bottom: 6px;
    padding-bottom: 6px;
}

.tblocks-encoder-form .encoding-options-section .form-group {
    margin-bottom: 8px;
}

.tblocks-encoder-form .encoding-options-section .help-text {
    margin-top: 2px;
    margin-bottom: 0;
    font-size: 0.85em;
}

.tblocks-encoder-form .encoding-options-section .parameter-group.encoding-options-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 6px;
    margin-bottom: 2px;
}

.tblocks-encoder-form .encoding-options-section .encoding-options-row .form-group {
    flex: 1;
    min-width: 180px;
}

.tblocks-encoder-form .parameter-group.compact {
    margin-top: 8px;
    gap: 12px;
}

.tblocks-encoder-form .submit-section {
    margin-top: 20px;
    margin-bottom: 30px;
    padding-top: 15px;
}

.protein-comparer-form .results-section {
    margin-top: 1.5rem;
    padding: 1rem;
}

.protein-comparer-form .comparison-mode-info {
    padding: 0.75rem;
    margin-bottom: 1rem;
}

.protein-comparer-form .summary-box {
    padding: 0.75rem;
    margin-bottom: 1.5rem;
}

.protein-comparer-form .identity-matrix-section {
    margin-bottom: 1.5rem;
}

.protein-comparer-form .identity-matrix-section h3 {
    margin-bottom: 0.5rem;
}

.protein-comparer-form .comparisons-section {
    margin-bottom: 1.5rem;
}

.protein-comparer-form .comparisons-section h3 {
    margin-bottom: 0.5rem;
}

.protein-comparer-form .phylogenetic-tree-section {
    margin: 30px 0;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.protein-comparer-form .phylogenetic-tree-section h3 {
    margin-top: 0;
}

#phylogenetic-tree-container {
    min-height: 600px;
    background: #fafafa;
}

#phylogenetic-tree-svg {
    display: block;
    font-family: Arial, sans-serif;
}

.tree-link {
    fill: none;
    stroke: #999;
    stroke-width: 2px;
}

.tree-node circle {
    cursor: pointer;
    transition: r 0.2s, fill 0.2s;
}

.tree-node circle:hover {
    r: 8;
}

.tree-node.reference-node circle {
    fill: #ff6b35 !important;
    stroke: #ff4500 !important;
    stroke-width: 3px !important;
}

.tree-node.reference-node circle:hover {
    r: 10;
}

.tree-label {
    font-size: 12px;
    fill: #333;
    pointer-events: none;
    user-select: none;
}

.tree-node.reference-node .tree-label {
    font-weight: bold;
    fill: #ff4500;
}

/* Copy button styles */
.copy-table-btn {
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 0.9em;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: background-color 0.2s, border-color 0.2s;
}

.copy-table-btn:hover {
    background-color: #e0e0e0;
    border-color: #999;
}

.copy-table-btn:active {
    background-color: #d0d0d0;
}

.copy-icon {
    font-size: 1em;
}

/* Column selection UI for tabular files */
.column-selection {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 15px;
    margin-top: 15px;
}

.column-selection h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
    font-size: 1em;
}

.column-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.column-group {
    flex: 1;
    min-width: 200px;
}

.column-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.column-group select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9em;
}

.detected-info {
    font-size: 0.85em;
    color: #666;
    margin-top: 5px;
    font-style: italic;
}

.loading {
    color: #666;
    font-style: italic;
    padding: 10px 0;
}

@media (max-width: 768px) {
    .column-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .column-group {
        min-width: 100%;
    }
}

/* ================================================================
   Homepage System Footer
   ================================================================ */
.system-footer {
    margin-top: 3rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

.system-footer-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.4rem;
    flex-wrap: wrap;
    opacity: 0;
    transition: opacity 0.4s;
}

.sf-stat {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    color: #999;
    white-space: nowrap;
}

.sf-label {
    font-weight: 600;
    color: #aaa;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.sf-value {
    font-variant-numeric: tabular-nums;
    min-width: 2.5em;
}

.sf-bar {
    width: 60px;
    height: 8px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
}

.sf-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease, background 0.4s;
}

.sf-bar-low  { background: #28a745; }
.sf-bar-med  { background: #ffc107; }
.sf-bar-high { background: #dc3545; }

.sf-divider {
    width: 1px;
    height: 16px;
    background: #ddd;
}

.system-footer-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.78rem;
    color: #999;
    text-decoration: none;
    transition: color 0.2s;
}

.system-footer-link:hover {
    color: #555;
}

.system-footer-link svg {
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .system-footer-stats {
        gap: 0.8rem 1.2rem;
    }
    .sf-divider { display: none; }
}

/* ================================================================
   Scheduled Tasks Admin Page
   ================================================================ */
.scheduled-tasks-page {
    max-width: 100%;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

.scheduled-tasks-page h1 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.scheduler-status {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.sched-badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 600;
    vertical-align: middle;
}

.sched-badge-running { background: #d4edda; color: #155724; }
.sched-badge-stopped { background: #f8d7da; color: #721c24; }
.sched-badge-ok      { background: #d4edda; color: #155724; }
.sched-badge-err     { background: #f8d7da; color: #721c24; cursor: help; }
.sched-badge-running { background: #cce5ff; color: #004085; }
.sched-badge-none    { background: #e9ecef; color: #6c757d; }

.sched-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.sched-table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.sched-table th {
    text-align: left;
    padding: 0.6rem 0.75rem;
    border-bottom: 2px solid #dee2e6;
    color: #495057;
    font-weight: 600;
    white-space: nowrap;
}

.sched-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #eee;
    vertical-align: top;
}

.sched-table tbody tr:hover {
    background: #f8f9fa;
}

.sched-desc {
    display: block;
    font-size: 0.8rem;
    color: #888;
    margin-top: 0.15rem;
}

.sched-source {
    display: block;
    font-size: 0.72rem;
    color: #aaa;
    margin-top: 0.2rem;
    font-family: SFMono-Regular, Menlo, monospace;
}

.sched-err-toggle {
    cursor: pointer;
}

.sched-error-detail {
    margin-top: 0.5rem;
}

.sched-traceback {
    background: #2d2d2d;
    color: #f8d7da;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-family: SFMono-Regular, Menlo, Consolas, monospace;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 400px;
    overflow-y: auto;
    text-align: left;
}

.sched-result-cell {
    max-width: 400px;
    text-align: left;
}
.sched-result-text {
    display: block;
    font-size: 0.78rem;
    color: #555;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 400px;
    cursor: default;
}
.sched-tool-versions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: flex-start;
}
.sched-tool-version {
    display: inline-block;
    font-size: 0.72rem;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    background: #f0f4f8;
    color: #334155;
    padding: 1px 6px;
    border-radius: 4px;
    white-space: nowrap;
}
.sched-tool-missing {
    background: #fef2f2;
    color: #b91c1c;
    font-weight: 600;
}
.sched-tool-error {
    background: #fef9c3;
    color: #92400e;
    font-weight: 600;
}

.sched-run-btn {
    padding: 0.25rem 0.6rem;
    font-size: 0.78rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    color: #555;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}

.sched-run-btn:hover:not(:disabled) {
    background: #f0f7ff;
    border-color: #4a9eff;
    color: #1a73e8;
}

.sched-run-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

.sched-run-btn-active {
    background: #e8f5e9;
    border-color: #4caf50;
    color: #2e7d32;
}

.sched-mono {
    font-family: SFMono-Regular, Menlo, monospace;
    font-size: 0.82rem;
    white-space: nowrap;
}

.sched-time {
    white-space: nowrap;
    font-size: 0.85rem;
}

/* Toggle switch */
.sched-toggle {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}

.sched-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.sched-toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #ccc;
    border-radius: 22px;
    transition: background 0.2s;
}

.sched-toggle-slider::before {
    content: "";
    position: absolute;
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}

.sched-toggle input:checked + .sched-toggle-slider {
    background: #28a745;
}

.sched-toggle input:checked + .sched-toggle-slider::before {
    transform: translateX(18px);
}

@media (max-width: 700px) {
    .sched-table, .sched-table thead, .sched-table tbody,
    .sched-table th, .sched-table td, .sched-table tr {
        display: block;
    }

    .sched-table thead { display: none; }

    .sched-table td {
        padding: 0.4rem 0.75rem;
        border: none;
    }

    .sched-table td:first-child {
        padding-top: 1rem;
        border-top: 1px solid #eee;
    }
}

/* ── Post-Processing Filter Bar (Search Pando DB results modal) ── */
.filter-bar {
    background: #f0f4ff;
    border: 1px solid #c5cae9;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 12px;
}

.filter-bar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.filter-count {
    font-size: 0.85rem;
    font-weight: 600;
    color: #666;
}

.filter-bar-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
    font-weight: normal;
    cursor: pointer;
    white-space: nowrap;
}

.filter-checkbox input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.filter-number {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
    font-weight: normal;
    white-space: nowrap;
}

.filter-number input[type="number"] {
    width: 80px;
    padding: 3px 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.82rem;
}

.filter-bar-note {
    font-size: 0.8rem;
    color: #856404;
    background: #fff3cd;
    border-radius: 4px;
    padding: 6px 10px;
    margin-top: 8px;
}
