@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@500;600;700&display=swap');

/* SSTRAND Web Server - demo_preview.html Style */

/* Global Styles - Matching demo_preview.html */
body {
    font-family: "Telegraf", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #c7e2e6; /* Exact color from demo_preview.html */
    margin: 0;
    padding: 0;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
}

/* Header Section with Integrated Navigation - demo_preview.html Style */
.header-section {
    background: #1d3461;
    color: white;
    padding: 0.7rem 1rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.header-content {
    max-width: 95%;
    margin: 0 auto;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-logo {
    width: 3rem;
    height: 3rem;
}

.header-text {
    text-align: left;
}

.header-title {
    font-size: 1.9rem;
    color: white;
    font-family: "Rajdhani", sans-serif;
    font-weight: 700;
    letter-spacing: 0.14rem;
    margin: 0;
}

.header-subtitle {
    font-size: 0.75rem;
    font-weight: 300;
    margin: 0.2rem 0 0 0;
    opacity: 0.9;
    color: white;
}

/* Integrated Navigation Styling */
.header-nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

/* Integrated Navigation Button Styling */
.header-nav .nav-btn {
    background: transparent;
    color: white;
    font-weight: 600;
    padding: 0.3rem 0.4rem;
    border-radius: 0.25rem;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    min-width: 0;
    border: none;
}

.header-nav .nav-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    color: white;
    text-decoration: none;
}

.header-nav .nav-btn:active {
    transform: translateY(0);
}

.header-tools { display: none !important; /* removed */ } .header-tools-DISABLED { display: none !important; /* removed */
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.header-tools input,
.header-tools select {
    border: none;
    border-radius: 0.3rem;
    padding: 0.35rem 0.6rem;
    font-size: 0.8rem;
}

.header-tools button {
    background: #c0392b;
    color: white;
    border: none;
    padding: 0.4rem 0.9rem;
    border-radius: 0.3rem;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Demo Badge */
.demo-badge {
    background: linear-gradient(135deg, #8ad9b3 0%, #7bc9a4 100%);
    color: black;
    font-weight: 600;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    display: inline-block;
    margin-bottom: 1rem;
}

/* Two-Column Layout */
.two-column-container {
    display: flex;
    max-width: 95%;
    margin: 0 auto;
    gap: 2rem;
    padding: 1rem;
    align-items: stretch;
}

.two-column-container.single-column {
    flex-direction: column;
    gap: 1rem;
}

.left-column.full-width {
    flex: 1 1 100%;
}

.about-row {
    max-width: 95%;
    margin: 0 auto;
    padding: 1rem 1rem 0.5rem 1rem;
}

.about-section.about-section-horizontal {
    margin-top: 0.5rem;
}

.left-column {
    flex: 1 1 50%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
}

.right-column {
    flex: 1 1 50%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
}

.stacked-left {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.visual-placeholder {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
    min-height: 28rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.visual-placeholder-inner {
    width: 100%;
    height: 100%;
    border: 2px dashed #cbd5e1;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0C434A;
    font-weight: 600;
    background: #f8fbfc;
}

/* New landing layout */
.landing-grid {
    max-width: 95%;
    margin: 0 auto;
    padding: 1.5rem 1rem 2rem;
    display: grid;
    grid-template-columns: minmax(320px, 1.05fr) minmax(320px, 0.95fr);
    gap: 2rem;
    align-items: start;
}

.landing-left {
    display: flex;
    flex-direction: column;
    gap: 2.25rem;
}

.landing-right {
    display: flex;
    flex-direction: column;
}

.intro-card {
    background: linear-gradient(135deg, #ffffff 0%, #f6fbfc 100%);
    border-radius: 0.75rem;
    border: 3px solid #0891b2;
    padding: 1.5rem;
    margin-top: 1.25rem;
    box-shadow: 0 8px 18px rgba(12, 67, 74, 0.12);
}

.intro-title {
    margin: 0 0 0.5rem 0;
    color: #0C434A;
    font-size: 2rem;
    font-weight: 600;
}

.intro-subtitle {
    margin: 0 0 1rem 0;
    color: #315d64;
    font-size: 1rem;
}

.intro-pill-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.intro-pill {
    background: rgba(1, 174, 197, 0.12);
    color: #0C434A;
    font-weight: 600;
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
    font-size: 0.85rem;
    border: 1px solid rgba(1, 174, 197, 0.25);
}

.input-card {
    background: white;
    border-radius: 0.75rem;
    border: 3px solid #0891b2;
    padding: 1rem;
    box-shadow: 0 6px 16px rgba(12, 67, 74, 0.08);
}

.about-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.about-strip-item {
    background: white;
    border-radius: 0.6rem;
    border: 1px solid #e5e7eb;
    padding: 1rem;
    box-shadow: 0 4px 10px rgba(12, 67, 74, 0.08);
}

.about-strip-item h3 {
    margin: 0 0 0.5rem 0;
    color: #0C434A;
    font-size: 1rem;
}

.about-strip-item p {
    margin: 0;
    color: #536b70;
    font-size: 0.9rem;
}

.visual-molstar-crop {
    width: min(620px, 92vw);
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    border: 10px solid #0891b2;
    overflow: hidden;
    margin: 1.25rem auto 0 auto;
    background: transparent;
    position: relative;
}

@keyframes slideInLeft {
    0% { transform: translateX(-40px); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

@keyframes slideInUp {
    0% { transform: translateY(30px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

.intro-card {
    animation: slideInLeft 0.6s ease-out both;
}

.input-card {
    animation: slideInUp 0.6s ease-out 0.1s both;
}

.visual-molstar {
    width: 100%;
    height: 100%;
    background: transparent;
    position: relative;
    overflow: hidden;
    border-radius: 50%;
}

/* Circular sequence overlay */
.ring-overlay {
    position: absolute;
    inset: -6%;
    width: 112%;
    height: 112%;
    pointer-events: none;
}

.ring-text {
    font-family: "Courier New", monospace;
    font-size: 16px;
    letter-spacing: 1.4px;
    fill: #0C434A;
}

.ring-text-outer {
    font-weight: 600;
}

.ring-text-inner {
    font-weight: 500;
    opacity: 0.85;
}

.ss-h {
    fill: #dc3545;
}

.ss-b {
    fill: #0d6efd;
}

.ss-c {
    fill: #198754;
}

/* Hide Mol* viewport controls for the landing animation */
.visual-molstar .msp-viewport-controls,
.visual-molstar .msp-viewport-controls-panel,
.visual-molstar .msp-viewport-controls-bottom,
.visual-molstar .msp-viewport-controls-top {
    display: none !important;
}

@media (max-width: 1200px) {
    .landing-grid {
        grid-template-columns: 1fr;
    }
    .about-strip {
        grid-template-columns: 1fr;
    }
}


/* Section Titles */
.section-title-aligned {
    font-size: 1.5rem;
    font-weight: 600;
    color: #0C434A;
    text-align: center;
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Vertical Input Layout */
.input-section-vertical {
    padding: 1rem;
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border: 1px solid #e5e7eb;
    height: 100%;
}

.sequence-input-vertical {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.375rem;
    font-family: monospace;
    font-size: 0.875rem;
    resize: vertical;
    min-height: 8rem;
    transition: border-color 0.2s ease;
}

.sequence-input-vertical:focus {
    outline: none;
    border-color: #01aec5;
    box-shadow: 0 0 0 3px rgba(1, 174, 197, 0.1);
}

.upload-section-vertical {
    padding: 0.75rem;
    border: 2px solid #d1d5db;
    border-radius: 0.375rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6b7280;
    font-weight: 500;
    min-height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-section-vertical:hover {
    border-color: #01aec5;
    background-color: #f8fafc;
}

.upload-section-vertical.file-selected {
    border-color: #10b981;
    background-color: #ecfdf5;
    color: #065f46;
}

.upload-section-vertical.file-error {
    border-color: #ef4444;
    background-color: #fef2f2;
    color: #991b1b;
}

.file-info {
    font-size: 0.875rem;
    margin-top: 0.25rem;
    font-weight: 500;
}

.loading-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid #f3f4f6;
    border-radius: 50%;
    border-top-color: #01aec5;
    animation: spin 1s ease-in-out infinite;
}

.loading-spinner-large {
    display: inline-block;
    width: 3rem;
    height: 3rem;
    border: 4px solid #f3f4f6;
    border-radius: 50%;
    border-top-color: #01aec5;
    animation: spin 1s ease-in-out infinite;
    margin: 1rem auto;
}

.progress-container {
    width: 100%;
    background-color: #f3f4f6;
    border-radius: 0.5rem;
    overflow: hidden;
    margin: 1rem 0;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    height: 1rem;
    background: linear-gradient(90deg, #01aec5, #0891b2);
    border-radius: 0.5rem;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 2s infinite;
}

.progress-bar.progress-complete {
    background: linear-gradient(90deg, #10b981, #059669);
}

.progress-bar.progress-complete::after {
    animation: none;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
}

.loading-text {
    text-align: center;
    color: #6b7280;
    font-size: 1rem;
    margin: 0.5rem 0;
    font-weight: 500;
}

.loading-stage {
    text-align: center;
    color: #01aec5;
    font-size: 0.875rem;
    margin: 0.25rem 0;
    font-weight: 600;
    min-height: 1.25rem;
}

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin: 2rem auto;
    max-width: 500px;
}

.loading-dots {
    display: inline-block;
}

.loading-dots::after {
    content: '';
    animation: dots 1.5s infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

.button-row-vertical {
    display: flex;
    gap: 1rem;
    justify-content: center;
    min-height: 3.5rem;
    align-items: center;
}

.analyze-btn {
    background-color: #8ad9b3;
    width: 9rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border: none;
    color: black;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    height: 3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.clear-btn {
    background-color: #ce8d78;
    width: 9rem;
    color: black;
    font-weight: 600;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border: none;
    padding: 0.75rem 1.5rem;
    height: 3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.example-btn {
    background-color: #fef5a7;
    width: 9rem;
    color: black;
    font-weight: 600;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border: none;
    padding: 0.75rem 1.5rem;
    transition: all 0.2s ease;
}

.analyze-btn:hover, .clear-btn:hover, .example-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* About Section */
.about-section {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
    padding: 1rem;
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: flex-start;
}

.about-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.about-content p {
    color: #6b7280;
    line-height: 1.5;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    text-align: justify;
}

.features-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    flex: 1;
    align-content: start;
}

.feature-item {
    background: #f8fafc;
    padding: 0.75rem;
    border-radius: 0.375rem;
    text-align: left;
    min-height: 5rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    border-left: 4px solid #01aec5;
    position: relative;
}

.feature-item h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.feature-item p {
    font-size: 0.8rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.4;
    text-align: left;
}

/* Result Area */
.result-area {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 0.375rem;
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .header-content {
        gap: 1.5rem;
    }

    .header-nav {
        gap: 1.5rem;
    }

    .header-nav .nav-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
        min-width: 4rem;
    }

    .two-column-container {
        max-width: 96%;
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .header-brand {
        justify-content: center;
    }

    .header-nav {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .header-nav .nav-btn {
        flex: 1;
        min-width: 5rem;
        max-width: 8rem;
    }

    .two-column-container {
        flex-direction: column;
        max-width: 96%;
        gap: 1rem;
        align-items: stretch;
    }

    .left-column, .right-column {
        flex: 1 1 100%;
    }

    .about-row {
        max-width: 96%;
        padding: 0.5rem 1rem 0.25rem 1rem;
    }

    .input-section-vertical, .about-section {
        flex: none;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .feature-item {
        min-height: auto;
        padding: 1rem;
    }

    .button-row-vertical {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .analyze-btn, .clear-btn, .example-btn {
        flex: 1;
        min-width: 8rem;
    }

    .section-title-aligned {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .header-title {
        font-size: 2rem;
    }

    .header-subtitle {
        font-size: 0.7rem;
    }

    .header-nav .nav-btn {
        width: 100%;
        max-width: none;
        padding: 0.5rem 0.25rem;
        font-size: 0.75rem;
    }

    .two-column-container {
        max-width: 25rem;
        padding: 0.5rem;
    }

    .button-row-vertical {
        flex-direction: column;
        gap: 0.75rem;
    }

    .analyze-btn, .clear-btn, .example-btn {
        width: 100%;
        max-width: none;
    }

    .sequence-input-vertical {
        min-height: 6rem;
        font-size: 0.8rem;
    }
}

/* Results Page Styles */
.results-container {
    width: min(94%, 1680px);
    margin: 1.25rem auto 2rem;
    padding: 0;
}

.result-overview {
    display: grid;
    grid-template-columns: minmax(220px, 0.8fr) minmax(0, 2fr);
    gap: 1.5rem;
    align-items: center;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
    color: #1f2937;
    background: linear-gradient(135deg, #ffffff 0%, #f1f7ff 100%);
    border-radius: 0.9rem;
    border-left: 5px solid #b02a22;
    box-shadow: 0 12px 26px rgba(7, 14, 32, 0.18);
}

.overview-eyebrow {
    display: block;
    margin-bottom: 0.2rem;
    color: #15803d;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.overview-heading h2 {
    margin: 0;
    color: #0f1e3a;
    font-family: "Rajdhani", sans-serif;
    font-size: clamp(1.4rem, 2vw, 2rem);
    font-weight: 700;
}

.overview-top-hit {
    margin: 0.55rem 0 0;
    color: #475569;
    line-height: 1.35;
}

.overview-top-hit span,
.overview-top-hit strong {
    display: block;
}

.overview-top-hit span {
    margin-bottom: 0.1rem;
    color: #64748b;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.overview-top-hit strong {
    color: #1d3461;
    font-size: 0.95rem;
    overflow-wrap: anywhere;
}

.overview-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.overview-metric {
    min-width: 0;
    padding: 0.75rem 0.9rem;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(29, 52, 97, 0.12);
    border-radius: 0.65rem;
}

.overview-metric span,
.overview-metric strong {
    display: block;
}

.overview-composition strong {
    color: #b02a22;
}

.overview-metric span {
    margin-bottom: 0.15rem;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.overview-metric strong {
    overflow-wrap: anywhere;
    color: #0f1e3a;
    font-size: 0.95rem;
}

/* Results two-column layout with optional 3D viewer */
.results-grid {
    display: block;
}

.results-grid.has-viewer {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(460px, 2fr);
    gap: 1.25rem;
    align-items: flex-start;
}

.results-left {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sequence-card { order: 1; }
.alphafold-card { order: 2; }
.summary-card { order: 3; }
.metadata-card { order: 4; }

.results-right {
    min-width: 0;
}

.viewer-card {
    position: sticky;
    top: 1rem;
}

.sequence-card {
    border-width: 2px;
    border-color: #b02a22;
    box-shadow: 0 18px 36px rgba(7, 14, 32, 0.22);
}

.primary-result-label {
    display: inline-block;
    margin-bottom: 0.35rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: #fee2e2;
    color: #991b1b;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.viewer-meta {
    font-size: 0.9rem;
    color: #0C434A;
    overflow-wrap: anywhere;
}

.viewer-heading-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-height: 2rem;
    margin-bottom: 0.65rem;
}

.structure-origin-badge {
    flex: 0 0 auto;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.structure-origin-badge[data-origin="homology"] {
    background: #dcfce7;
    color: #166534;
}

.structure-origin-badge[data-origin="alphafold"] {
    background: #fef3c7;
    color: #92400e;
}

.molstar-viewer {
    width: 100%;
    height: clamp(360px, 54vh, 580px);
    border-radius: 0.6rem;
    border: 2px solid rgba(1, 174, 197, 0.2);
    background: #f8fbfc;
    overflow: hidden;
    position: relative;
}

@media (max-width: 1300px) {
    .results-grid.has-viewer {
        grid-template-columns: 1fr;
    }
    .results-left { grid-row: 1; }
    .results-right { grid-row: 2; }
    .viewer-card {
        position: static;
    }
    .molstar-viewer {
        height: clamp(420px, 62vh, 620px);
    }
}

.analysis-details summary {
    cursor: pointer;
    color: #1d4ed8;
    font-weight: 700;
}

.analysis-details[open] summary {
    margin-bottom: 0.9rem;
}

.metadata-text {
    max-width: 100%;
    margin: 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: 0.82rem;
}

.sequence-section {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
}

@media (max-width: 1100px) {
    .result-overview {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .results-container {
        width: min(100% - 1rem, 1680px);
        margin-top: 0.5rem;
    }
    .result-overview {
        padding: 1rem;
    }
    .overview-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .result-card {
        padding: 1rem;
        margin-bottom: 1rem;
        border-width: 1px;
    }
    .molstar-viewer {
        height: clamp(340px, 55vh, 500px);
    }
    .viewer-heading-row {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 420px) {
    .overview-metrics {
        grid-template-columns: 1fr;
    }
    .button-row {
        align-items: stretch;
        flex-direction: column;
    }
    .button-row button {
        width: 100%;
    }
}

@media (min-width: 1400px) {
    .results-container {
        max-width: 1700px;
    }
    .results-left {
        flex-basis: 42%;
    }
    .results-right {
        flex-basis: 58%;
    }
    .molstar-viewer {
        height: 780px;
    }
}

.result-card {
    background: white;
    border: 3px solid #0891b2;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.result-card h3 {
    color: #0C434A;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.sequence-display {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.8;
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 4px;
}

/* Alignment block typography (keep SEQ/STR aligned) */
.aligned-seq {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
}

.aligned-seq-text {
    letter-spacing: 1px;
}

/* Protein Structure Color Coding - demo_preview.html exact colors */
.H {
    color: red !important;
    font-weight: bold;
}

.B {
    color: blue !important;
    font-weight: bold;
}

.C {
    color: green !important;
    font-weight: bold;
}

/* Structure type colors */
.structure-helix {
    color: #dc3545 !important;
    font-weight: 600;
}

.structure-sheet {
    color: #0d6efd !important;
    font-weight: 600;
}

.structure-coil {
    color: #198754 !important;
    font-weight: 600;
}

.structure-unknown {
    color: rgba(255,255,255,0.42) !important;
}

/* Source markers (do not override structure color) */
.source-dssp {
    text-decoration: underline;
    text-decoration-color: #0d6efd;
    text-decoration-thickness: 2px;
}

.source-model {
    text-decoration-line: underline;
    text-decoration-style: dotted;
    text-decoration-color: #111827;
    text-decoration-thickness: 2px;
}

.source-smoothed {
    text-decoration: underline wavy;
    text-decoration-color: #dc3545;
    text-decoration-thickness: 2px;
}

/* DSSP amino-acid highlighting disabled for now */
.dssp-amino-acid {
    background-color: transparent !important;
    color: inherit !important;
    padding: 0 !important;
    border-radius: 0 !important;
}

.legend {
    background: #e3f2fd;
    padding: 1rem;
    border-radius: 4px;
    margin-top: 1rem;
}

/* Footer */
.footer {
    background-color: #0f1e3a;
    border-top: 1px solid #dee2e6;
    margin-top: auto;
}

.footer .text-muted {
    color: rgba(255,255,255,0.45) !important;
}
