/* Custom styles for appGeneral.py */

/* Main card container */
.main-card{
  background-color: #ffffff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  border: 1px solid #f0f0f0;
  display: block;
}

/* Title card above main card */
.title-card{
  background-color: #ffffff;
  border-radius: 12px;
  padding: 12px 18px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.06);
  border: 1px solid #f0f0f0;
  margin-bottom: 12px;
  text-align: center;
}

/* Fixed usuarios box */
.fixed-usuarios{
  position: fixed;
  top: 0;
  left: 990px;
  width: 100%;
  height: 220px;
  overflow-y: scroll;
  font-size: 40px;
  font-weight: 700;
}

/* Counter area */
.contador-general{
  text-align: left;
  margin-left: 25px;
  font-size: 28px;
  font-weight: 700;
  white-space: pre-line;
}

/* Countdown area */
.countdown-block h1{
  font-size: 48px;
  margin-left: 30px;
  display: inline-block;
}
.countdown-block p{
  font-size: 20px;
  margin-left: 30px;
}

/* Header row inside main card: left (counters) and right (timer) */
.main-header{
  display: flex;
  gap: 12px;
  width: 100%;
  margin-bottom: 6px;
  align-items: stretch;
}

/* Controls bar */
.controls-bar{
  width: 100%;
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid #e9ecef;
  background-color: #f8f9fa;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Ensure inner control groups align vertically center */
.controls-bar > div{ display:flex; align-items:center; gap:8px; }

/* Add spacing between coloring buttons */
.controls-bar .white-button{ margin-right: 10px; }

/* White rounded buttons with black text */
.white-button{
  background-color: #ffffff;
  color: #000000;
  border-radius: 8px;
  border: 1px solid #ddd;
  box-shadow: none;
  padding: 6px 10px;
}

/* Active / primary visual when a button is set to primary */
.btn-primary.white-button{
  background-color: #111827 !important; /* dark */
  color: #ffffff !important;
  border-color: #0f172a !important;
}

/* Outline (inactive) appearance */
.btn-outline-secondary.white-button,
.btn-secondary.white-button{
  background-color: #ffffff;
  color: #000000;
  border: 1px solid #ddd;
}

/* Input styles */
.search-input{
  margin-left: 8px;
  margin-right: 6px;
  border-radius: 8px;
  border: 1px solid #e6e6e6;
  padding: 6px;
  color: #000000;
}

/* Dropdowns */
.filter-dropdown{
  display: inline-block;
  margin-right: 6px;
  border-radius: 8px;
}
.filter-dropdown.grupo{ width: 220px; }
.filter-dropdown.prioridad{ width: 160px; }
.filter-dropdown.cargo{ width: 200px; }

/* Inline filter row layout */
.filters-row{ display:flex; align-items:center; gap:8px; }

/* Styled DataTable container */
.styled-table .dash-spreadsheet-container,
.styled-table .dash-table-container{
  background-color: #ffffff;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  padding: 8px;
  border: 1px solid #e6e6e6;
}

/* Header styling for DataTable */
.styled-table .dash-header,
.styled-table .dash-table-container .dash-header {
  background-color: #f1f3f5;
  font-weight: 700;
  text-transform: uppercase;
  border-bottom: 1px solid #e6e6e6;
  padding: 10px;
  color: #111;
}

/* Cell styling fallback (targets table cell content) */
.styled-table td, .styled-table .dash-cell-value{
  padding: 8px !important;
  white-space: normal !important;
  text-align: left !important;
  vertical-align: top !important;
  word-break: break-word !important;
  font-family: Arial, Helvetica, sans-serif !important;
  font-size: 14px !important;
  color: #222 !important;
}

/* Small visual tweaks for the clients table */
.clientes-table .dash-table-container{ padding: 6px; }

/* Make markdown links look nicer inside the table */
.styled-table a{ color: #0b5ed7; text-decoration: none; }
.styled-table a:hover{ text-decoration: underline; }

/* Stats card specific styles */
.stats-card{ 
  flex: 1;
  padding: 8px 12px;
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  border: 1px solid #e6e6e6;
  color: #111; /* ensure text is dark */
}

/* Ensure card-body fills card height so both cards match height */
.stats-card > .card-body,
.countdown-card > .card-body{
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
}

.stats-block{ display:flex; gap:12px; align-items:center; justify-content:space-between; }
.stat-item{ flex:1; text-align:center; padding:12px 10px; border-right:1px solid #f5f5f5; }
.stat-item:last-child{ border-right: none; }
.stat-label{ font-size:13px; color:#444; margin-bottom:6px; }
.stat-value{ font-size:22px; font-weight:700; color:#111; }

/* color helpers (used in markup) */
.text-danger{ color: #d9534f !important; }
.text-success{ color: #5cb85c !important; }

/* Responsive: stack stats on narrow screens */
@media (max-width: 640px){
  .stats-block{ flex-direction:column; align-items:flex-start; }
  .stat-item{ width:100%; text-align:left; border-right: none; border-bottom:1px solid #f5f5f5; }
  .stat-item:last-child{ border-bottom: none; }
}

/* Countdown card styles */
.countdown-card{
  padding: 8px 12px;
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  border: 1px solid #e6e6e6;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 140px;
  flex-shrink: 0;
  color: #111; /* ensure timer text is dark */
}

/* give both cards a minimum height */
.main-header .stats-card,
.main-header .countdown-card{
  min-height: 140px;
  height: 100%;
}

/* make countdown card square */
.main-header .countdown-card{
  height: 140px;
}

.countdown-block-inner{ display:flex; flex-direction:column; align-items:center; justify-content:center; }
.countdown-inner{ text-align:center; }
.countdown-title{ font-size:32px; margin:0; color:#111; font-weight: 700; }
.countdown-message{ font-size:13px; margin:0; color:#333; margin-top: 4px; }

@media (max-width: 640px){
  .countdown-card{ width:100%; margin-top:0; }
  .stats-block{ flex-direction:column; align-items:flex-start; }
  .stat-item{ width:100%; text-align:left; border-right: none; border-bottom:1px solid #f5f5f5; }
  .stat-item:last-child{ border-bottom: none; }
}

@media (max-width: 900px){
  /* on narrower tablets/phones stack vertically */
  .main-header {
    flex-direction: column;
  }
  .countdown-card{
    width: 100% !important;
  }
}

/* Make controls bar responsive on small screens */
@media (max-width: 900px){
  .controls-bar{ flex-direction: column; align-items: stretch; }
  .controls-bar > div{ width: 100%; display:flex; flex-direction:row; flex-wrap:wrap; gap:8px; }
  .controls-bar .filters-row{ flex-direction: column; align-items: stretch; }
  .controls-bar .filter-dropdown{ width: 100% !important; min-width: 0; }
  .controls-bar .search-input{ width: 100% !important; box-sizing: border-box; }
  .controls-bar .white-button{ width: auto; }
}

@media (max-width: 640px){
  .controls-bar > div{ flex-direction: column; align-items: stretch; }
  .controls-bar .filters-row{ gap:6px; }
}
