
:root {
  --bg-color: #ffffff;
  --text-color: #111827;
  --header-border: rgb(201, 201, 201);
  --card-border: rgb(201, 201, 201);
  --table-outer-border: rgb(161, 160, 160);
  --table-inner-border: #e5e7eb;
  --muted-text: #6b7280;

  --btn-bg: transparent;
  --btn-border: transparent;
  --btn-hover: #f3f4f6;

  /* NEW: Search Bar Colors (Light Mode) */
  --input-bg: #ffffff;
  --input-border: rgb(201, 201, 201);
  --input-text: #111827;
}

body.dark-mode {
  --bg-color: #111827;
  --text-color: #f9fafb;
  --header-border: #374151;

  --card-border: #60a5fa;
  --table-outer-border: #60a5fa;
  --btn-border: #60a5fa;

  --table-inner-border: #60a5fa;
  --muted-text: #9ca3af;

  --btn-bg: #1f2937;
  --btn-hover: #374151;

  /* NEW: Search Bar Colors (Dark Mode) */
  --input-bg: #1f2937;
  --input-border: #374151; 
  --input-text: #f9fafb; 
}

body {
  font-family: "Inter Tight", sans-serif;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;

  background-color: var(--bg-color);
  color: var(--text-color);

  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

a {
  text-decoration: none;
  color: inherit;
}

/* Header & Nav */
.projectName {
  display: flex;
  gap: 20px;
  justify-content: space-between;
  align-items: center;
  border-style: solid;
  border-width: 1px;
  margin: -8px;
  margin-bottom: 15px;
  padding: 3px;


  border-color: var(--header-border);
}


  .nav-left nav {
    display: block; 
    width: 100%;
    margin-top: 10px;
  }

  .nav-left ul {
    flex-direction: column;
    align-items: center; 
    gap: 15px;
    padding: 0;
  }

.nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.searchbtn {
  border-radius: 13px;
  height: 32px;
  margin-right: 10px;
  padding: 0 15px; /* Adds breathing room inside the box */

  /* Apply the variables */
  background-color: var(--input-bg);
  color: var(--input-text);
  border: 1px solid var(--input-border);
  outline: none; /* Removes the ugly default browser outline */

  transition:
    border-color 0.3s ease,
    background-color 0.3s ease,
    box-shadow 0.3s ease;
}

/* This triggers when the user clicks into the search bar! */
.searchbtn:focus {
  border-color: #60a5fa; /* Turns blue */
  box-shadow: 0 0 5px rgba(96, 165, 250, 0.4); /* Adds a subtle blue glow */
}

.trending-row {
  display: flex;
  gap: 20px;
  margin-bottom: 30px;
}

.trending-card {
  flex: 1;
  border-radius: 7px;
  padding: 20px;
  box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.04);

  /* Applied Variables */
  border: 1px solid var(--card-border);
  background-color: var(--bg-color);
  transition: border-color 0.3s ease; /* Smooth border color change */
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.card-header h4 {
  margin: 0;
  font-weight: 500;

  /* Applied Variable */
  color: var(--muted-text);
}

.trending-card .price {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;

  /* Applied Variable */
  color: var(--text-color);
}

.tablecontainer {
  width: 100%; /* Ensures the box doesn't push past the screen */
  overflow-x: auto; /* This is the magic command that creates the horizontal scrollbar! */
  -webkit-overflow-scrolling: touch; /* Adds smooth momentum scrolling on mobile */

  /* Keep your existing border and shadow rules here... */
  border: 1px solid var(--table-outer-border);
  border-radius: 7px;
  box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.04);
}

.cryptotable {
  width: 100%;
  min-width: 600px; /* Forces the table to stay at least 600px wide, triggering the scrollbar on smaller screens */
  border-collapse: collapse;
}

.cryptotable th,
.cryptotable td {
  padding: 12px 15px; /* Gave it a bit more breathing room */
  text-align: left;
  border-bottom: 1px solid var(--table-inner-border); /* Just a bottom border usually looks cleaner on mobile! */
  white-space: nowrap; /* Forces text to stay on one line */
}
/* Text Colors */
.text-green {
  color: #10b981;
  font-weight: 600;
  font-size: 0.9rem;
}

.text-red {
  color: #ef4444;
  font-weight: 600;
  font-size: 0.9rem; /* Added font size to match green */
}

/* =========================================
   5. DARK MODE TOGGLE BUTTON
   ========================================= */
.theme-btn {
  background-color: var(--btn-bg);
  color: var(--text-color);
  border: 1px solid var(--btn-border);
  padding: 6px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background-color 0.2s ease,
    border-color 0.3s ease;
}

.theme-btn:hover {
  background-color: var(--btn-hover);
}

/* Utility to hide the sun/moon icon */
.hidden {
  display: none;
}

/* This styles the container holding your logo and text */
.brand-name {
  display: flex;
  align-items: center;
  gap: 0px; /* Set to 0 because we will use negative margins to control spacing */
  font-weight: 700;
  font-size: 1.4rem; /* Slightly larger text to balance the bigger logo */
  text-decoration: none;
  color: inherit;
}

/* This targets the image itself */
.logo {
  /* 1. Make the invisible box massive, which forces the visible green circle to grow */
  width: 120px;
  height: auto;

  /* 2. Pull the whole logo to the left so it doesn't push the nav menu too far right */
  margin-left: -35px;

  /* 3. Pull the "CoinChecker" text firmly to the left, overlapping the invisible box */
  margin-right: -30px;

  /* 4. Reset the nudge to let flexbox center it naturally */
  transform: translateY(0px);
}

@media (max-width: 768px) {
  /* 1. Stack the main header items */
  .projectName {
    flex-direction: column;
    align-items: stretch;
    gap: 15px;
    padding: 15px;
  }

  /* 2. Hide the text links to save space (You can add a hamburger menu later!) */
  .nav-left nav {
    display: none;
  }

  /* 3. Center the brand name and logo */
  .brand-name {
    justify-content: center;
  }

  /* 4. Make the search bar and icons fit nicely */
  .nav-right {
    justify-content: space-between;
    width: 100%;
  }

  .searchbtn {
    width: 100%; /* Makes the search bar take up remaining space */
    margin: 0;
  }

  /* 5. Stack the crypto cards on top of each other */
  .trending-row {
    flex-direction: column;
    gap: 15px;
  }
}
.text-green {
  color: #10b981;
}

.text-red {
  color: #ef4444;
}
