/* analysis_style.css */

/* Define the custom color variable locally if specific to this page's table */
.app-container.analysis-page-container {
    --gematria-custom-divisor-highlight-color-local: #FDD835; /* Local yellow for custom divisors */
    /* ... existing .app-container.analysis-page-container styles ... */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    border: 1px solid #3F3F46;
    box-sizing: border-box;
    background-color: #1E1E1E;
}

body {
    background-color: #0E0E0E;
    color: #DCDCDC;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
}

/* ... (rest of .app-header, .app-header h2, etc. from your original analysis_style.css) ... */
.app-header {
    background-color: #2D2D30;
    padding: 8px 10px;
    border-bottom: 1px solid #3F3F46;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-shrink: 0;
    position: relative;
}
.app-header h2 {
    font-size: 1.1em;
    font-weight: bold;
    margin: 0;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--title-gradient-end, #4169E1); /* Uses global var from style.css */
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    max-width: calc(100% - 500px);
    box-sizing: border-box;
}
.app-header .header-action-links {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}
.app-header .header-action-links a {
    color: #DCDCDC;
    text-decoration: none;
    padding: 5px 10px;
    background-color: #3A3D41;
    border: 1px solid #4A4A4A;
    border-radius: 0;
    transition: background-color 0.2s, border-color 0.2s;
    font-size: 0.9em;
    white-space: nowrap;
}
.app-header .header-action-links a:hover {
    background-color: #4A4D51;
    border-color: #007ACC;
}

.analysis-main-layout {
    display: flex;
    flex-grow: 1;
    overflow: hidden;
    background-color: #1E1E1E;
}

.analysis-left-pane {
    width: 350px;
    flex-shrink: 0;
    padding: 15px;
    background-color: #252526;
    border-right: 1px solid #3F3F46;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.analysis-right-pane {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 15px;
    background-color: #1E1E1E;
}

.analysis-controls-section,
.analysis-status-section {
    background-color: transparent;
    padding: 0;
    border: none;
    border-radius: 0;
}
.analysis-left-pane > section:last-child {
    margin-bottom: 0;
}

.analysis-main-layout h3 {
    color: #00AEEF;
    margin-top: 0;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #3F3F46;
    font-size: 1.2em;
}

.control-group {
    margin-bottom: 12px;
}
.control-group label, .control-group legend {
    display: block;
    margin-bottom: 6px;
    color: #B0BEC5;
    font-size: 0.9em;
}
.control-group select,
.control-group input[type="number"],
.control-group input[type="text"] {
    padding: 6px 10px;
    font-size: 0.9em;
    color: #DCDCDC;
    background-color: #333333;
    border: 1px solid #4A4A4A;
    border-radius: 0;
    box-sizing: border-box;
    width: 100%;
}
.control-group input[type="number"] {
    max-width: 80px;
}
.control-group fieldset {
    border: 1px solid #3F3F46;
    padding: 10px 12px;
    margin-top: 5px;
    border-radius: 0;
}
.control-group fieldset legend {
    font-size: 0.95em;
    font-weight: bold;
    padding: 0 5px;
    color: #C5C5C5;
}
.control-group fieldset div {
    margin-bottom: 6px;
}
.control-group fieldset div:last-child {
    margin-bottom: 0;
}
.control-group fieldset input[type="checkbox"] {
    margin-right: 8px;
    vertical-align: middle;
}
.control-group fieldset label {
    display: inline;
    margin-bottom: 0;
    color: #DCDCDC;
    font-size: 0.9em;
    vertical-align: middle;
}

.custom-divisor-group {
    display: flex;
    align-items: center;
    margin-top: 8px;
}
.custom-divisor-group input[type="checkbox"] {
    flex-shrink: 0;
}
.custom-divisor-group label[for="divisor-custom-cb"] {
    margin-left: 5px;
    margin-right: 5px;
    display: inline-block !important;
    margin-bottom: 0 !important;
    flex-shrink: 0;
    color: #DCDCDC;
}
#custom-divisors-input {
    width: auto;
    flex-grow: 1;
    max-width: 180px;
    padding: 4px 6px;
    font-size: 0.85em;
    margin-left: 3px;
}

.action-buttons-group {
    margin-top: 15px;
}
.action-buttons-group button {
    width: calc(50% - 5px);
}
.action-buttons-group button:first-child {
    margin-right: 10px;
}

#analysis-progress-text {
    margin-bottom: 10px;
    font-style: italic;
    color: #B0BEC5;
    font-size: 0.9em;
    min-height: 1.2em;
}
#analysis-progress-bar {
    height: 8px;
    width: 100%;
    border-radius: 2px;
}
#analysis-progress-bar::-webkit-progress-bar {
    background-color: #333;
    border-radius: 2px;
}
#analysis-progress-bar::-webkit-progress-value {
    background-color: #007ACC;
    border-radius: 2px;
}
#analysis-progress-bar::-moz-progress-bar {
    background-color: #007ACC;
    border-radius: 2px;
}

.analysis-results-section {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background-color: #252526;
    padding: 15px;
    border: 1px solid #3F3F46;
    border-radius: 0;
    overflow: hidden;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}
.results-header h3 {
    margin-bottom: 10px;
}
.results-actions {
    margin-bottom: 10px;
    display: flex;
    justify-content: flex-end;
}

.results-table-container {
    flex-grow: 1;
    overflow-y: auto;
    border: 1px solid #303030;
    background-color: #1E1E1E;
    padding: 0;
}
.results-table-container table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}
.results-table-container th,
.results-table-container td {
    border-bottom: 1px solid #303030;
    border-right: 1px solid #303030;
    padding: 6px 8px;
    text-align: left;
    vertical-align: top;
}
.results-table-container th:first-child,
.results-table-container td:first-child {
    border-left: none;
}
.results-table-container th:last-child,
.results-table-container td:last-child {
    border-right: none;
}
.results-table-container th {
    background-color: #2D2D30;
    color: #00AEEF;
    position: sticky;
    top: 0;
    z-index: 1;
    border-top: none;
}
.results-table-container tbody tr:nth-child(even) td {
    background-color: #222223;
}
.results-table-container tbody tr:hover td {
    background-color: #3A3D41;
}

/* MODIFIED/ADDED HIGHLIGHT CLASSES FOR ANALYSIS TABLE */
.results-table-container .gematria-value-highlight-37 {
    color: var(--gematria-highlight-37-color, #B00020); /* Uses global var from style.css */
    font-weight: bold;
}
.results-table-container .gematria-value-highlight-73 {
    color: var(--gematria-highlight-73-color, blue);    /* Uses global var from style.css */
    font-weight: bold;
}
.results-table-container .gematria-highlight-custom {   /* NEW */
    color: var(--gematria-custom-divisor-highlight-color-local, #FDD835); /* Uses local var defined above */
    font-weight: bold;
}
.results-table-container .divisor-pf-separator {        /* NEW */
    font-weight: normal;
    color: #DCDCDC; /* Or your table's default text color */
}
/* END MODIFIED/ADDED HIGHLIGHT CLASSES */

.results-table-container p {
    padding: 15px;
    text-align: center;
    color: #777;
}

.analysis-left-pane button,
.analysis-right-pane button:not(.pane-action-button) {
    padding: 8px 15px;
    font-size: 0.95em;
    color: #FFFFFF;
    background-color: #007ACC;
    border: 1px solid #005A9E;
    border-radius: 0;
    cursor: pointer;
    transition: background-color 0.2s;
}
.analysis-left-pane button:not(:last-child){
    margin-right: 10px;
}
.analysis-right-pane button:not(.pane-action-button):not(:last-child) {
     margin-right: 10px;
}

.analysis-left-pane button:hover,
.analysis-right-pane button:not(.pane-action-button):hover {
    background-color: #005A9E;
}
.analysis-left-pane button:disabled,
.analysis-right-pane button:not(.pane-action-button):disabled {
    background-color: #2D2D30;
    border-color: #3F3F46;
    color: #666;
    cursor: not-allowed;
}
#cancel-analysis-btn {
    background-color: #f44336;
    border-color: #d32f2f;
}
#cancel-analysis-btn:hover {
    background-color: #c62828;
}

#copy-analysis-results-btn {
    background-color: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    line-height: 0;
    flex-shrink: 0;
}
#copy-analysis-results-btn img {
    width: var(--control-icon-width, 16px);  /* Uses global var from style.css */
    height: var(--control-icon-width, 16px); /* Uses global var from style.css */
    display: block;
    filter: grayscale(30%) opacity(0.7);
    transition: filter 0.2s ease-in-out;
}
#copy-analysis-results-btn:hover img {
    filter: grayscale(0%) opacity(1);
}
#copy-analysis-results-btn:disabled img {
    opacity: 0.4;
}
#copy-analysis-results-btn:disabled {
    cursor: not-allowed;
}

/* MOBILE VIEW ADJUSTMENTS */
@media (max-width: 900px) {
    body {
        height: auto; 
        overflow-y: auto; 
    }
    .app-container.analysis-page-container {
        height: auto; 
        min-height: 100vh; 
        overflow: visible; 
    }
    .analysis-main-layout {
        flex-direction: column;
        overflow-y: visible; 
        overflow-x: hidden;
        height: auto; 
    }
    .analysis-left-pane {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #3F3F46;
        overflow-y: visible; 
        padding: 10px;
        box-sizing: border-box;
        gap: 10px;
        height: auto; 
    }
    .analysis-right-pane {
        overflow-y: visible; 
        padding: 10px;
        box-sizing: border-box;
        height: auto; 
    }
    .analysis-results-section {
        min-height: 300px; 
        padding: 10px;
        height: auto; 
        overflow: visible; 
    }
    .results-table-container {
        font-size: 0.85em;
        overflow-y: visible; 
        max-height: none; 
        height: auto; 
    }
    .results-table-container th {
        position: static; 
    }

    .action-buttons-group button {
        width: 100%;
        margin-bottom: 10px;
        margin-right: 0;
    }
    .action-buttons-group button:last-child {
        margin-bottom: 0;
    }
    .custom-divisor-group {
        flex-wrap: wrap;
    }
    #custom-divisors-input {
        min-width: 100px;
        margin-top: 5px;
        width: 100%;
        max-width: none;
    }
    .custom-divisor-group label[for="divisor-custom-cb"]{
        width: auto;
    }
}