:root {
    --primary-color: #1E293B; /*#273346;*/
    --secondary-color: #475C7D;
    --accent-color: #7796c7;
    --text-color: #F7F7F7;
    --error-color: salmon;
    --mutedBlue : #64748B;
    --gunmetal: #374151;
    --slate-gray: #6D8196;
    --coolGray: #B0BEC5;
    --cool-gray: #CBCBCB;
    --page-bg: #fff;
    
    /* #region reds*/
    --cardinal-red: #C41E3A;
    --brick-red: #C04657;
    --carmine: #960018;
    --carmine-red: #FF0038;
    /* #endregion reds*/

    /* #region greens*/
    --xanadu: #738678;
    --evergreen: #05472A;
    --pistachio: #84B067;
    --celadon: #A8DCAB;
    --emerald: #50C878;
    --jade-green: #00BB77;
    --viridian: #40826D;
    --phthalo-green: #123524;
    /* #endregion greens*/
    
    /* #region blues*/
    --royal-blue: #305CDE;
    --baby-blue: #8FD9FB;
    --misty-blue: #82C8E5;
    --pastel-blue: #B3EBF2;
    --mint-blue: #98FBCB;
    --cobalt-blue: #0047AB;
    --glaucous: #678DC6;
    --pewter: #909EAE;
    --midnight-blue: #272757;
    --teal: #069494;
    --darkTeal: #155E75;
    --cerulean: #007BA7;
    /* #endregion blues*/

    /* #region purples*/
    --lavender: #D3D3FF;
    --lilac: #A47DAB;
    --mauve: #E0AFFF;
    --byzantium: #702963;
    --amethyst: #9966CC;
    /* #endregion purples*/

    /* #region yellows*/
    --maize: #FBEC5D;
    --saffron: #F1C338;
    --marigold: #EAA221;
    --metallic-gold: #D3AF37;
    --jasmine: #F8DE7E;
    --goldenrod: #DAA520;
    /* #endregion yellows*/

    --sidebar-width: 11vw;
    --logo-width: 250px;
    --navBar-height: 7vh;

}

/* #region base.html */

/* Prevent blue background flash when clicking/selecting elements */
*:focus {
    outline: none !important;  /* Removes blue outline on focus */
    box-shadow: none !important; /* Removes Bootstrap's focus styles */
}

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden; /* Prevent double scrollbars */
  font-size: clamp(0.85rem, 1.2vw, 1rem);
}

@media (max-width: 500px) {
  html {
    font-size: 0.85rem;
  }
}

body {
  display: flex;
}

.left-side {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--primary-color);
}

.logo-container {
    background-color: var(--primary-color);
    flex-shrink: 0;
}

.logo-container img {
  height: 40px;
  max-width: 100%;
  object-fit: contain;
}

.sidebar {
    overflow-y: auto;
    flex-grow: 1;
    padding: 1rem;
    color: white;
}

.sidebar a {
    display: block;
    color: white;
    padding: 10px;
    text-decoration: none;
    border-radius: 5px;
    margin-bottom: 10px;
}

.sidebar a:hover {
    background: rgba(255, 255, 255, 0.2);
}

.navbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width); /* dynamic based on your variable */
    width: calc(100% - var(--sidebar-width));
    height: var(--navBar-height);
    background: var(--primary-color) !important;
    color: var(--coolGray);
    z-index: 1050;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.navbar .dropdown-menu {
    position: absolute;
    z-index: 1070; /* make sure it's above other things */
}

.main-content {
  margin-top: var(--navBar-height);
}

.content {
    overflow-y: auto;
    overflow-x: auto;
    height: calc(100vh - var(--navBar-height));
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    padding-bottom: 1.5rem;
    max-width: 100%;
}

@media (max-width: 1100px) {
  .left-side {
    width: 0;
    min-width: 0;
    overflow: hidden;
    display: none;
  }
  .navbar {
    left: 0%;
    width: 100%;
  }
}

@media (max-width: 1600px) {
  .sidebar-icon {
    display: none;
  }
}

@media (max-height: 550px) {
  .navbar {
    height: 0;
    display: none;
  }
  .main-content {
    margin-top: 0;
  }
}

.sticky-header {
    position: sticky;
    top: 0;
    background-color: white;
    z-index: 1000; /* Make sure it's above content rows */
    padding-top: 10px;
    padding-bottom: 10px;
}

.logout-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    color: var(--coolGray);
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    color: var(--coolGray);
}

.hidden {
    display: none;
}

.btn-primary {
    background-color: var(--primary-color);
    border: none;
    color: var(--coolGray);
}

.mt-4 {
    color: var(--primary-color);
}

h5.text-muted {
    font-weight: 600;
    letter-spacing: 0.5px;
    font-size: 1.1rem;
}

.table-container {
    overflow-y: auto !important;
    border: none; /* Optional: Adds a border around the scrollable area */
    border-radius: 5px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3); /* Soft shadow */
    margin-bottom: 20px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 7px !important;
    overflow: hidden; /* Keeps borders smooth */
    
}

.table th, .table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
    justify-content: center;
}

.table th {
    background-color: var(--primary-color) !important;
    color: var(--coolGray) !important;
}

.table tr:hover {
    background-color: #f1f1f1 !important; /* Subtle hover effect */
}

.clickable-row{
    cursor: pointer;
}

.btn {
    margin-right: 20px;
}

/* Loading spinner container - centers spinner */
#loadingSpinner {
    position: fixed; /* Fixed position to keep it in the middle */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* Moves it exactly to the center */
    background: rgba(255, 255, 255, 0.8);  /* Light overlay effect */
    padding: 20px;
    border-radius: 10px;
    z-index: 1000; /* Ensures it's above everything else */
    text-align: center;
    transition: opacity 0.3s ease-in-out; /* Smooth transition */
}

/* #endregion base.html */

/* #region transacciones.html */
/* Fade effect on table when loading */
#transactionsTable {
    opacity: 1;
    transition: opacity 0.5s ease-in-out; /* Smooth transition */
}

.transaction-amount.negative {
    color: var(--cardinal-red);
}

.button-container{
    max-height: 100%;
}

.sortable{
    cursor: pointer;
}

/* #endregion transacciones.html */

/* #region detalle_cuenta.html */
.progress {
    height: 25px;
    border-radius: 5px;
    overflow: hidden;
}

.progress-bar {
    font-size: 14px;
    font-weight: bold;
    line-height: 25px;
    text-align: center;
}

.progress-bar {
    width: var(--progress-width, 0%);
}
/* #endregion detalle_cuenta.html */

.readonly-style {
    background-color: #e9ecef;  /* Bootstrap disabled input bg */
    color: #6c757d;             /* Bootstrap disabled text color */
    cursor: not-allowed;          /* Cursor feedback */
    pointer-events: none;         /* Prevent clicking/focusing */
}

.table td.description-col, .table th.description-col {
    max-width: 200px; /* adjust as needed */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.spinner-border {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 0.15em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
  }
  @keyframes spinner-border {
    100% { transform: rotate(360deg); }
  }
  
  .d-none {
    display: none !important;
  }

  .edittable-input {
    background-color: white !important;
    color: black !important;
  }

  .bg-primary-app {
    background-color: var(--primary-color) !important;
    color: white !important;
  }

  .color-primary {
    color: var(--primary-color) !important;
  }

  .ttc-app {
    color: var(--primary-color) !important;
  }


/* Sidebar Scrollbar Styles */
.sidebar::-webkit-scrollbar {
  width: 8px;
}

.sidebar::-webkit-scrollbar-track {
  background: var(--primary-color);  /* Match the sidebar bg */
}

.sidebar::-webkit-scrollbar-thumb {
  background-color: var(--cool-gray);  /* Thumb color */
  border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background-color: var(--slate-gray); /* On hover */
}

/* Firefox */
.sidebar {
  /*scrollbar-width: thin;*/
  scrollbar-color: var(--cool-gray) var(--primary-color);
}

.text-muted {
  color: var(--mutedBlue) !important;
}

/*DARK MODE*/
body.dark-mode {
  background-color: #121212;
  color: #e0e0e0;
}

body.dark-mode .card {
  background-color: #1f1f1f;
}

body.dark-mode .navbar,
body.dark-mode .bg-primary {
  background-color: #0d6efd;
}

body.dark-mode .form-control {
  background-color: #2c2c2c;
  color: white;
  border-color: #444;
}

#loadingOverlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(255,255,255,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}
