 /* Desktop Version - No changes here */
#box-spread-calculator,
#risiko-analyse {
    max-width: 100%;
    margin: 0 auto;
    padding: 15px;
    box-sizing: border-box;
}

/* Custom Tooltip Styles */

 label[data-tooltip] {
    position: relative;
    cursor: help; /* Changes cursor to indicate tooltip */
}

label[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%; /* Positions tooltip above the header */
    left: 50%;
    transform: translateX(-50%);
    background-color:white;
    color: #3452ff;
    padding: 5px 8px;
    border-radius: 4px;
    white-space: wrap;
    width:400px;
    opacity: 0;
    border:1px solid #3452ff;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 10;
    font-size: 0.8rem;
}

label[data-tooltip]:hover::after {
    opacity: 1;
}

 
th[data-tooltip] {
    position: relative;
    cursor: help; /* Changes cursor to indicate tooltip */
}

th[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%; /* Positions tooltip above the header */
    left: 50%;
    transform: translateX(-50%);
    background-color: white;
    color: #3452ff;
    padding: 5px 8px;
    border-radius: 4px;
    white-space: wrap;
    width :400px;
    opacity: 0;
    border:1px solid #3452ff ;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 10;
    font-size: 0.8rem;
}

th[data-tooltip]:hover::after {
    opacity: 1;
}

h3[data-tooltip] {
    position: relative;
    cursor: help; /* Changes cursor to indicate tooltip */
}

 
h3[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%; /* Positions tooltip above the heading */
    left: 25%;
    transform: translateX(-50%);
    background-color: white;
     color: #3952f8;
    padding: 5px 8px;
    border-radius: 0px;
    max-width: 400px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 10;
    font-size: 0.8rem;
    border: 1px solid  #3952f8 ;
}



h3[data-tooltip]:hover::after {
    opacity: 1;
}



#berechnungstag-container-risiko > label:nth-child(4) > i:nth-child(1)::after{
    left:250px!important;}
 



tr.result-row td {
    text-align: right;
}

.konhide {
    display: none;
}

/* Remove the arrows (spinners) for number input fields on Chrome, Safari, and Edge */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Remove the spinners for Firefox */
input[type="number"] {
    -moz-appearance: textfield;
}
 

div#berechnungstag-container,
div#berechnungstag-container-risiko {
    margin-bottom: 20px;
}

#boxSpreadForm > table > thead > tr > th:nth-child(1),
#risikoAnalyseForm > table > thead > tr > th:nth-child(1) {
    width: 10%;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

#boxSpreadForm > table > tbody > tr:nth-child(5) > td,
#risikoAnalyseForm > table > tbody > tr:nth-child(5) > td {
    text-align: right;
    background: white;
    border: none;
}

th, td {
    padding: 8px;
    text-align: left;
    font-size: 1rem;
}

/* Button */
button.calculate-button {
    padding: 10px 20px;
    font-size: 1rem;
    background-color: #3352ff;
    color: white;
    border: none;
    cursor: pointer;
}

button.calculate-button:hover {
    background-color: #2239cc;
}

/* Result Message Box */
.message-box {
    margin-top: 20px;
    font-weight: bold;
    font-size: 15px;
}

/* Mobile Version */
@media (max-width: 768px) {
    /* Hide the table headers */
    thead {
        display: none;
    }

    input#berechnungstag,
    input#berechnungstag_risiko {
        width: 100%;
    }

    /* Display table rows as block elements */
    tr {
        display: block;
        margin-bottom: 15px;
    }

    /* Label each table cell using ::before to simulate the table header */
    td {
        display: flex;
        justify-content: space-between;
        padding: 10px 0;
        position: relative;
        font-size: 0.9rem;
    }

    td::before {
        content: attr(data-label); /* Use the data-label attribute to generate a label */
        font-weight: bold;
        flex-basis: 40%; /* Labels take 40% of the row */
        text-align: right;
        margin-right: 10px;
    }

    /* Ensure input fields take the rest of the space */
    td input {
        width: 60%;
        padding: 10px;
        font-size: 1rem;
        margin-left: auto;
    }

    /* Full-width button */
    button.calculate-button {
        width: 100%;
        padding: 15px;
        font-size: 1.2rem;
    }
}

 
  
  
  /* Main container: Flexbox layout for inputs */
#berechnungstag-container-risiko {
    display: flex;
    gap: 20px; /* Space between input-label pairs */
    justify-content: space-between; /* Spread items evenly */
    align-items: center; /* Center-align vertically */
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    margin-bottom: 20px;
}

/* Each input-label pair */
.form-group {
    display: flex;
    align-items: center; /* Align label and input vertically */
    flex-direction: row; /* Align label and input horizontally */
    gap: 10px; /* Space between label and input */
    flex: 1 1 calc(33% - 10px); /* Three elements per row */
    min-width: 200px; /* Avoid shrinking too much */
}

/* Styling for input fields */
input[type="date"],
input[type="number"] {
    width: 100%; /* Full width within the container */
    max-width: 250px; /* Limit the width */
    padding: 8px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #f8f8f8;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

/* Ensure focus state is visible */
input[type="date"]:focus,
input[type="number"]:focus {
    border-color: #3352ff;
    box-shadow: 0 0 5px rgba(51, 82, 255, 0.3);
    outline: none;
}

/* Label styling */
label {
    font-weight: 600;
    font-size: 1rem;
    white-space: nowrap; /* Prevent label wrapping */
}

/* Responsive layout for smaller screens */
@media (max-width: 768px) {
    #berechnungstag-container-risiko {
        flex-direction: column; /* Stack elements vertically on mobile */
    }

    .form-group {
        width: 100%; /* Full width for each input group */
        flex-direction: column; /* Stack label above input */
        align-items: flex-start; /* Align left for readability */
    }

    input[type="date"],
    input[type="number"] {
        width: 100%; /* Full width on mobile */
    }
}

.no-focus {
    outline: none;
    box-shadow: none;
    border: none;
}

.no-focus:focus {
    outline: none;
    box-shadow: none;
 
    border:1px solid transparent!important;
}

.spread{font-size: 20px; line-height: 20px; height: 20px; width: 20px;    color: #3952f8;;}
div#boxSpreadMessage {
    background: #fcfcfc;
    border: 2px solid #f4f3f4;
    padding: 4%;
    font-weight: normal;
    font-size: 16px;
    letter-spacing: 0.5px;
}

/* Add styles for the Save button */
.save-button {
    margin-left: 10px;
    padding: 8px 16px;
    background-color: #28a745;
    color: #fff;
    border: none;
    cursor: pointer;
    border-radius: 4px;
}

.save-button:hover {
    background-color: #218838;
}