/* Main layout */
#calculator-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    height: 100%;
    padding: 2rem 0;
}

/* Result value styling */
.result-value {
    color: #3f51b5;
    font-weight: 600;
    font-size: 1.1em;
}

.result-var {
    color: #e91e63;
    font-weight: 600;
    font-style: italic;
}

/* Header styling */
#header-section {
    /* text-align: center; */
    margin-bottom: 2rem;
}

#header-section h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
 
}

#header-section p {
    font-size: 1.2rem;

}

/* Main content area */
#main-content {
    flex: 1;
    display: flex;
    min-height: 0; /* Important for flex child */
}

/* Input section */
#input-section {
    display: flex;
    flex-direction: column;
    height: 100%;
}

#input-section textarea {
    font-size: 18px;    
    line-height: 1.6;
    padding: .5rem;
    padding-left: 1rem;
    
    /* rounded border*/
    border-radius: 10px;
    width: 100%;
    min-height: 100%;
    flex: 1;
    border: 1px solid #e0e0e0;
    background-color: #fff;
    background-image: linear-gradient(#eee 0.1em, transparent 0.1em);
    background-size: 100% 1.6em;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    resize: none;
    color: #333;
}

#input-section textarea:focus {
    outline: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    border-color: #ccc;
}

/* Result section */
#result-section {
    height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

#result-content {
    flex: 1;
    overflow-y: auto;
}

#result {
    font-size: 42px;
    line-height: 1.6;
    white-space: pre-wrap;
    margin-bottom: 1rem;
}

.error-message {
    color: #dc3545;
    font-size: 24px;
    padding: 1rem;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin-bottom: 1rem;
}

/* Histogram styling */
#final-histogram-container {
    margin: 1rem 0;
    background: white;
    padding: 1rem;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

#final-histogram svg {
    width: 100%;
    height: auto;
    max-width: 800px;
    margin: 0 auto;
    display: block;
}

#final-histogram svg text {
    font-size: 14px;

}

#final-histogram svg .axis-label {
    font-size: 16px;
    font-weight: 500;

}

#histogram-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

#histogram-header h5 {
}

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

#intermediate-histograms svg {
    width: 100%;
    height: auto;
    max-width: 400px;
    margin: 0 auto;
    display: block;
}

#intermediate-histograms svg text {
    font-size: 12px;

}

#intermediate-histograms svg .axis-label {
    font-size: 14px;
    font-weight: 500;

}

/* Examples section */
#examples-section {
    height: 100%;
    overflow-y: auto;
}

.example-expr {
    font-size: 14px;
    padding: 1rem;
    margin-bottom: 1rem;
    background-color: #f8f9fa;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-family: 'Source Code Pro', monospace;
}

.example-expr:hover {
    background-color: #e9ecef;
}

/* Settings section */
#settings-section {
    margin-top: 2rem;
}

#settings-toggle {
    cursor: pointer;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-radius: 4px;
}

#settings-toggle h5 {
}

.settings-row {
    margin-bottom: 1rem;
}

.settings-row label {
    display: block;
    margin-bottom: 0.5rem;
}

.settings-row input,
.settings-row select {
    width: 100%;
    padding: 0.5rem;
    font-family: 'Source Code Pro', monospace;
}

#settings-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

#settings-buttons button {
    padding: 0.5rem 1rem;
}

/* Download button */
#download-container {
    margin-top: 1rem;
}

#download-samples {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: #f8f9fa;
    border-radius: 4px;
    text-decoration: none;
    color: #212529;
}

#download-samples:hover {
    background-color: #e9ecef;
    text-decoration: none;
}

/* Help Tab Styles */
.help-tab {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    height: 100vh;
    pointer-events: none;
}

.help-tab-header {
    background-color: #f8f9fa;
    padding: 1rem;
    cursor: pointer;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    border: 1px solid #dee2e6;
    border-right: none;
    border-radius: 4px 0 0 4px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: -2px 0 4px rgba(0,0,0,0.1);
    pointer-events: auto;
    position: absolute;
    top: 50%;
    transform: translateY(-50%) rotate(180deg);
}

.help-tab-header:hover {
    background-color: #e9ecef;
}

.help-tab-header i {
    font-size: 1.2rem;
}

#help-content {
    background: white;
    border: 1px solid #dee2e6;
    border-right: none;
    box-shadow: -2px 0 4px rgba(0,0,0,0.1);
    position: relative;
    width: 300px;
    transition: transform 0.3s ease;
    pointer-events: auto;
    transform: translateX(100%);
}

#help-content.show {
    transform: translateX(0);
}

.help-content-wrapper {
    height: 100%;
    overflow-y: auto;
    padding: 1rem;
}

.resize-handle {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    cursor: ew-resize;
    background-color: #dee2e6;
    pointer-events: auto;
}

.resize-handle:hover {
    background-color: #adb5bd;
}

/* Adjust result section when help is expanded */
#result-section {
    transition: margin-right 0.3s ease;
}

#help-content.show ~ #result-section {
    margin-right: 300px;
}

/* Examples section within help tab */
#examples-section {
    height: 100%;
    overflow-y: auto;
}

.example-expr {
    font-size: 14px;
    padding: 1rem;
    margin-bottom: 1rem;
    background-color: #f8f9fa;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-family: 'Source Code Pro', monospace;
}

.example-expr:hover {
    background-color: #e9ecef;
} 

/* Additional distribution information */
#additional-distribution-information {
    margin-top: 2rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 4px;
    font-size: 14px;
}

#additional-distribution-information h5 {
    margin-bottom: 1rem;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 0.5rem;
}

#additional-distribution-information h6 {
    margin-top: 1rem;
    color: #3f51b5;
    font-weight: 600;
}

.dist-info-block {
    margin-bottom: 1rem;
}

.dist-info-block ul {
    padding-left: 1.5rem;
    margin-top: 0.5rem;
}


