/* ============================================================
   MAIN TABS
============================================================ */

.main-tabs {
    width: 100%;
}


/* ============================================================
   TAB BUTTONS
============================================================ */

.tab-buttons {
    display: flex;

    gap: 4px;

    margin-bottom: 20px;

    border-bottom: 1px solid #dfe7f0;
}


/* ============================================================
   TAB BUTTON
============================================================ */

.main-tab-button {
    border: none;

    background: transparent;

    padding: 11px 22px;

    margin-top: 0;

    border-bottom: 3px solid transparent;

    color: #7b8b9c;

    font-family: inherit;

    font-size: 16px;
    font-weight: 600;

    cursor: pointer;

    transition:
        color 0.2s ease,
        border-color 0.2s ease,
        background 0.2s ease;
}

.main-tab-button:hover {
    background: transparent;

    color: #2878e5;

    box-shadow: none;
}

.main-tab-button.active {
    color: #2878e5;

    border-bottom-color: #2878e5;
}


/* ============================================================
   TAB CONTENT
============================================================ */

.main-tab-content {
    display: none;
}

.main-tab-content.active {
    display: block;
}


/* ============================================================
   CALCULATOR LAYOUT
============================================================ */

#calculatorTab {
    display: none;
}

#calculatorTab.active {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        minmax(0, 1fr);

    gap: 18px;

    align-items: start;
}


/* ============================================================
   PHASE & ELEMENTS
   FULL WIDTH
============================================================ */

#calculatorTab > section:nth-child(1) {
    grid-column: 1 / -1;
}


/* ============================================================
   CRYSTAL STRUCTURE
   FULL WIDTH
============================================================ */

#calculatorTab > section:nth-child(2) {
    grid-column: 1 / -1;
}


/* ============================================================
   MAGNETIC INPUT
============================================================ */

#calculatorTab > section:nth-child(3) {
    grid-column: 1;
}


/* ============================================================
   MAGNETIC RESULTS
============================================================ */

#calculatorTab > section:nth-child(4) {
    grid-column: 2;
}

/* ============================================================
   DATABASE TAB
============================================================ */

#databaseTab.active {
    display: block;
}


/* ============================================================
   DATABASE SECTION
============================================================ */

#databaseTab .section {
    width: 100%;
}


/* ============================================================
   RESPONSIVE
============================================================ */

@media (max-width: 900px) {

    body {
        padding: 24px;
    }

    #calculatorTab.active {
        grid-template-columns: 1fr;
    }

    #calculatorTab > section:nth-child(1),
    #calculatorTab > section:nth-child(2),
    #calculatorTab > section:nth-child(3),
    #calculatorTab > section:nth-child(4) {
        grid-column: 1;
    }
}


@media (max-width: 600px) {

    body {
        padding: 16px;
    }

    .tab-buttons {
        gap: 0;
    }

    .main-tab-button {
        flex: 1;

        padding: 10px 8px;

        font-size: 14px;
    }
}

/* ============================================================
   FACTSAGE TAB
============================================================ */

#factsageTab {

    padding: 0;

}


/* Page Header */

#factsageTab .page-header {

    margin-bottom: 32px;

}


#factsageTab .page-header h2 {

    margin-top: 0;
    margin-bottom: 8px;

}


#factsageTab .page-header p {

    margin: 0;

}


/* FactSage Section */

.factsage-section {

    margin-bottom: 28px;

    padding: 24px;

    border: 1px solid #d0d7de;

    border-radius: 8px;

}


/* Section Title */

.factsage-section h3 {

    margin-top: 0;

    margin-bottom: 16px;

}


/* Description */

.factsage-section p {

    margin-top: 0;

    margin-bottom: 20px;

}


/* Upload Area */

.factsage-upload-area {

    display: flex;

    flex-direction: column;

    align-items: flex-start;

    gap: 12px;

}


/* File Name */

#stablePhaseFileName {

    font-size: 14px;

    color: #666;

}


/* Matching Result */

#phaseMatchingResult {

    padding-top: 8px;

}
