/* Contains styling for analytical page content */


/* Common component styling */

.data-container {   /* Core container */
    width: calc(100% - 150px);
    margin: 0px 50px 25px 30px;
    /* margin-bottom: 30px; */
    border-radius: 30px;
    background-color: var(--off-white);
    padding: 25px 35px;
    /* -webkit-overflow-scrolling: touch; */
}

@media (max-width:1200px) and (min-width:900px) {
    .data-container {
        margin-left: 0px;
        width: calc(100% - 120px);
        margin-right: 0px;
    }
}

@media (min-width:625px) and (max-width:899px) {
    .data-container {
        margin-left: 0px;
        width: calc(100vw - 170px);
        /* 170px = 50px margin *2 + 35px padding *2 */
        margin-right: 0px;
    }
}


@media (max-width:624px) {
    .data-container {
        margin: 0px 10px 15px 10px;
        width: calc(100vw - 20px);
        padding: 15px;
        border-radius: 10px;
        box-sizing: border-box;
    }

    .download-chart {display: none}
}






/* SHARED COMPANY OVERVIEW KEY STATS */

#summ-company-overview {
    margin-top: 120px;
    display: flex;
    flex-direction: column;
}

#summ-company-name {
    color: var(--dark-blue);
    font-size: 1.75rem;
    margin-top: 0;
    margin-bottom: 20px;
    padding: 0;
}


/* Company name */




/* Key stats */

/* #summ-key-stats {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.summ-data-row {
    display: flex;
    flex-direction: row;
}

.summ-data-col {
    display: flex;
    flex-direction: column;
}

.add-margin-right {
    margin-right: 20px;
} */

.blue-text {
    color: var(--mid-blue);
    font-weight: bold;
}

#summ-key-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.summ-data-item {
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
    width: 45%; /* Flex items take up 45% of the width, adjusting dynamically */
    max-width: 250px;
}

.summ-data-item p {
    margin: 0;
}

/* Percentile scores */


#summ-tp-scores {
    display: flex;
    flex-direction: row;
    /* flex-wrap: wrap; */
    align-content: center;
    justify-content: center;
    /* margin-bottom: 10px; */
}

#summ-score-wrapper {
    display: flex;
    flex-direction: row;
    /* flex-wrap: wrap; */
    align-content: center;
    justify-content: center;
    border-color: var(--dark-blue);
    border-radius: 30px;
    border-style: solid;
    padding: 0 10px;
}

.summ-percentile-circle {
    border-radius: 50%;
    height: 40px;
    width: 40px;
    background-color: var(--mid-blue);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.summ-scores {
    padding: 5px;
    display: flex;
    align-items: center;
}

.summ-score-gap {
    margin-left: 20px;
}

.summ-score-title {
    display: flex;
    flex-direction: row;
    align-items: center;
    margin-right: 10px;
    flex-wrap: wrap;
}

.percentile-score {
    font-weight: bolder;
}



/* CHART WITH DATA TABLE ON RHS */

.chart-plus-data {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width:100%
}

.chart-plus-data > div {
    flex: 1; /* Allow each flex item to grow and shrink equally */
    margin: 0 10px; /* Add some space between the items */
    min-width: 0; /* Allow items to shrink below their minimum content width */
}

.lhs-chart {
    flex: 2.5 !important;  /* Give the chart more space relative to the data table */
}


/* Percentile distribution charts */

.two-histogram {
    display: flex;
    flex-direction: row;
    width: 100%;
}

.two-histogram > div {
    flex: 1; /* Allow each flex item to grow and shrink equally */
    margin: 0; /* Add some space between the items */
    min-width: 0; /* Allow items to shrink below their minimum content width */
}



/* STYLING FOR PHOTO DOWLOAD BUTTON. TO BE REPOSITIONED */

.chart-title {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-content: center;
}

.logo-in-download {
    display: flex;
    flex-direction: row;
    /* align-content: center; */
    flex-wrap: wrap;
}

.logo-in-download > p {
    font-weight: bolder;
    margin-left: 10px;
    font-size: 1.3rem;
    display: none;
}

.logo-in-download span {
    font-variation-settings:
    'FILL' 0,DBB302
    'wght' 500,
    'GRAD' 0,
    'opsz' 48;
    color: var(--mid-blue);
    font-size: 20px;
    margin-left: 10px;
}

.logo-in-download > img {
    height: 25px;
    display: none;
}

.data-source {
    display: none;
}

.company-name-for-image {
    display: none;
    font-weight: bold;
}


/* STYLING FOR THE PRICE PAGE */
/* Styling for time period buttons */

/* Button Group Styling */

.button-group-wrapper {
    max-width:80%;
    margin: 0 auto; /* Center the container horizontally */
}

.button-group {
    display: flex;
    justify-content: center;
    margin-bottom: 25px;
    flex-wrap: wrap; /* Allows wrapping of buttons */
  }
  
.period-button {
    margin: 0;
    padding: 10px 20px;
    cursor: pointer;
    background-color: var(--off-white);
    border: 1px solid var(--mid-blue);
    border-left: none;
    border-radius: 0px;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
    flex-shrink: 0; /* Prevents buttons from shrinking too much */
    text-align: center; /* Ensures text is centered */
  }
  
  
.large-button-group .period-button {
    flex: 1 1 30%; /* Allows buttons to be 30% of the container width, adjust as needed */
    min-width: 70px; /* Sets a minimum width to prevent buttons from becoming too small */
    max-width: 150px;
    border-radius: 0px;
    border-left: 1px solid var(--mid-blue);
}

.period-button:first-child {
    border-left: 1px solid var(--mid-blue);
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
}
  
.large-button-group .period-button:first-child {
    border-radius: 0px;
}

.period-button:last-child {
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
}

.large-button-group .period-button:last-child {
    border-radius: 0px;
}

  .period-button:hover {
    background-color: var(--light-blue);
  }
  
  .period-button.active {
    background-color: var(--dark-blue);
    color: var(--off-white);
    border-color: var(--dark-blue);
  }
  

@media (max-width:624px) {
    .period-button {
        padding: 10px 7px;
      }
}


/* Style for the popup */
.popup {
    display: none;
    position: absolute;
    background-color: var(--background-blue);
    border: 1px solid var(--mid-blue);
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(1, 26, 83, 0.1);
    width: 300px;
    z-index: 1000;
    right:100%;
    transform: translateX(+20px) translateY(0%); /* Adjust the position */
}

.chart-info-help {
    position: relative; /* Ensure the popup is positioned relative to the help icon */
}

.chart-info-help:hover .popup {
    display: block;
}

/* Optional: Styling for the help icon */
.material-symbols-outlined.help-icon {
    cursor: default;
}


/* Styling for values in table */
.positive-value {
    color: var(--green-text) !important;
    font-weight: bold;
}

.negative-value {
    color: var(--red) !important;
    font-weight: bold;
}




/* STANDARD TABLE FORMATTING */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 1.2rem;
    text-align: left;
}

table thead tr {
    background-color: var(--dark-blue);
    color: var(--off-white);
    text-align: left;
    font-weight: bold;
}

table th,
table td {
    padding: 5px 15px;
    border: 1px solid var(--light-blue);
}

table tbody tr {
    border-bottom: 1px solid var(--dark-blue);
}

/* Apply bold text to the first column of the table */
table td:first-child, table th:first-child {
    font-weight: bold;
}

table tbody tr:last-of-type {
    border-bottom: 2px solid var(--dark-blue);
}

.highlight-row {
    background-color: var(--light-blue); /* Light blue background for the selected row */
}

.percentile-summary-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dark-blue);
    background-color: var(--mid-blue);
    font-weight: bolder;
    font-size: 1.2rem;
    margin: 0 auto;  /* Centralise the circle in the column */
}

.table-separator-row {
    border-bottom: 1px solid #000;
    height: 1px;
    padding: 0;
}


/* SCROLLING TABLE FUNCTIONALITY */
.scrolling-table {
    overflow-x: auto; /* Enable horizontal scrolling */
    width: 100%; /* Ensure the container takes up full width */
    position: relative; /* Add this to allow the ::after pseudo-element to position itself relative to the table */
    /* -webkit-overflow-scrolling: touch; Enable smooth scrolling on iOS devices */
}

.scrolling-table table {
    min-width: 600px; /* Set a minimum width for scrolling to occur */
    position: relative; /* Make sure the table rows scroll but the header stays relative */
}

.scrolling-table::-webkit-scrollbar {
    height: 10px; /* Customize scrollbar height */
}

.scrolling-table::-webkit-scrollbar-thumb {
    background-color: var(--light-blue); /* Customize the color of the scrollbar thumb */
    border-radius: 10px; /* Rounded scrollbar thumb */
}

.scrolling-table::-webkit-scrollbar-track {
    background-color: white; /* Customize the color of the scrollbar track */
    border-radius: 10px; 
}


/* Financials table */
/* 1) Wrap each table in a scroll container */
.table-scroll {
    overflow-x: auto;
    position: relative;
}

/* 2) Freeze first column + header */
.table-scroll th:first-child,
.table-scroll td:first-child {
    position: sticky;
    left: 0;
    background: var(--off-white); /* match your table background */
    z-index: 2;
    font-weight: normal;
}

/* 3) Freeze the header row */
.table-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 3;
}

/* 4) Remove border on that top-left cell */
.table-scroll thead th:first-child {
    border-top: none;
    border-left: none;
}

/* 5) Indent class */
.table-indent {
    padding-left: 2em;
}


/* STYLING FOR DASHBOARD PANES */
/* General container styling */
.dashboard-container {
    padding: 0px;
    display: flex;
    flex-wrap: wrap; /* Allows multiple groups on the same row if space permits */
    gap: 20px; /* Adds space between the groups */
    justify-content: flex-start; /* Aligns groups to the start */
}

/* Group container with border, margin, and automatic width */
.mini-charts-group {
    border: 1px solid var(--mid-blue);
    border-radius: 5px;
    padding: 10px;
    background-color: var(--off-white); /* #f9f9f9; */
    display: inline-block;
    width: auto; /* The group width adjusts to fit the contents */
}

/* Styling for the section titles */
.mini-charts-group p {
    margin: 0 0 10px 0;
    font-weight: bold;
    font-weight: 1.2em;
}

/* Styling for multi charts in one div (e.g., gauge charts)*/

.mini-charts {
    display: flex;
    flex-wrap: wrap;
    /* justify-content: space-between; */
    gap: 10px;
}


/* Individual chart styling */
.mini-chart {
    width: 140px;
    height: 140px;
    background-color: white;
}

/* Responsive adjustments */
@media (max-width: 624px) {
    .mini-charts-group {
        width:100%;
    }
}



@media (min-width:625px) and (max-width:899px) {
    #summ-company-overview {
        margin-top: 25px;
    }
}

@media (max-width:624px) {
    #summ-company-overview {
        margin-top: 0px;
    }
    #summ-company-name {
        font-size: 1.5rem;
        margin-bottom: 10px;
    }
    .summ-percentile-circle {
        height: 30px;
        width: 30px;
    }
}

