/* Variables */
:root {
    /* Primärfarbe */
    --primary-color: hsl(207, 90%, 47%);
    
    /* Basis-Farben */
    --color-white: hsl(0, 0%, 100%);


    /* Text und Container Hintergründe */
    --text-color: hsl(0, 0%, 20%);
    --text-light: hsl(0, 0%, 50%);
    --text-muted: hsl(0, 0%, 70%);
    --background-color: hsl(0, 0%, 36%);
    --background-medium: hsl(0, 0%, 53%);
    --background-light: hsl(0, 0%, 88%);
    --background-lighter: hsl(0, 0%, 98%);
    --background-savings: hsl(122, 90%, 96%); 
    --border-color: hsl(0, 0%, 85%);
    
    
    /* Error u. Warning */
    --warning-color: hsl(45, 90%, 50%);
    --warning-color-lighter: hsl(57, 90%, 95%);

    --error-color: hsl(0, 90%, 45%);
    --error-light: hsl(0, 90%, 95%);
    --error-border: hsl(0, 90%, 80%);


    
    /* Interaktive Elemente */
    --hover-color: hsl(60, 100%, 95%);
    --bar-bg: hsl(47, 100%, 45%);
    --button-bg: hsl(36, 100%, 45%);
    --button-bg-hover: hsl(36, 100%, 35%);
    --u-value-button-bg: hsl(44, 100%, 80%);
    --u-value-button-hover-bg: hsl(44, 100%, 65%);
    --u-value-button-active-bg: hsl(39, 100%, 45%);
    --txt-link: hsl(36, 100%, 71%);
    
    
    /* Transparenz */
    --modal-overlay: hsla(0, 0%, 0%, 0.5);
    --shadow-color-light: hsla(0, 0%, 0%, 0.05);

    /* Andere Variablen */
    --border-radius: 4px;
    --transition-speed: 0.1s;
    --transition-speed-modal: 0.4s;
    --shadow-default: 0 2px 8px hsla(0, 0%, 0%, 0.1);
    --icon-sprite: url('/resources/daemmrechner/haus-icons.gif');
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;

}


a {
    color: var(--txt-link);
    text-decoration: underline;
}

a:hover {
    opacity: 0.8;
}



/* Typography */
h1, h2, h3 {
    margin-bottom: 16px;
    line-height: 1.2;
}

h1.page-title {
    font-size: 2rem;
    color: var(--color-white);
    text-shadow: none;
}

.subtitle {
    font-size: 1.0rem;
    color: var(--color-white);
    margin-bottom: 22px;
}

h2 {
    font-size: 1.5rem;
    color: var(--primary-color);
}

p {
    margin-bottom: 16px;
    line-height: 1.33;
}

.label1 {
    font-size: 15px;
}

/* Layout */

.calculator-wrapper {
    color: var(--text-color);
    background-color: var(--background-color);
    line-height: 1.5;
    padding-top: 20px;
}

#calculatorMain {
    max-width: 1000px;
    margin: 0 auto;
    padding: 9px;
}

header.calculator-container {
    padding-top: 2rem;
}

/* Button Group */
.button-group {
    display: flex;
    gap: 12px;
    margin: 30px 0;
}

.select-component-btn,
.help-btn {
    padding: 8px 22px;
    border: none;
    border-radius: var(--border-radius);
    background-color: var(--button-bg);
    color: var(--color-white);
    cursor: pointer;
    font-size: 20px;
    transition: background-color var(--transition-speed);
}

.help-btn {
    background-color: var(--text-light);
}

.select-component-btn:hover {
    background-color: var(--button-bg-hover);
}

.help-btn:hover {
    background-color: var(--text-color);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--modal-overlay);
    z-index: 1000;
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    position: relative;
    background: var(--background-lighter);
    padding: 40px 10px 10px 10px;
    border-radius: var(--border-radius);
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px var(--shadow-color-light);
}

.modal-close {
    position: absolute;
    top: 5px;
    right: 10px;
    font-size: 34px;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-muted);
    transition: color var(--transition-speed);
}

.modal-close:hover {
    color: var(--text-color);
}

/* Help Content Styles */
.help-content {
    padding: 20px;
    font-size: 1rem;
}

.help-content h3 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.help-intro {
    margin-bottom: 1.5rem;
    color: var(--text-color);
    font-size: 1.1rem;
}

.help-steps {
    margin: 1.5rem 0;
    padding-left: 1.5rem;
}

.help-steps li {
    margin-bottom: 0.75rem;
    padding-left: 0.5rem;
}

.help-description {
    margin: 1.5rem 0;
    line-height: 1.6;
    color: var(--text-light);
}

.help-note {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: var(--warning-color-lighter);
    border-left: 4px solid var(--warning-color);
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.help-note strong {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.help-note p {
    color: var(--text-color);
    font-size: 0.95rem;
    margin: 0 0 0.5rem 0;
}

/* Section Styles */
section {
    margin-bottom: 32px;
}

section > div {
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

.component-selection {
    margin-bottom: 0;
}

/* Grid Layout */
.components-grid {
    display: grid;
    grid-template-columns: 40px 1fr auto auto;
    gap: 16px;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid var(--border-color);
}

/* Component Selection Styles */
.components-table {
    padding: 0;
    border-radius: var(--border-radius);
    max-height: 700px;
    overflow-y: auto;
}

.components-header {
    background-color: var(--background-light);
    font-weight: bold;
}

.components-header small {
    font-weight: normal;
}

/* Component Row */
.component-row {
    display: grid;
    grid-template-columns: 30px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
    transition: background-color var(--transition-speed);
}

.component-row:hover,
.component-row.selected {
    background-color: var(--hover-color);
}

.component-icon, 
#componentIcon {
    width: 30px;
    height: 30px;
    background-image: var(--icon-sprite);
    background-repeat: no-repeat;
    margin-right: 10px;
    flex-shrink: 0;
}

.component-name {
    font-size: 0.9em;
    color: var(--text-color);
}

.u-value-buttons {
    display: flex;
    gap: 8px;
}

.u-value-button {
    padding: 4px 8px;
    width: 90px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--u-value-button-bg);
    font-size: 0.85em;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.u-value-button:hover {
    background-color: var(--u-value-button-hover-bg);
}

.u-value-button.active{
    background-color: var(--u-value-button-active-bg);
    color: var(--color-white);
}

/* U-Wert Eingabefelder */
.u-values-container {
    background: var(--background-light);
    padding: 15px;
    border-radius: 4px;
    box-shadow: var(--shadow-default);
}

.u-value-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    gap: 10px;
}

.u-value-row label {
    color: var(--text-color);
    font-size: 1em;
}

.u-value-row .unit {
    color: var(--text-light);
    font-size: 0.9em;
}

.input-with-unit input {
    width: 80px;
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 16px;
    text-align: left;
    background-color: var(--color-white);
}

/* Error Styles */
.error {
    display: none;
    color: var(--error-color);
    background-color: var(--error-light);
    border: 1px solid var(--error-border);
    padding: 8px 12px;
    margin-top: 5px;
    border-radius: var(--border-radius);
    font-size: 0.9em;
}

/* Results Section */

.results {      
    margin-bottom: 16px;
}

.selected-component-header {
    display: none;
    align-items: center;
    padding: 10px;
    background-color: var(--background-lighter);
    border-radius: var(--border-radius);
    margin-bottom: 5px;
}

.selected-component-header.active {
    display: flex;
}

.selected-component-header h3 {
    margin: 0;
    font-size: 1.1em;
    color: var(--text-color);
}

.insulation-results-wrapper {
    background-color: var(--background-lighter);
}

/* Bar Chart Styles */
.bar-container {
    display: grid;
    grid-template-columns: 60px 1fr;
    gap: 10px;
    align-items: center;
    margin-bottom: 8px;
}

.bar-container.header {
    margin-bottom: 20px;
}

.bar-label {
    font-size: 0.9em;
    color: var(--text-light);
}

.header .bar-label a {
    height: 20px;
    font-size: 18px;
    color: var(--text-color);
    display: block;
}

.bar-wrapper {
    position: relative;
    height: 24px;
    background-color: var(--background-lighter);
    border-radius: var(--border-radius);
}

.header .bar-wrapper {
    height: 20px;
    font-size: 18px;
    color: var(--text-color);
}

.bar {
    height: 100%;
    background-color: var(--bar-bg);
    border-radius: var(--border-radius);
    transition: width var(--transition-speed);
    position: relative;
}

.bar-value {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-white);
    font-size: 0.9em;
    font-weight: 600;
}

.bar-value::after {
    content: "cm";
    font-size: 0.7rem;
    margin-left: 2px;
}

/* resource Saving Section */
.all-savings{
    text-align: left;
    padding: 20px;
    background-color: var(--background-medium);
    color: var(--color-white);
    border-radius: var(--border-radius);
    margin-top: 30px;
}

.all-savings h3 {
    margin-bottom: 5px;
    font-size: 1.4em;
    color: var(--color-white);
}

.energy-saving h4,
.co2-savings h4 {
    margin: 0;
    color: var(--text-color);
    font-size: 1.2em;
    font-weight: normal;
}

.saving-info {
    color: var(--color-white);
    margin: 0;
    line-height: 1.4;
}

.energy-saving,
.co2-savings {
    margin: 1rem 0;
    padding: 1rem;
    background-color: var(--background-savings);
    border-radius: var(--border-radius);
}

.energy-saving h4 {
    margin: 0;
    color: var(--text-color);
}

.co2-savings div {
    margin: 0;
    color: var(--text-light);
}

/* Hinweistexte */
.hint-text {
    font-size: 0.875rem;
    color: var(--color-white);
    opacity: 0.9;
}


