/* c0932560 Gurpreet Singh */
/* Theme Variables */
:root {
  --bg: #f5f6fa;
  --text: #111;
  --card: #ffffff;
  --primary: #2c3e50;
}

/* Dark Mode Overrides */
body.dark {
  --bg: #121212;
  --text: #f9f9f9;
  --card: #1f1f1f;
}

/* Base Styles */
body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background 0.3s, color 0.3s;
}

/* Main Content Layout */
.container {
  margin-right: 360px; /* space for tray */
  padding: 30px;
}

/* Comparison Tray */
#compare-tray {
  position: fixed;
  top: 0;
  right: 0;
  width: 360px;
  height: 100vh;
  background-color: #f4f1ea;
  color: #222;
  padding: 10px;
  overflow-y: auto;
  z-index: 999;
  box-shadow: -4px 0 10px rgba(0, 0, 0, 0.1);
}

/* Header Section */
.main-header {
  text-align: center;
  margin-bottom: 20px;
}

.header-logo {
  width: 150px;
  height: 150px;
  display: block;
  margin: 0 auto 10px;
}

/* Search, Sort, Theme Controls */
.controls {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 15px;
}

input, select, button {
  padding: 10px;
  font-size: 1rem;
  border-radius: 8px;
  border: 1px solid #ccc;
}

/* Crypto Cards Grid */
.coin-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 20px;
}

/* Individual Crypto Card */
.coin-card {
  background: var(--card);
  border-radius: 12px;
  padding: 10px;
  width: 220px;
  min-height: 170px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
}

.coin-card:hover {
  transform: scale(1.05);
}

/* Compare Button Styles */
.compare-btn {
  background-color: var(--primary);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: bold;
  margin-top: 10px;
  transition: 0.3s;
}

.compare-btn.added {
  background-color: #27ae60;
}

.compare-btn.removed {
  background-color: #7f8c8d;
}

.compare-btn:hover {
  opacity: 0.85;
}

/* Coin Icon */
.coin-icon {
  width: 36px;
  height: 36px;
  margin-bottom: 8px;
}

/* Tray Header */
.tray-header {
  position: relative;
  padding: 10px;
  text-align: center;
}

/* Clear Button */
#clear-btn {
  position: absolute;
  top: 6px;
  right: 8px;
  background-color: #ff4d4d;
  color: white;
  font-size: 11px;
  border: none;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
}

/* Comparison Grid Layout */
.compare-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

/* Stylish Comparison Cells */
.compare-grid .coin-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  background-color: #fff;
  color: #000;
  border-radius: 12px;
  padding: 12px 16px;
  height: auto;
  min-height: 75px;
  width: 95%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  font-size: 0.9rem;
  position: relative;
  gap: 12px;
}

/* Comparison Cell Icon */
.compare-grid .coin-card img {
  width: 30px;
  height: 30px;
}

/* Comparison Cell Info */
.compare-grid .coin-card .info {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.compare-grid .coin-card .info .name {
  font-weight: bold;
  font-size: 1rem;
}

.compare-grid .coin-card .info .symbol {
  font-size: 0.85rem;
  color: #555;
}

.compare-grid .coin-card .info .market-cap {
  font-size: 0.8rem;
  color: #777;
}

.compare-grid .coin-card .price {
  font-size: 1rem;
  font-weight: bold;
}

.compare-grid .coin-card .change {
  font-size: 0.85rem;
  font-weight: 600;
}

/* Remove Button (X) */
.remove-x {
  position: absolute;
  top: 6px;
  right: 6px;
  background: #f44336;
  color: white;
  border: none;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Footer */
#footer {
  margin-top: 50px;
  padding: 20px;
  text-align: center;
  font-size: 0.9rem;
  color: #444;
  background: #f0f2f5;
  border-top: 1px solid #ccc;
}

#footer a {
  color: var(--primary);
  font-weight: bold;
}
