/* modal.css - Base Modal Styles */

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 1000;
    overflow-y: auto;
}
  
.modal-backdrop.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content.tabbed-modal {
    background-color: var(--closeToWhite);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* border-radius: 4px; */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    width: 80%;
    height: 85vh;
    max-width: 1600px;
    max-height: 85vh;
    display: grid;
    grid-template-rows: 75px 30px 1fr 60px;
    grid-template-areas:
      "modal-header"
      "modal-tabs"
      "modal-body"
      "modal-footer";
    z-index: 1001;
    position: relative;
}

.modal-content {
    background-color: var(--closeToWhite);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* border-radius: 4px; */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    width: 80%;
    height: 85vh;
    max-width: 1600px;
    max-height: 85vh;
    display: grid;
    grid-template-rows: 75px 1fr 60px;
    grid-template-areas:
      "modal-header"
      "modal-body"
      "modal-footer";
    z-index: 1001;
    position: relative;
}

.modal-content.delete-content {
    height: unset;
    width: unset;
}

.modal-header {
    grid-area: modal-header;
    padding: 15px 20px;
    /* border-bottom: 1px solid var(--darkerGreen); */
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--darkGreen);
    color: white;
    /* border-radius: 4px 4px 0 0; */
}

.modal-header-texts {
    display: flex;
    flex-direction: column;
}

.modal-header-s {
    font-size: 1rem;
    opacity: 0.8;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: white;
    font-weight: normal;
}

.modal-header h2 b {
    font-size: 1.5rem;
}

.modal-tabs {
    grid-area: modal-tabs;
    display: grid;
    height: 30px;
    grid-template-columns: 20% 20% 20% 20% 20%;
    background-color: var(--darkGreen);
    /* border-top: 1px solid var(--darkGreen); */
    /* border-bottom: 1px solid #ddd; */
    flex-wrap: wrap;
}

.tab-button {
    background-color: var(--darkGreen);
    color: white;
    border: none;
    border-top: 1px solid var(--darkGreen);

}

.tab-button.active {
    background-color: var(--closeToWhite) !important;
    color: var(--darkGreen) !important;
    border-top: 1px solid var(--closeToWhite) !important;
    font-weight: bold;
}

.tab-button:hover {
    background-color: var(--darkerGreen);
    border-top: 1px solid var(--darkerGreen);
}
  
.modal-tab {
    padding: 10px 20px;
    cursor: pointer;
    border: none;
    background: none;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
}
  
.modal-tab.active {
    border-bottom-color: var(--darkGreen);
    font-weight: bold;
    background-color: #e9e9e9;
}

.modal-tab:hover {
    background-color: #e0e0e0;
}
  
.modal-body {
    grid-area: modal-body;
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(90vh - 150px);
    width: 100%;
    background-color: var(--closeToWhite);
}
  
.modal-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    padding: 15px 20px;
    height: 60px;
    width: 100%;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background-color: var(--white);
    /* border-radius: 0 0 4px 4px; */
}

.inline-form-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background-color: var(--closeToWhite);
}
  
.close-modal {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: white;
}

.close-modal:hover {
    opacity: 0.8;
}
  
/* Stacked modals */
.modal-backdrop.stacked {
    z-index: 1002;
}
  
.modal-backdrop.stacked .modal-container {
    z-index: 1003;
}
  
/* Tab content */
.tab-content {
    display: none;
    padding: 15px 0;
}

.tab-content.active {
    display: block;
}

/* Form styling within modals */
.modal-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
    align-items: center;
}

.faktura-form-grid {
    grid-template-columns: 8% 8% 8% 15% 8% 8% 8% 15% 8%;
}

.modal-form-grid.vorschau-form-grid {
    grid-template-columns: 12% 12% 15% 8% 8% 8% 19% 21%;
}

.modal-form-grid.vorschau-form-grid .select2-container {
    min-width: 10em !important;
}

.modal-form-grid.vorschau-form-grid .inline-form-footer {
    justify-content: unset !important;
    width: 50%;
}

/* .modal-form-grid.vorschau-form-grid textarea{
    max-height: 32px;
    min-height: 32px;
    height: unset !important;
} */


.modal-form-grid > div {
    min-width: 0;
    overflow: hidden;
}
  
.modal-form-grid.single-col {
    grid-template-columns: 1fr;
}

.modal-form-grid.three-cols {
    grid-template-columns: repeat(3, 1fr);
}

.modal-form-grid.four-cols {
    grid-template-columns: repeat(4, 1fr);
}

.modal-checkboxes {
    display: flex;
    flex-direction: column;
}

.modal-checkboxes > .form-row {
    margin-bottom: 0px;
    display: flex;
    flex-direction: row;
}

.modal-checkboxes > .form-row > label {
    width: 25%;
}

.modal-checkboxes > .form-row > input {
    width: 15%;
}

.form-row input,
.form-row select,
.form-row textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.form-row textarea {
    min-height: 100px;
}

.form-row.has-error input,
.form-row.has-error select,
.form-row.has-error textarea {
    border-color: #e60000;
}

.field-error {
    color: #e60000;
    font-size: 0.85rem;
    margin-top: 5px;
    display: none;
}

/*Honorar section styling*/
.honorar-grid-and-infobox {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
}

.honorar-infobox h3 {
    display: block;
    padding: 5px;
}

.honorar-grid-and-infobox > .modal-form-grid.honorar {
    min-width: 400px;
    width: 50%;
}

.honorar-grid-and-infobox > .honorar-infobox {
    min-width: 300px;
    width: calc(50% - 10px);
    margin-left: 10px;
    height: fit-content;
}

.honorar-infobox.table-container tr.zs {
    font-weight: bold;
    border-top: 2px solid var(--darkGreen);
}

.honorar-infobox.table-container sup {
    color: var(--red);
    font-size: 10px;
    font-weight: normal;
}


#honorarzusatz-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

#faktura-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

/* Financial section styling */
.financial-overview {
    margin-top: 20px;
}

.financial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.financial-section {
    background-color: #f9f9f9;
    /* border-radius: 5px; */
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.financial-section h4 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    color: var(--darkGreen);
}

.financial-table {
    width: 100%;
    border-collapse: collapse;
}

.financial-table td {
    padding: 5px 0;
}

.financial-table .total-row {
    font-weight: bold;
    border-top: 1px solid #ddd;
}

.financial-table .text-right {
    text-align: right;
}

.financial-table .value-positive {
    color: #009e3c;
}

.financial-table .value-negative {
    color: #e60000;
}

.financial-table .value-total {
    font-weight: bold;
}

.financial-table .percentage {
    color: #5c5c5c;
    font-size: 0.9em;
}

.financial-table .txt-td {
    width: 50%;
}

.financial-table .num-td {
    width: 35%;
}

.financial-table .pct-td {
    width: 15%;
}

/* Zeit filter controls */
.zeit-filter-controls {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    height: 60px;
    border-bottom: 1px solid #ddd;
    /* position: sticky; */
    top: 15px;
    background-color: #f9f9f9;
}

.zeit-filter-fields-wrapper {
    display: grid;
    gap: 10px;
}

.zeit-filter-headline {
    /* position: absolute; */
    margin-top: -25px;
    font-size: 1.2rem;
    color: var(--darkGreen);
}

.export-controls {
    margin-top: -25px;
    display: flex;
    gap: 10px;
    width: 100%;
    justify-content: flex-end;
}

#zeit-filter-form .filter-form-grid {
    grid-template-columns: 20% 12% 12% 20% 20% 16% !important;
}

#zeit-filter-form .select2-container {
    min-width: 13em !important;
}

/* Zeit summary and detail */
.zeit-summary-and-detail {
    margin-top: 15px;
}

.zeit-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.summary-section {
    background-color: #f9f9f9;
    /* border-radius: 4px; */
    padding: 10px;
    margin-bottom: 10px;
}

.summary-section h4 {
    margin-top: 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.summary-table {
    width: 100%;
    border-collapse: collapse;
}

.summary-table th,
.summary-table td {
    padding: 5px 3px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.summary-table th {
    font-weight: bold;
}

.summary-table .text-right {
    text-align: right;
}

/* Faktura section */
.faktura-controls {
    margin-bottom: 15px;
    display: flex;
    justify-content: flex-end;
}

/* Filter form specific styling */
.filter-form {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.formfield-container-header {
    position: fixed;
    top: 22.5px;
    right: 70px;
}

.formfield-container-header > .header-form-row > select {
    width: 100px;
    height: 30px;
    border-radius: 4px;
}
  
/* Animation for modals */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
  
@keyframes slideIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
  
.modal-backdrop.active {
    animation: fadeIn 0.3s ease-out;
}
  
.modal-container {
    animation: slideIn 0.3s ease-out;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    h1 {
        font-size: 1.17rem;
    }
    h2 {
        font-size: 1rem;
    }
    h3 {
        font-size: 0.95rem;
    }
    .modal-content {
        width: 100% !important;
        height: 100% !important;
        max-height: 100% !important;
    }
    
    .modal-form-grid,
    .modal-form-grid.three-cols,
    .filter-form-grid.three-cols {
        grid-template-columns: 1fr;
    }
    
    .modal-form-grid.always-2-cols {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .modal-tabs {
        overflow-x: auto;
    }
    
    .financial-grid,
    .zeit-summary {
        grid-template-columns: 1fr;
    }

    .modal-form-grid.vorschau-form-grid {
        grid-template-columns: repeat(1, 1fr);
    }

    .modal-form-grid.vorschau-form-grid .select2-container {
        min-width: 20em;
    }

    .formfield-container-header {
        display: none;
    }
    .modal-header {
        align-items: flex-start;
    }
    .drp-calendar {
        display: none !important;
    }

    .modal-checkboxes > .form-row > label {
        width: 60%;
    }
    
    .modal-checkboxes > .form-row > input {
        width: 15%;
    }

    #zeit-filter-form .filter-form-grid {
        grid-template-columns: repeat(1, 1fr) !important;
    }
    
    #zeit-filter-form .select2-container {
        min-width: 20em !important;
    }

    .zeit-filter-controls {
        height: unset !important;
    }

}
