@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

/* ===== HEADER (unchanged from index.html/style.css) ===== */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 10;
  height: 57px;
  padding-top: 20px;
}

.logo {
  font-size: 24px;
  font-family: "Inter", sans-serif;
  color: #fff;
  font-weight: 700;
  letter-spacing: 1px;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  margin-right: 40px;
}

.nav-links a {
  text-decoration: none;
  color: #fff;
  font-weight: 10;
  font-size: 16.7px;
  font-family: "Inter", sans-serif;
  transition: color 0.3s ease;
}

.nav-links a:hover {
  color: #00b4d8;
}

.auth-buttons {
  margin-right: 63px;
  display: flex;
  gap: 13px;
}

.auth-buttons button {
  padding: 0.8rem 2rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.auth-buttons button.login {
  background: #fff;
  color: #0f2027;
}

.auth-buttons button.signup {
  background: #fff;
  color: #0f2027;
}

.auth-buttons button:hover {
  transform: scale(1.05);
}

#user-menu {
  margin-right: 63px;
  display: flex;
  gap: 13px;
  align-items: center;
}

#user-menu button {
  padding: 0.8rem 2rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

#user-menu button:hover {
  transform: scale(1.05);
  background: #d93636;
}

/* ===== GENERAL STYLING ===== */
body {
  font-family: 'Inter', sans-serif;
  background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
  color: #fff;
  margin: 0;
  padding-top: 90px;
}

.page-wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px;
}

/* ===== LAYOUT ===== */
#toprow {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 30px;
  flex-wrap: wrap;
  margin-top: 20px;
}

/* ===== CONTROL PANEL ===== */
#controls {
  background: #bac0c2;
  color: #111;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
  width: 420px;
  text-align: center;
  min-height: 330px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#controls:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

#controls input {
  width: 80%;
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  margin-bottom: 10px;
  font-family: inherit;
  font-size: 15px;
}

.specialbutton, #buy, #sell {
  border: none;
  border-radius: 10px;
  width: 100px;
  height: 40px;
  background-color: #203a43;
  color: #fff; 
  transition: all 0.2s ease-in-out;
}

.specialbutton:hover, #buy:hover, #sell:hover {
  background-color: #445d65;
  cursor: pointer;
  transform: scale(1.05);
}

.specialbutton:active, #buy:active, #sell:active {
  background-color: #74878e;
}

#controls button {
  margin-top: 5px;
  position: relative;
}

#time-range button {
  margin-top: 30px;
}

/* Container where stock info is shown */
#stock-info {
  margin-top: 16px;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.4;
}

/* Optional: make the price text slightly smaller */
#stock-info .price-line {
  font-size: 18px;
  font-weight: 500;
  margin-top: 6px;
  display: block;
}

#controls-btns {
  margin-top: 10px;
  display: flex;
  justify-content: center;
  gap: 10px;
  align-items: center;
}

/* ===== CHART AREA ===== */
#chart-container {
  background: #bac0c2;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
  width: 700px;
  height: 430px;
  color: #111;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== CHAT PANEL ===== */
#chat-panel {
  background: #bac0c2;
  border-radius: 12px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
  width: 420px;
  padding: 20px;
  color: #111;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#chat-panel:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

#chat-panel h3 {
  margin-top: 0;
  color: #203a43;
  font-weight: 600;
}

#chat-messages {
  flex-grow: 1;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  padding: 10px;
  overflow-y: auto;
  margin-bottom: 10px;
}

#chat-panel input {
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
}

#chat-panel button {
  background: #203a43;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  cursor: pointer;
  transition: background 0.2s;
}

#chat-panel button:hover {
  background: #445d65;
}

/* ===== PORTFOLIO SECTION (FULL NEW VERSION) ===== */

#portfolio-section {
  background: #d2d7da;
  border-radius: 14px;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.12);
  max-width: 1000px;
  margin: 60px auto 40px;
  padding: 32px;
  color: #111;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#portfolio-section:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.18);
}

#portfolio-section h2 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #203a43;
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 22px;
}

#portfolio-section button {
  background: #203a43;
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

#portfolio-section button:hover {
  background: #485e65;
}

/* Portfolio card container */
.portfolio {
  background: #eef1f3;
  border-radius: 12px;
  padding: 18px 20px;
  margin-top: 15px;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.portfolio:hover {
  transform: translateY(-3px);
  box-shadow: 0 7px 22px rgba(0,0,0,0.12);
}

/* Portfolio card heading row */
.portfolio-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 6px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.portfolio button {
  background: #ff4d4d;
  border: none;
  padding: 7px 14px;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s;
}

.portfolio button:hover {
  background: #d93636;
}

/* ===== IMPROVED PORTFOLIO TABLE ===== */

.stock-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 15px;
  color: #111;
  background: #eef1f3;
  border-radius: 10px;
  overflow: hidden;
}

/* Header */
.stock-table th {
  background: #203a43;
  color: #fff;
  padding: 12px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 15px;
  border-bottom: 2px solid #16272e;
  cursor: pointer;
}

/* Table cells */
.stock-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  background: #f8fafc;
}

/* Alternating rows */
.stock-table tr:nth-child(even) td {
  background: #f0f3f6;
}

/* Hover highlight */
.stock-table tr:hover td {
  background: #e5eaef;
  cursor: pointer;
}

/* Remove last border */
.stock-table tr:last-child td {
  border-bottom: none;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 980px) {
  #toprow {
    flex-direction: column;
    align-items: center;
  }

  #controls, #chat-panel, #chart-container {
    width: 90%;
  }

  #portfolio-section {
    width: 90%;
  }
}
