/* Additional custom styles beyond Tailwind */

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

button:hover {
  cursor: pointer;
}

/* Chart hover effects */
canvas:hover {
  cursor: crosshair;
}

/* Add some animation to the cards */
/* .bg-white {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
} */

.bg-white:hover {
  /* transform: translateY(-5px); */
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Dashboard Grid Layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  grid-template-rows: auto 1fr auto;
  grid-template-areas:
    "header header"
    "sidebar main"
    "sidebar bottom";
  height: 100vh;
}

.header-section { 
  grid-area: header; 
}
.sidebar-section { 
  grid-area: sidebar; 
}
.main-section { 
  grid-area: main; 
  /* overflow-y: auto; */
  display: inline-grid; 
}
.bottom-section { 
  grid-area: bottom; 
}

/* Header */
.header {
  display: flex;
    align-items: center;
    padding: 10px 0 10px 20px;
}
.left-space {
    width: 260px;
}
.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 20px;
}
.logo-container img {
    width: 60px;
    height: 60px;
    margin-right: 20px;
}
.logo-container .title {
    font-size: 36px;
    font-weight: bold;
    margin-right: 40px;
}
.sections {
    display: flex;
    gap: 90px;
    margin-left: 40px;
}
.section {
    text-align: center;
}
.section span {
    display: block;
}
.text {
  font-size: 24px;
}
.amount {
  font-size: x-large;
  font-weight: 500;
}

.total-row {
  font-size: 0.875rem;
  font-weight: 700;
}

#user-message {
  font-size: 14px;
  margin-bottom: 10px;
}

#auth-nav-controls {
  display: flex;
  position: relative;
  flex-direction: row;
  justify-content: center;
  height: fit-content;
  gap: 10px;
  align-items: center;
}

/* Stock Ticker */
.ticker {
  background-color: #000;
  color: #000;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
  border-radius: 4px;
  height: 56px;
  width: 100%;
}

/* Ticker content */
.ticker-content {
  display: inline-block;
  padding-top: 14px;
  padding-bottom: 5px;
  animation-iteration-count: infinite;
  animation-timing-function: linear;
  transform: translateX(100%);
}

/* Individual ticker items */
.ticker-item {
  display: inline-block;
  padding: 0 20px;
  font-family: 'Segoe UI', Arial, sans-serif;
  font-size: 16px;
  font-weight: 500;
}

/* Symbol styling */
.ticker-symbol {
  margin-right: 8px;
  color: #fff;
  font-weight: bold;
}

/* Up/down indicators */
.ticker-up {
  color: #2ecc71;
  font-weight: bold;
  margin: 0 4px;
}

.ticker-down {
  color: #e74c3c;
  font-weight: bold;
  margin: 0 4px;
}

/* Optional: Add a separator between items */
.ticker-item:not(:last-child)::after {
  content: "|";
  color: #444;
  margin-left: 20px;
}

/* Make sure ticker items don't wrap */
.ticker-item, .ticker-up, .ticker-down, .ticker-symbol {
  white-space: nowrap;
}

/* Add a subtle shadow effect at the edges to indicate more content */
.ticker::before,
.ticker::after {
  content: "";
  position: absolute;
  top: 0;
  width: 20px;
  height: 100%;
  z-index: 1;
}

.ticker::before {
  left: 0;
  background: linear-gradient(to right, rgba(0,0,0,1), rgba(0,0,0,0));
}

.ticker::after {
  right: 0;
  background: linear-gradient(to left, rgba(0,0,0,1), rgba(0,0,0,0));
}

.ticker-paused {
    display: inline-block;
    background-color: #e74c3c;
    color: white;
    font-weight: bold;
    padding: 4px 8px 2px 8px;
    border-radius: 4px;
    margin-left: 20px;
    animation: blinkColors 2.0s infinite;
}

@keyframes blinkColors {
    0% { 
        background-color: #e74c3c; 
        color: white;
    }
    50% { 
        background-color: white; 
        color: #ff0000;
    }
    100% { 
        background-color: #ff0000; 
        color: white;
    }
}

/* Four-section financial grid layout */
/* #financial-period-display {
  background-color: #f7fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.375rem;
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
} */

/* Make grid section headers match the layout */
@media (max-width: 1200px) {
  .bottom-section .grid.grid-cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .bottom-section .grid.grid-cols-4 {
    grid-template-columns: 1fr;
  }
}

/* Enhanced styling for section headers */
.bottom-section .grid.grid-cols-4 > div {
  padding: 0.5rem;
  background-color: #f0f4f8;
  border: 1px solid #e2e8f0;
  border-radius: 0.25rem;
  font-weight: 600;
  color: #4a5568;
}

/* Ensure section titles are visible on all screen sizes */
@media (max-width: 768px) {
  .bottom-section .grid.grid-cols-4 > div {
    margin-bottom: 0.25rem;
  }
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .financial-sections-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, auto);
  }
}

@media (max-width: 768px) {
  .financial-sections-grid {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, auto);
  }
}

/* Financial sections grid layout and styling */

/* Four-section financial grid layout */
.financial-sections-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 12px 12px;
  width: 100%;
}

#financial-period-display {
  position: relative;
  top: 4px;
}

/* Style for purple headers */
.purple-header {
  background-color: #9f7aea;
  color: white;
  padding: 0.5rem;
  font-weight: 500;
  text-align: center;
  font-size: 0.875rem;
  border-top-left-radius: 0.25rem;
  border-top-right-radius: 0.25rem;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .financial-sections-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, auto);
  }
}

@media (max-width: 768px) {
  .financial-sections-grid {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, auto);
  }
  
  .financial-section {
    margin-bottom: 1.5rem;
  }
}

/* Enhanced styling for section containers */
.financial-section {
  background-color: white;
  border: 1px solid #e2e8f0;
  border-radius: 0.375rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Make data tables more compact */
.financial-section .data-table {
  font-size: 0.75rem;
  width: 100%;
  border-collapse: collapse;
}

.financial-section .data-table th,
.financial-section .data-table td {
  padding: 0.15rem 0.5rem;
  line-height: 1.5;
}

.financial-section .data-table th {
  font-weight: 600;
  color: #4a5568;
  font-size: 0.7rem;
  text-transform: uppercase;
}

.financial-section .data-table tr {
  border-bottom: 1px solid #f0f4f8;
}

.financial-section .data-table tr:last-child {
  border-bottom: none;
}

/* Make category labels smaller */
.financial-section .category-label {
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Adjust amount formatting */
.financial-section .amount {
  font-size: 0.75rem;
  text-align: right;
  white-space: nowrap;
}

/* Adjust percentage change formatting */
.financial-section .percent-change {
  font-size: 0.75rem;
  text-align: right;
  white-space: nowrap;
  width: 60px;
}

/* Compact TTM section */
.financial-section .ttm-section {
  padding: 0.25rem 0.5rem;
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  border-top: 1px solid #e2e8f0;
  background-color: #f9fafb;
  margin-top: auto;
}

/* Make section headers more compact */
.financial-section .section-title {
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.125rem;
}

/* Fix table overflow issues */
.financial-section .table-container {
  overflow-x: auto;
  flex: 1;
  padding: 0.375rem;
}

/* Ensure TOTAL rows stand out */
.financial-section .total-row {
  font-weight: 600;
  border-top: 1px solid #e2e8f0;
  background-color: #f7fafc;
}

/* Color coding for percentage changes */
.text-green-600 {
  color: #38a169;
}

.text-red-600 {
  color: #e53e3e;
}

.text-gray-500, .text-gray-600 {
  color: #718096;
}

/* Stacks the title and freshness badge; .logo-container is a flex row. */
.logo-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-right: 40px;
}
.logo-text .title {
    margin-right: 0;
}
/* Badge and age chip share one row beneath the title. Spacing lives here rather
   than on the chips: either can hide independently, and a margin on a hidden
   chip would leave a phantom space in the row. */
.status-row {
    display: flex;
    align-items: center;
    margin-top: 3px;
}
.data-freshness {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    padding: 2px 8px;
    border: none;
    /* Own chip background so the state colours meet contrast against both the
       light (#2b6cb0) and dark header backgrounds with one colour set. */
    background: rgba(0, 0, 0, 0.28);
    cursor: default;
}
.data-freshness--current { color: #4ade80; }
.data-freshness--unknown { color: #d1d5db; }
.data-freshness--stale {
    color: #fbbf24;
    cursor: pointer;
    text-decoration: underline;
}

/* Data age chip — sits beside the freshness badge, smaller so the badge reads
   first. Needs its own chip background: without it the text would render
   directly on the blue header, where these colours measure only 3.2-3.7:1.
   With the chip they clear 4.5:1 in both themes. */
.data-age {
    font-size: 11px;
    font-weight: 500;
    line-height: 1.2;
    padding: 2px 8px;
    background: rgba(0, 0, 0, 0.28);
}
.data-age--recent { color: #d1d5db; }
.data-age--aged { color: #fbbf24; font-weight: 600; }
/* ---------------------------------------------------------------------------
   Password show/hide toggle (public/js/password-toggle.js)
   Wrapper is position:relative so the button can sit inside the field's
   right-hand padding without affecting layout.
   --------------------------------------------------------------------------- */
.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrapper input {
  width: 100%;
  padding-right: 44px;
}

.password-toggle {
  position: absolute;
  right: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 6px;
  background: none;
  border: none;
  border-radius: 4px;
  color: #4b5563;
  cursor: pointer;
  opacity: 0.65;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.password-toggle:hover {
  opacity: 1;
}

/* Visible focus ring for keyboard users - the button is a real tab stop. */
.password-toggle:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
  opacity: 1;
}

.dark .password-toggle {
  color: #d1d5db;
}

.dark .password-toggle:focus-visible {
  outline-color: #60a5fa;
}

.password-hint {
  display: block;
  margin-top: 4px;
  font-size: 0.75rem;
  color: #6b7280;
}

.dark .password-hint {
  color: #9ca3af;
}
