/* Import base styles */
@import url('index.css');

/* Crypto specific styles */
/* Crypto Converter Styles */
.crypto-converter {
  max-width: 600px;
  width: 100%;
  margin: 0;
}

.conversion-table {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-start;
  width: 100%;
  padding: 0 1rem;
  background-color: var(--card-bg-middle);
}

.conversion-column {
  flex: 1;
  max-width: 250px;
}

.conversion-column label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-light);
  font-weight: 500;
}

.conversion-column input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
  margin-bottom: 0.5rem;
  box-sizing: border-box;
  height: 40px;
  background-color: var(--card-bg-middle);
  color: var(--text-light);
}

.crypto-list {
  max-height: 425px;
  overflow-y: auto;
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: var(--card-bg-middle);
  scrollbar-width: thin;
}

.crypto-list::-webkit-scrollbar {
  width: 6px;
}

.crypto-list::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.crypto-list::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 3px;
}

.crypto-list div {
  padding: 0.75rem;
  cursor: pointer;
  transition: background-color 0.2s;
  border: 1px solid var(--blue-light);
  color: var(--text-light);
}

.crypto-list div:hover {
  background-color: var(--bg-blue-dark);
}

.crypto-list div.selected {
  background-color: var(--blue-light);
  color: var(--text-light);
}

.crypto-list .symbol {
  display: none;
}

#cryptoResult {
  text-align: center;
  margin-top: 1rem;
  color: #333;
  font-weight: 500;
  display: none;
}

/* Add specific styling for the "To" crypto list */
#cryptoToList {
  width: 350px;
}

/* Override the default max-width for the "To" column */
.conversion-column:last-child {
  max-width: 350px;
}

/* Crypto Content Layout */
.crypto-content-layout {
  display: flex;
  gap: 2rem;
  width: 100%;
  align-items: flex-start;
}

/* Styles for the CoinGecko crypto dashboard */
.crypto-dashboard {
  background-color: var(--card-bg-middle);
  color: var(--text-light);
  padding: 1rem;
  border-radius: 10px;
  width: 100%;
  max-width: 600px;
  margin: 1rem auto 1rem 1rem; /* Adjusted margin to move it a tiny bit to the right */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  max-height: 450px; /* Adjust height to show up to number 7 */
  overflow-y: auto; /* Keep vertical scrollbar */
  overflow-x: hidden; /* Remove horizontal scrollbar */
}

.crypto-dashboard img {
  vertical-align: middle;
  margin-right: 8px;
  width: 25px;
  height: 25px;
}

.crypto-dashboard h2 {
  text-align: center;
  margin-bottom: 1rem;
}

.crypto-dashboard h3 {
  text-align: center;
  margin-bottom: 1rem;
}

.crypto-dashboard table {
  width: 100%;
  border-collapse: collapse;
}

.crypto-dashboard th,
.crypto-dashboard td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--blue-light);
}

.crypto-dashboard th {
  background-color: var(--bg-blue-dark);
}

.crypto-dashboard tr:hover {
  background: rgba(0, 136, 255, 0.1);
}

.crypto-dashboard td.positive {
  color: #4caf50;
}

.crypto-dashboard td.negative {
  color: #f44336;
}

/* Fix text color for crypto welcome text */
.crypto-welcome-text,
.crypto-content-layout p,
.crypto-converter > p,
main p,
.mobi p {
  color: var(--text-light) !important;
  font-size: 1rem;
  line-height: 1.6;
  margin: 1rem 0;
}

/* Ensure all headings on crypto page are properly colored */
.crypto-content-layout h1,
.crypto-content-layout h2,
.crypto-content-layout h3,
.crypto-content-layout h4,
.crypto-converter h2,
.crypto-converter h3,
.crypto-converter h4 {
  color: var(--text-light) !important;
}

/* Additional fix for any text elements not caught by the above selectors */
body.crypto-page .content-wrapper * {
  color: var(--text-light);
}

/* Ensure welcome-text is responsive */
.welcome-text.deskt {
  display: block; /* Ensure it is visible */
  padding: 1rem;
  font-size: 1rem; /* Adjust font size for smaller screens */
}

@media (max-width: 768px) {
  .welcome-text.deskt {
    font-size: 0.9rem; /* Smaller font size for mobile */
    text-align: center; /* Center-align text for better readability */
  }
}

/* Responsive styles for crypto page */
@media (max-width: 1024px) {
  .crypto-content-layout {
    flex-direction: column;
    gap: 1rem;
  }
}

@media (max-width: 600px) {
  .crypto-converter {
    max-width: 100%;
    padding: 0 10px;
  }

  .conversion-table {
    padding-left: 0;
    justify-content: space-between;
  }

  .conversion-column {
    flex: 0 1 48%;
    max-width: 48%;
    min-width: 0;
  }

  .conversion-column:last-child {
    max-width: 48%;
  }

  #cryptoToList {
    width: 100%;
  }

  .crypto-list div {
    padding: 0.5rem;
    font-size: 0.9rem;
  }
}

/* Fix for text color on mobile specific */
@media (max-width: 767px) {
  .crypto-content-layout p,
  .crypto-converter p,
  .crypto-welcome-text,
  main p,
  .mobi p,
  .crypto-page p {
    color: var(--text-light) !important;
  }
  
  /* Force all text elements inside crypto page to be light colored */
  body.crypto-page * {
    color: var(--text-light) !important;
  }
  
  /* Only exception is for specific elements like positive/negative values */
  .crypto-dashboard td.positive {
    color: #4caf50 !important;
  }
  
  .crypto-dashboard td.negative {
    color: #f44336 !important;
  }
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
}

.content-wrapper {
  flex: 1;
}

/* Update footer styling to match other pages */
footer {
  background-color: var(--card-bg-middle); /* Use theme variable instead of hardcoded #333 */
  color: var(--text-light); /* Use theme variable instead of hardcoded #fff */
  text-align: center;
  padding: 1rem;
  position: relative;
  bottom: 0;
  width: 100%;
}

/* Ensure all footer text and links match the theme */
footer p,
footer a {
  color: var(--text-light);
  margin: 0;
}

footer a {
  text-decoration: none;
}

footer a:hover,
footer a:focus {
  text-decoration: underline;
}
