/* ============================================================
   ATLAS OF AMINO ACID ROLES — REDESIGNED CSS
   Aesthetic: Scientific Biopunk / Deep-Lab Dark
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ============================================================
   1. GLOBAL PAGE SETTINGS
   ============================================================ */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    background-color: #060A0F;
    color: #C8D6E5;
    font-family: 'DM Sans', sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;

    /* Subtle grid texture */
    background-image:
        linear-gradient(rgba(0, 255, 180, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 180, 0.015) 1px, transparent 1px);
    background-size: 40px 40px;
}

/* ============================================================
   2. APP WRAPPER — FULL PAGE FLEX LAYOUT
   ============================================================ */
.app-div {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    min-height: 100vh;
    width: 100%;
    gap: 0;
}

/* ============================================================
   3. HEADER — Now a vertical sidebar title strip
   ============================================================ */
h1 {
    display: none; /* Hidden — replaced by .app-sidebar-title */
}

/* ============================================================
   4. LEFT SIDEBAR (Control Panel)
   ============================================================ */
.control-square {
    width: 280px !important;
    min-width: 260px !important;
    max-width: 300px !important;
    flex: 0 0 280px !important;
    flex-shrink: 0 !important;

    background-color: #0B1017;
    border-right: 1px solid #1A2535;
    padding: 0 !important;

    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    gap: 0 !important;

    /* Remove old box-shadow/margin that assumed horizontal */
    margin-bottom: 0 !important;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.6) !important;

    position: relative;
    overflow: hidden;
}

/* Glowing accent line on the left edge */
.control-square::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg,
        transparent 0%,
        #00FFB4 20%,
        #00C8FF 50%,
        #00FFB4 80%,
        transparent 100%
    );
    opacity: 0.7;
}

/* TITLE BLOCK inside sidebar */
.control-square::after {
    content: '';
    display: block;
    height: 0;
}

/* App title — placed as first child inside control-square in layout.py */
.sidebar-title-block {
    padding: 28px 20px 24px 24px;
    border-bottom: 1px solid #1A2535;
    background: linear-gradient(135deg, #0D1520 0%, #0B1017 100%);
}

.sidebar-app-title {
    font-family: 'Space Mono', monospace !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    letter-spacing: 0.08em;
    line-height: 1.4;
    color: #00FFB4 !important;
    text-transform: uppercase;
    margin: 0 0 6px 0 !important;
}

.sidebar-app-subtitle {
    font-family: 'DM Sans', sans-serif;
    font-size: 10px;
    font-weight: 300;
    color: #4A6A8A;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin: 0;
}

/* ============================================================
   5. CONTROL ITEMS — Vertical stacked in sidebar
   ============================================================ */
.control-item-wide,
.control-item-small {
    flex: 0 0 auto !important;
    width: 100% !important;
    display: block !important;
    padding: 18px 20px 18px 24px;
    border-bottom: 1px solid #1A2535;
    transition: background 0.2s ease;
}

.control-item-wide:hover,
.control-item-small:hover {
    background-color: rgba(0, 255, 180, 0.02);
}

/* Section number badge + label */
.control-label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    font-family: 'Space Mono', monospace !important;
    font-size: 9px !important;
    font-weight: 700 !important;
    letter-spacing: 0.12em !important;
    text-transform: uppercase !important;
    color: #00C8FF !important;
    margin-bottom: 10px !important;
    opacity: 0.9;
}

/* ============================================================
   6. INPUTS & DROPDOWNS — Sidebar edition
   ============================================================ */
input[type="text"] {
    background-color: #060D15 !important;
    color: #E8F4FF !important;
    border: 1px solid #1E3A5A !important;
    border-radius: 6px !important;
    padding: 7px 12px !important;
    font-size: 12px !important;
    font-family: 'Space Mono', monospace !important;
    height: 34px !important;
    width: 100% !important;
    outline: none !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    white-space: nowrap !important;
    overflow-x: auto !important;
}

input[type="text"]:focus {
    border-color: #00FFB4 !important;
    box-shadow: 0 0 0 2px rgba(0, 255, 180, 0.15) !important;
}

input[type="text"]::placeholder {
    color: #2A4A6A !important;
}

/* Status text under UniProt input */
.control-item-small p,
.control-item-small span {
    font-size: 10px !important;
    color: #4A7A6A !important;
    margin-top: 5px !important;
    font-family: 'Space Mono', monospace !important;
}

/* MAIN DROPDOWN */
.Select-control {
    width: 100% !important;
    background-color: #060D15 !important;
    border: 1px solid #1E3A5A !important;
    border-radius: 6px !important;
    min-height: 34px !important;
    height: auto !important;
    transition: border-color 0.2s ease;
}

.Select-control:hover {
    border-color: #00C8FF !important;
}

/* AMINO ACID TAGS */
.Select-value {
    background-color: #0D2035 !important;
    border: 1px solid #1A4060 !important;
    color: #A8D8F0 !important;
    margin: 2px !important;
    padding: 0px 5px !important;
    font-size: 9px !important;
    font-family: 'Space Mono', monospace !important;
    height: 18px !important;
    border-radius: 3px !important;
}

.Select-value-label {
    color: #A8D8F0 !important;
    line-height: 18px !important;
}

.Select-placeholder,
.Select-input > input {
    color: #3A6A8A !important;
    font-size: 11px !important;
}

.Select-menu-outer {
    background-color: #080F18 !important;
    border: 1px solid #1E3A5A !important;
    border-radius: 0 0 8px 8px !important;
    z-index: 1000 !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.7) !important;
}

.VirtualizedSelectOption {
    background-color: #080F18 !important;
    color: #C8D6E5 !important;
    font-size: 12px !important;
    padding: 8px 12px !important;
    transition: background 0.15s ease;
}

.VirtualizedSelectOption:hover,
.VirtualizedSelectFocusedOption {
    background-color: #0D2035 !important;
    color: #00FFB4 !important;
}

/* RADIO BUTTONS (Pick data) */
input[type="radio"] {
    accent-color: #00FFB4;
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
}

.radio-items label,
.dash-radioitems label {
    color: #C8D6E5 !important;
    font-size: 14px !important;
    font-family: 'DM Sans', sans-serif !important;
    font-weight: 500 !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    transition: color 0.15s ease;
}

.radio-items label:hover,
.dash-radioitems label:hover {
    color: #00FFB4 !important;
}

/* SELECT ALL / DESELECT ALL buttons */
.Select ~ div button,
button {
    background: transparent !important;
    color: #4A7A9A !important;
    border: 1px solid #1A3A5A !important;
    border-radius: 5px !important;
    height: 26px !important;
    padding: 0 10px !important;
    font-size: 10px !important;
    font-family: 'Space Mono', monospace !important;
    font-weight: 700 !important;
    letter-spacing: 0.05em;
    cursor: pointer !important;
    transition: all 0.2s ease;
    margin-top: 6px !important;
    margin-right: 4px !important;
}

button:hover {
    background-color: rgba(0, 200, 255, 0.08) !important;
    border-color: #00C8FF !important;
    color: #00C8FF !important;
}

/* ============================================================
   7. MAIN CONTENT AREA (right of sidebar)
   ============================================================ */
.main-content {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    padding: 24px 24px 24px 28px;
    gap: 20px;
    overflow: hidden;
    min-width: 0;
}

/* ============================================================
   8. PAGE TITLE (top of main content)
   ============================================================ */
.page-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-bottom: 18px;
    border-bottom: 1px solid #1A2535;
    position: relative;
}

.page-title-main {
    font-family: 'Space Mono', monospace;
    font-size: 38px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin: 0 0 6px 0;

    /* Glowing gradient text */
    background: linear-gradient(135deg, #E8F4FF 0%, #A8D8FF 40%, #00FFB4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 18px rgba(0, 255, 180, 0.25));
}

.page-title-main span.highlight {
    background: linear-gradient(135deg, #00FFB4 0%, #00C8FF 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 12px rgba(0, 255, 180, 0.5));
}

.page-title-sub {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin: 0;

    background: linear-gradient(90deg, #00C8FF 0%, #3A6A8A 60%, transparent 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================================
   9. GRAPH LAYOUT — Stacked, full-width
   ============================================================ */
.graph-row-wide {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 18px;
    margin-bottom: 0;
}

.graph-card {
    width: 100%;
    min-width: 0;
    background-color: #080F18;
    border-radius: 14px;
    border: 1px solid #1A2535;
    padding: 4px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    transition: border-color 0.2s ease;
    position: relative;
    overflow: hidden;
}

.graph-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, #00FFB4, #00C8FF, transparent);
    opacity: 0.5;
    border-radius: 14px 14px 0 0;
}

.graph-card:hover {
    border-color: #1E3A5A;
}

.js-plotly-plot {
    width: 100% !important;
    border-radius: 10px;
}

/* Force plotly graphs to fill the card */
.js-plotly-plot .plotly {
    width: 100% !important;
}

/* ============================================================
   10. CLICK HISTORY
   ============================================================ */
.click-history-card {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 18px;
    background-color: #080F18;
    border: 1px solid #1A2535;
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.click-history-title {
    margin: 0 0 14px 0;
    color: #00FFB4;
    font-family: 'Space Mono', monospace;
    font-size: 16px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.click-history-content {
    min-height: 80px;
    max-height: 350px;
    overflow-y: auto;
    color: #A8D8FF;
    font-family: 'Space Mono', monospace;
    font-size: 12px;
}

.click-history-content ol {
    margin: 0;
    padding-left: 28px;
}

.click-history-content li {
    padding: 12px;
    margin-bottom: 10px;
    background-color: #0D1722;
    border: 1px solid #1A3A5A;
    border-radius: 8px;
}

.click-history-content li:last-child {
    margin-bottom: 0;
}

.click-history-content li div {
    margin: 3px 0;
}

.click-history-sequence {
    overflow-wrap: anywhere;
    color: #6F9DBD;
}


/* ============================================================
   10. MOLSTAR CONTAINER
   ============================================================ */
.MolStar_container {
    width: 100%;
    border-radius: 14px;
    border: 1px solid #1A2535;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    background-color: #080F18;
    min-height: 450px;
    position: relative;
}

.MolStar_container::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, #00C8FF, #00FFB4, transparent);
    opacity: 0.5;
    z-index: 2;
}

/* ============================================================
   11. MOLSTAR PROTECTION
   ============================================================ */
.msp-plugin button,
.msp-btn,
[class*="msp-"] button {
    background-color: #efefef !important;
    color: #333 !important;
    border: none !important;
    padding: 2px 4px !important;
    height: auto !important;
    font-family: inherit !important;
    font-size: inherit !important;
    letter-spacing: normal !important;
}

.msp-icon {
    color: #333 !important;
}

/* ============================================================
   12. SCROLLBAR STYLING
   ============================================================ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #060A0F;
}

::-webkit-scrollbar-thumb {
    background: #1A3A5A;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #00C8FF;
}

/* ============================================================
   13. LOADING STATES
   ============================================================ */
._dash-loading {
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

/* ============================================================
   14. STATUS / INFO TEXTS
   ============================================================ */
.status-text,
p {
    color: #4A6A8A !important;
    font-size: 11px !important;
    margin: 4px 0 0 0 !important;
    font-family: 'Space Mono', monospace !important;
}