/* Styles for the main content area */
main form {
    display: flex;
    flex-direction: column;
    width: 100%;
    align-items: stretch;
}

/* Styles for the main container div */
#mainDiv {
    flex-basis: 60%;
    width: auto;
    display: flex;
    align-items: stretch;
    margin: 1rem;
}

/* Styles for the chart container div */
#chartDiv {
    flex-basis: 75%;
}

/* Styles for the settings container div */
#settings_div {
    text-align: center;
    overflow: scroll;
    flex-basis: 25%;
    margin-right: 0.5rem;
}

#settings_div h1{
    margin: 0.5rem;
}

#settings_div label{
    margin-right: 0.3rem;
}

#chart_metadata > div{
    margin: 0.3rem
}

/* Styles for submenu label */
.submenuLabel+div {
    display: none;
}

/* Styles for chart metadata groups */
div[id^="chart_metadata_group"] {
    padding: 0.5em;
    /* Padding around metadata groups */
    margin-bottom: 0.5em;
    /* Margin below metadata groups */
    background-color: var(--side);
    /* Background color */
}

/* Style for arrow after submenu label */
.submenuLabel::after {
    content: " ";
    border: solid black;
    border-width: 0 0.2rem 0.2rem 0;
    display: inline-block;
    padding: 0.2rem;
    margin-left: 0.5rem;
}

.arrow-down::after {
    transform: rotate(45deg);
    -webkit-transform: rotate(45deg);
}

.arrow-up::after {
    transform: rotate(225deg);
    -webkit-transform: rotate(225deg);
}


/* Styles for the table container div */
#tableDiv {
    padding: 0;
    /* Remove padding */
    overflow: auto;
    /* Add scrollbars if content overflows */
    flex-basis: 75%;
    /* Set the size of the table area */
}

/* Div for file import and export */
#fileDiv {
    flex-basis: 25%;
    background-color: var(--main);
    margin-right: 0.5rem;
    display: flex;
    flex-direction: column;
    padding: 0.5rem;
}

#fileDiv label {
    margin-top: 1rem;
}

/* Styles for secondary div */
#secondaryDiv {
    flex-basis: 40%;
    display: flex;
    margin: 0 1rem 0 1rem;
    text-align: center;
}

/* Styles for table elements */
#dataTable tr,
#dataTable td,
#dataTable th {
    padding: 0;
}

#dataTable td,
#dataTable th {
    height: 2em;
    /* Set height of table cells */
}

/* Styles for table input elements */
#dataTable th input {
    font-weight: bold;
}

/* Styles for table header input */
#dataTable input,
#dataTable div {
    margin: 0;
    width: 100%;
    height: 100%;
    border: 0;
    padding: 0;
}

#dataTable input {
    text-align: center;
    background-color: transparent;
    vertical-align: middle;
}

/* Styles for table header input */
#dataTable th div:has(input[type=text]) {
    display: inline-block;
    width: 85%;
}

/* Styles for table color input */
#dataTable th div:has(input[type=color]) {
    display: inline-block;
    width: 15%;
}

#dataTable input[type=color] {
    border-width: 0;
}

/* Styles for settings container */
#settings_div{
    padding: 0.5rem;
    background-color: var(--main);
}

#settings_div h2{
    color: var(--dark);
}

table {
    width: 100%;
}

table, th, td {
    border-collapse: collapse;
}

th, td {
    padding: 0.4rem;
    border: 1px solid darkgrey;
    min-width: 8rem;
    text-align: center;
}

/* Styles for even rows of table */
tr:nth-child(even) td:not(.UI_remove_row){
    background-color: var(--main);
}

th {
    background-color: var(--main-dark);
}

th div {
    color: var(--light);
}

th input {
    padding: 0;
    margin: 0;
}

[contenteditable] {
    outline: 0 solid transparent;
}


#rcMenu {
    z-index: 1000;
    position: absolute;
    background-color: white;
    border: 1px solid lightgrey;
    box-shadow: 0.2rem 0.2rem 0.2rem gray;
    display: none;
    margin: 0;
    width: 10rem;
}

#rcMenu ul {
    list-style-type: none;
    padding-left: 10px;
    width: 10rem;
}

#rcMenu a {
    text-decoration: none;
    border-bottom: 1px solid lightgrey;
    width: 9rem;
    display: block;
}

#rcMenu a:hover {
    background-color: lightgrey;
}

/* Media query for smaller screens */
@media (max-width: 760px) {
    #mainDiv {
        flex-direction: column-reverse;
    }

    #chartDiv {
        width: auto;
        flex-basis: 60%;
    }

    #settings_div {
        margin-top: 1rem;
        width: auto;
        flex-basis: 40%;
    }

    #tableDiv {
        width: 100%
    }

    #secondaryDiv {
        flex-direction: column;
    }
}