/* Universal reset */
html{scroll-behavior:smooth}
* {
    margin: 0;
    padding: 0;
    list-style: none;
    text-decoration: none;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}
.mobile_login a{
    color: black;
    font-size: 17px;
    font-weight: bold;
}
#filter{
    padding: 30px 50px 50px 50px;
}
.login{
    padding: 0 45px;
}
.login a{
    color: white;
    text-decoration: none;
}

#view-trades, #view-performance {
    color: white;
    width: 200px;
    background-color: #186eca;
    border: none;
    padding: 8px;
    font-weight: bold;
    font-size: 12px;
    border-radius: 5px;
    cursor: pointer;
}
.page_section_nav {
    width: 100%;
    display: flex;
    justify-content: flex-start;
    padding: 10px;
    gap: 20px;
    margin-bottom: 20px;
}

/* Layout of top section */
.top_container{
    display: flex;
    justify-content: space-between;
}
#logout-btn{
    width: fit-content;
    padding: 12px;
    background-color: #ff8b8b;
    color: rgb(255, 255, 255);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: background-color 0.3s;
}
#logout-btn:hover{
    background-color: #9e5656;
}
#client-select, #trade-type-select , #row_view_select, #algo-select{
    margin-bottom: 10px;
    width: 200px;
}

#current-date {
    font-size: 18px;
    color: #555;
}

#period-select , #statment_period_select {
    font-size: 16px;
    padding: 5px;
    margin-bottom: 10px;
}
.tables-container{
    background-color: white;
    width: 100%;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}
#trade-table-container {
    margin-top: 20px;
    border-radius: 8px;
}
/* Container for the slideshow */
#open-trades-table, #closed-trades-table  , #all-trades-table, #account_overview_table {
    position: relative;
    width: 100%; 
    overflow: hidden;
    transition: transform 0.5s ease;
}

.table-filters {
    display: flex;
    text-align: center;
    width: fit-content;
    gap: 20px;
    align-items: center;
    margin: 10px auto;
    font-size: 16px;
    
}
.table-filters div{
    display: flex;
    flex-direction: column;
}
/* Style for individual labels in the filters */
.table-filters label {
    font-weight: bold;
    color: #333;
    font-size: 16px;
}

/* Style for the input fields */
.date-range-filter {
    padding: 8px;
    font-size: 16px;
    border-radius: 4px;
    border: 1px solid #ccc;
    width: 180px;
    text-align: center;
    background-color: white;
    color: #333;
    transition: border-color 0.3s, box-shadow 0.3s;
}

/* Focus effect for date inputs */
.date-range-filter:focus {
    border-color: #186eca;
    box-shadow: 0 0 5px rgba(24, 110, 202, 0.5);
}

/* Add hover effect */
.date-range-filter:hover {
    border-color: #186eca;
}


/* General Styling */

.top_section {
    display: flex;
    justify-content: space-between; 
    align-items: flex-start;
    flex-wrap: wrap;
    margin: 10px 0 0 0; 
}

/* Styling for each individual div inside the top section */
.top_section > div {
    display: flex;
    justify-content: space-between; 
    align-items: flex-start;
    flex-direction: column;
    row-gap: 10px;
    margin-left: 10px;
}
.date_container{
    padding: 12px;
}
.trade_type_filter{
    display: flex;
    flex-wrap: wrap;
    flex-direction: row-reverse;
}
.trade_type_filter div{
    margin-left: 10px;
}
h1, h2 {
    text-align: center;
}

label {
    font-weight: bold;
    
}

.accounts_section, .health_check{
    width: 100%;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 50px;
}
.health_check{
    width: 80%;
    margin: 4vh auto;
    height: 100vh;
}
.spacer{
    width: 100%;
    height: 10vh;
}
.account-titles , .health-titles{
    display: flex;
    width: 100%;
    font-weight: bold;
    background-color: #f7f7f7;
    padding: 10px;
    border-radius: 8px;
}

.account-titles div , .health-titles div{
    width: 17%; /* Distribute titles evenly */
    text-align: center;
    padding: 10px;
}
.account-titles div:last-child{
    width: 45%;
}
#account-select {
    margin-top: 10px;
}
#health-select {
    margin-top: 10px;
}

.acc, .health-row {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: #fff;
    margin: 10px 0;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
.acc img{
    opacity: 0;
    width: 30px;
    height: auto;
}
.acc:hover ,  .health-row:hover {
    background-color: #ececec;
}
.acc:hover img {
    opacity: 1;
}

.acc div ,  .health-row div{
    width: 15%; /* Make each column equal width */
    text-align: center;
}

.acc div:last-child{
    width: 45%; /* Button section */
    display: flex;
    align-items: center;
    flex-direction: row-reverse;
}


.acc button {
    padding: 8px 12px;
    background-color: #186eca;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
    margin: 0 5px;
}

.acc button:hover {
    background-color: #06407e;
}

.buttons-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.buttons-container button {
    margin-bottom: 10px;
}

/* Table Styling */
.statment_page_container, .trades_page_container{
    flex-shrink: 0;
    width: 100%;
    margin-bottom: 20px;
}
table {
    border-collapse: collapse;
    background-color: white;
    border: 1px solid #ccc;
}

thead {
    background-color: #f0f0f0;
}

/* Text Alignment */

td, th {
    text-align: right; 
    padding: 10px;
    border: 1px solid #ddd;
}
/* align the first  child to the left (ticker) */
td:first-child, th:first-child{
    text-align: left;
}

/* align all the dates to the center  */
td:nth-child(2), th:nth-child(2) {
    text-align: center; 
}
td:nth-child(3), th:nth-child(3) {
    text-align: center;
}
#open-trades-table td:nth-child(3), #open-trades-table th:nth-child(3) {
    width: 30%;
}

#closed-trades-table td:nth-child(4),#closed-trades-table th:nth-child(4), #all-trades-table td:nth-child(4),#all-trades-table th:nth-child(4)  {
    width: 30%;
}

th {
    background-color: #f9f9f9;
}

tfoot td {
    font-weight: bold;
    background-color: #f9f9f9;
}
/* Styling for Zebra Striping */
tbody tr:nth-child(odd) {
    background-color: #f9f9f9;
}

tbody tr:nth-child(even) {
    background-color: #e7e7e7;
}

/* add hover effect for the zebra striping */
tbody tr:nth-child(odd):hover {
    background-color: #ebebeb;
}

tbody tr:nth-child(even):hover {
    background-color: #d6d6d6;
}

/* Select box styling */
select {
    padding: 5px;
    font-size: 16px;
    border-radius: 4px;
    border: 1px solid #ccc;
}

/* Bottom Section Styling */
#trade_prev-btn, #trade_next-btn, #export-pdf-btn, #statment_prev-btn , #statment_next-btn, #statment_export_pdf_btn {
    padding: 10px 20px;
    background-color: #186eca;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 10px;
}
/* Export PDF button */
#export-pdf-btn, #statment_export_pdf_btn {
    background-color: red;
}
#trade_prev-btn:hover ,  #trade_next-btn:hover, #statment_prev-btn:hover , #statment_next-btn:hover{
    background-color: #06407e;
}
#export-pdf-btn:hover , #statment_export_pdf_btn:hover {
    background-color: rgb(182, 0, 0);
}
div#prev-next-export {
    text-align: center;
    margin-top: 20px;
}


/* Floating buttons at the bottom */
#trade_prev-btn, #trade_next-btn, #statment_prev-btn , #statment_next-btn {
    width: 150px;
    margin-right: 10px;
}

/* Styling the overall layout */
.table_display_container{
    margin-top: 25px;
}
.table_display_container label {
    display: inline-block;
    width: 150px;
    text-align: left;
}

input[type="number"] {
    width: 62px; 
    padding: 5px;
    font-size: 16px;
    border-radius: 4px;
    border: 1px solid #ccc;
    text-align: center;
    background-color: white;
    color: #333;
    outline: none;
}

/* Style on focus */
input[type="number"]:focus {
    border-color: #186eca;
    box-shadow: 0 0 5px rgba(24, 110, 202, 0.5);
}
.bottom_section{
    display: flex;
    justify-content: space-between;
    margin-bottom: 50px;
}

/* STYLE FOR THE LOGIN  */
/* Authentication container */
.auth-container {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    width: 350px;
    text-align: center;
    margin: auto;
    margin-top: 5%;
}

/* Header */
.auth-container h2 {
    margin-bottom: 20px;
    font-size: 22px;
    color: #333;
}

/* Input groups */
.input-group {
    text-align: left;
    margin-bottom: 15px;
}

/* Labels */
.input-group label {
    font-weight: bold;
    font-size: 14px;
    display: block;
    margin-bottom: 5px;
    color: #444;
}

/* Input fields */
.input-group input {
    width: 100%;
    padding: 10px;
    font-size: 16px;
    border-radius: 5px;
    border: 1px solid #ccc;
    background-color: white;
    color: #333;
    outline: none;
    transition: border-color 0.3s;
}

/* Focus effect */
.input-group input:focus {
    border-color: #186eca;
    box-shadow: 0 0 5px rgba(24, 110, 202, 0.3);
}

/* Login button */
#login-btn , #signup-btn , #stay-logged-in{
    margin-top: 15px;
    width: 100%;
    padding: 12px;
    background-color: #186eca;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: background-color 0.3s;
}

#login-btn:hover , #signup-btn:hover{
    background-color: #06407e;
}

/* Authentication links */
.auth-links {
    margin-top: 15px;
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.auth-links a {
    text-decoration: none;
    color: #186eca;
    font-weight: bold;
}

.auth-links a:hover {
    text-decoration: underline;
}
/* Password input with toggle button */
.pwd_container {
    position: relative;
}

.password-group input {
    width: 100%;
    padding-right: 40px; /* Space for the eye icon */
}

#toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
}

#toggle-password img , #logout_img{
    width: 20px;
    height: 20px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

#toggle-password:hover img , #logout_img:hover{
    opacity: 1;
}

.error{
    color: red;
    font-size: 11;
}

#logout-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    text-align: center;
    width: 320px;
    z-index: 1000;
}

#logout-message {
    font-size: 16px;
    color: #333;
    font-weight: bold;
    margin-bottom: 15px;
}

#popup-buttons {
    display: flex;
    justify-content: center;
}

.charts{
    width: 53%;
    margin: 50px auto ;  
}
#accountPerformanceChart{
    width: 100%;
    height: auto !important;

}
.chart-toggle {
  display: flex;
  gap: 1rem;
  padding: 0.5rem;
  font-size: 14px;
}

.chart-toggle label {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
  margin-bottom: 25px;
}

.chart-toggle input[type="radio"] {
  accent-color: #007bff; /* Optional: custom radio color */
  transform: scale(1.2); /* Slightly larger radios */
}

#balance{
    font-size: 24px;
}

#percent{
    font-size: 18px;
    text-align: right;
    padding-right:30px;
}
.success{
    color: green !important;
}
#chart-period-selector {
    text-align: center;
    margin-bottom: 20px;
}

#chart-period-selector button {
    background-color: #f1f1f1;
    border: 1px solid #ccc;
    color: #333;
    padding : 3px 40px;
    margin: 0 5px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s, color 0.2s, border 0.2s;
}

#chart-period-selector button:hover {
    background-color: #e2e8f0;
    border-color: #999;
}

#chart-period-selector button.active {
    background-color: #3182ce;
    color: white;
    border-color: #3182ce;
}

#chart-period-selector button.active-range {
        background-color: #007bff;
        color: white;
        border-color: #007bff;
    }
/* MEDIA QUERRIES */
@media (max-width: 1500px) { 
    .charts {
        width: 70%;
        margin: 50px auto;
    }
}


@media (max-width: 1000px) { 
    .health-titles{
        justify-content: space-between;
    }
    .account-overview-table th, .account-overview-table td {
        font-size: 10px;
    }
    .charts {
        width: 100%;
        margin: 50px auto;
    }
    .acc img {
        display: none;
    }
    .account-titles div, .health-titles div {
        width: 30%;
        padding: 5px;
        font-size: 14px;
    } 
    .account-titles div:last-child {
        display: none;
    }
    .acc div, .health-row div {
        width: 30%;
        text-align: center;
        font-size: 14px;
        text-transform: lowercase;
    }
    .acc div:last-child {
        display: none;
    }
    .account-titles{
        justify-content: space-between;
    }
}
@media screen and (max-width: 900px) {
    .account-overview-table th, .account-overview-table td {
        font-size: 11px;
        padding: 10px 2px;
    }
    #filter {
        padding: 50px 7px 50px 7px;
    }
}
@media screen and (max-width: 750px) {
    .availableCash , .investedAmount{
        display: none;
    }
    .health_check {
        width: 100%; 
        margin: 4vh auto;
        padding: 20px 5px;
    }
    .health-row{
        padding: 15px 10px;
    }
    .trade_type_filter{
        justify-content: space-between;
    }
    .nav_bar{
        font-size: small;
    }
    .login{
        font-size: small;
    }
}
@media screen and (max-width: 600px) {
    #balance{
        font-size: 18px;
    }

    #percent{
        font-size: 14px;
        text-align: right;
        padding-right:30px;
    }
    .account-overview-table th, .account-overview-table td {
        font-size: 11px;
    }
    .trades_page_container th ,.trades_page_container td{
        font-size: 12px;
    } 
    .header{
        position: relative;
    }
    .nav_bar{ 
        display: none;
    }
    #menu_toggle{
        display: flex;;
    }
    #mobile_nav_bar{
        display: flex;
    }
    .login{
        display: none;
    }

}
@media (max-width: 600px) {
    #trade_prev-btn, #trade_next-btn, #statment_prev-btn, #statment_next-btn {
        margin-right: 0;
    }
    .date-range-filter {
        font-size: 12px;
    }   
    #client-select, #trade-type-select, #row_view_select, #algo-select{
        width: 114px;
    }
    select {
        font-size: 12px;
    }
    .table-filters, .bottom_section {
        align-items: flex-end;
        flex-wrap: wrap;
    }
    #trade_prev-btn, #trade_next-btn, #statment_prev-btn, #statment_next-btn {
        width: 100px;
    /* margin-right: 10px; */
    }
    #trade_prev-btn, #trade_next-btn, #export-pdf-btn, #statment_prev-btn, #statment_next-btn, #statment_export_pdf_btn {
        padding: 10px 5px;
        font-size: 12px;
        /* margin-top: 10px; */
    }
    .bottom_section div:first-of-type{
        display: flex;
        justify-content: space-between;
        width: 100%;
    }
    #open-trades-table td:nth-child(3), #open-trades-table th:nth-child(3) {
        display: none;
    }
    #closed-trades-table td:nth-child(4), #closed-trades-table th:nth-child(4), #all-trades-table td:nth-child(4), #all-trades-table th:nth-child(4) {
        display: none;
    }
    .tables-container {
        padding: 20px 0;
    }
    .health-titles div {
        font-size: 12px;
    }
    #filter{
        padding: 30px 2px 50px 2px;
    }
    
    .acc div:first-of-type {
        width: 50px !important;
    }   
    .account-titles div{
        width: auto;
        padding: 5px;
        font-size: 12px;
    } 
    .account-titles div:last-child {
        display: none;
    }
    .acc div:last-child {
        display: none;
    }

    .table-filters label {
        margin-bottom: 8px;
    }

    .date-range-filter {
        width: 100%;
    }
}
@media screen and (max-width: 500px) {
    .accounts_section, .health_check {
        padding: 2px;
    }
}

@media screen and (max-width: 410px) {
    body{
        padding: 0;
        margin: 0;
    }
    .auth-container{
        width: 300px;
    }
    .health-titles div {
        font-size: 10px;
    }
}