/* Custom CSS goes here */

/* Dashboard cards */
dashboard-card {
    border: 1px solid var(--color-bg-secondary);
    border-radius: var(--border-radius, 5px);
    box-shadow: var(--box-shadow, 2px 2px 10px) var(--color-shadow, #f4f4f4);
    margin: 0.25rem;
    padding: 1.25rem;
    display: block;
}

/* Large numbers */
dashboard-number {
    display: block;
    font-size: 2.5rem;
    font-weight: bold;
    line-height: 1.2;
    margin: 0.5rem 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#liquidation-hf[data-state="safe"],
#burn-redeem-preview-new-hf[data-state="safe"],
#deposit-mint-preview-new-hf[data-state="safe"],
dashboard-number.health-factor[data-state="safe"] {
    color: #2e7d32; /* green */
}

dashboard-number.health-factor[data-state="warning"] {
    color: #f57c00; /* orange */
}

#liquidation-hf[data-state="alert"],
#burn-redeem-preview-new-hf[data-state="alert"],
#deposit-mint-preview-new-hf[data-state="alert"],
dashboard-number.health-factor[data-state="alert"] {
    color: #c62828; /* red */
}

dashboard-number.health-factor[data-state="unknown"] {
    color: #999;
}


/* columns containing dashboard numbers should not grow with content*/
ms-column:has(dashboard-number) {
    min-width: 0;
}


/* Responsive table */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.table-responsive table {
    width: 100%;
    display: table; /* reset mvp inline-block */
    white-space: nowrap;
}

header {
    text-align: left;
}

header > nav {
    margin-bottom: 0;
}

/* Stretch all buttons that are direct ms-column children */
ms-column:has(> button) {
  display: flex;
  flex-direction: column;
}
ms-column > button {
  flex: 1;
}


/* Connect wallet button in mobile screen */
@media (max-width: 576px) {
    #connect-wallet-button {
	width: 100%;
    }
}

/* Logo image */
header nav img {
    margin: 1rem 1rem;
}


a:visited {
    color: var(--color-link);
}

/* status message */
status-message {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  max-width: 90%;
  width: max-content;
  padding: 1rem;
  border-radius: var(--border-radius);
  font-weight: bold;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
status-message.error {
  background: #ffe6e6;
  color: #cc0000;
  border: 1px solid #cc0000;
}
status-message.success {
  background: #e6ffe6;
  color: #006600;
  border: 1px solid #006600;
}

/* Error state for address input */
.input-error {
    border-color: #c62828;
}
