/* All */
body {
  margin: 1;
  font-family: Helvetica, Arial, sans-serif;
}

a {
  color: #008080; /* base teal */
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #00a6a6; /* brighter teal on hover */
  text-decoration: underline;
}

a:visited {
  color: #006666; /* slightly muted for visited */
}


h2 {
  color: #1a4d80; /* Businessy deep blue */
  font-size: 1.8em;
  margin: 0;
}

/* header */
#header {
  display: flex;
  align-items: center; /* vertically center the image and text */
  gap: 10px; /* space between image and text */
  margin-left:10%;
}

#welcome-or-login {
  font-size: 0.8em;
  margin-left: auto;
  margin-right: 20px;
  margin-top:16px;
  text-align: right;
  color: #999;
  font-family: Calibri, 'Gill Sans', 'Gill Sans MT', 'Trebuchet MS', sans-serif;
}

.text-success {
	color:#2ecc71;
}

.text-info {
  color:#3498db;
}

.text-warning {
	color:#f39c12;
}

.text-danger {
  color:#e74c3c;
}

@keyframes glow {
  0%, 100% {
    text-shadow: 0 0 5px #e74c3c, 0 0 10px #e74c3c, 0 0 20px #e74c3c;
  }
  50% {
    text-shadow: 0 0 15px #e74c3c, 0 0 30px #e74c3c, 0 0 45px #e74c3c;
  }
}

.glow {
  animation: glow 1.5s infinite alternate;
}


@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.spin {
  animation: spin 2s linear infinite; /* Spins continuously every 2 seconds */
}

@keyframes typing {
  to { width: 100%; }
}

@keyframes wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(5deg); }
  75% { transform: rotate(-5deg); }
}

#header h1 {
  font-size: 2.2em;
  color: #1a4d80; /* Businessy deep blue */
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid #1a4d80;
  width: 0;
  animation: typing 2.5s steps(30, end) forwards;

  text-shadow:
    1px 1px 0 #ffffff,
    2px 2px 0 #cce0ff,
    3px 3px 0 #99c2ff;
}

#header img {
  width: 57px;
  height: 57px;
  border-radius: 8px;
  box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.15);
}

.wiggle {
  animation: wiggle 0.4s ease-in-out;
}

/*main*/
#main {
	width:100%;
	border:none;
}

h3
{
	color:#336699;
	margin:4px;
}

/* Stock Blocks */

.rsi-filter-btn {
  background: #f0f0f0;
  border: 1px solid #ccc;
  padding: 0.4rem 0.6rem;
  margin: 0 0.2rem;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1.2em;
  position: relative;
}


.rsi-filter-btn .badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background-color: #3498db; /* same as .text-info */
  color: white;
  border-radius: 50%;
  padding: 2px 6px;
  font-size: 0.7em;
  font-weight: bold;
  line-height: 1;
  min-width: 6px;
  min-height: 14px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

.rsi-filter-btn.active {
  background: #cce0ff;
  border-color: #1a4d80;
}

#stock-blocks {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.data-block-title
{
  cursor: pointer;
}

.data-block{
	font-size: 0.9em;
	color:#666666;
	padding:12px;
}

.data-block .label {
	font-weight:bold;
}

.stock-links {
	font-size:0.7em;
  text-align: center;
  width: 100%;
}
.stock-detail .stock-button {
  background-color: #3498db; /* same as .text-info */
  color: white;
  padding: 6px 12px;
  width:66px;
  margin: 4px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 1em;
  transition: background-color 0.2s ease;
  display: inline-block;
  white-space: normal;
  word-wrap: break-word;
  text-align: center;
}

.data-block .higher-pe {
	color:#ff0000;
}

.data-block .lower-pe {
	color:#0b6623;
}

.stock-block {
  flex: 1 1 16%;
  max-width: 320px;
  min-width: 320px;
  height: 340px;
  margin: 10px;
  padding: 12px;

  text-align: center;
  font-size: 1.0em;
  border-radius: 8px;

  background-color: #fff;
  box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.1); /* subtle right & bottom shadow */
  border: 1px solid #e0e0e0; /* clean border */
  transition: box-shadow 0.2s ease;
}

.stock-block:hover {
  box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.15); /* slight lift on hover */
}


.stock-blockx {
	border: dotted;
	
	flex: 1 1 16%;
	max-width: 320px;
	min-width: 320px;
	height: 340px;
	margin: 10px;
  	padding: 4px;

  	text-align: center;
  	font-size: 1.0em;
  	border-radius: 8px;
}



/* Footer */
#footer{
	margin:12px;
	text-align:center;
	font-size:0.8em;
}

#last-updated
{
	color:#cccccc;
	font-style:italic;
}

/* detail page */
.widget-holder .target-price {
  margin-top: 20px;
}
.fundamentals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 20px;
}
.fundamental-item {
  padding: 8px;
  background-color: #f9f9f9;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.widget-holder {
  background-color: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 12px;
  margin: 10px auto;
  max-width: 320px;
  min-width: 320px;
  height: 340px;
  box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
}

.widget-holder:hover {
  box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.15);
}

/* Layout widgets in a row on desktop */
#widgets-div {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

/* Textbook-style info box for .description */
.description {
  margin: 20px 0;
  padding: 1rem 1.25rem 1rem 80px;
  font-family: "Georgia", serif;
  font-size: 1.1em;
  line-height: 1.5;
  color: #444;
  background-color: #fefefe;
  border-left: 6px solid #1a4d80;
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  position: relative;
}

.description::before {
  content: "📘";
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  font-size: 48px;
  height: 60px;
  line-height: 60px;
}

/* Responsive Info Boxes */
.info-container {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.info-box {
  flex: 1 1 250px;
  min-width: 250px;
  /* Revert to previous: remove any new styling changes */
  background-color: #f5f5f5;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.chart-container {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.chart-container canvas {
  width: 100% !important;
  height: auto !important;
  max-width: 100%;
  display: block;
}

.stock-links-div {
  display: flex;
  flex-flow: row wrap;
  align-items: flex-start;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
  width:100%;
}

#rsi-filters {
  display: flex;
}
.header-box h3 {
  text-align: center;
}
.header-box {
  background-color: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid #d0d0d0;
  border-radius: 12px;
  padding: 10px 16px;
  margin: 1.5rem auto;
  max-width: 420px;
  justify-content: center;
  gap: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

#rsi-filters .rsi-filter-btn {
  background: #e0e0e0;
  border: 1px solid #b0b0b0;
  color: #333;
  padding: 0.5rem 0.8rem;
  font-size: 1.1em;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

#rsi-filters .rsi-filter-btn:hover {
  background: #d8d8d8;
  border-color: #999;
}

#rsi-filters .rsi-filter-btn.active {
  background: #007aff;
  color: #fff;
  border-color: #007aff;
}

/* Add to Homescreen for Android */
#a2hs-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #007aff;
  color: white;
  padding: 10px 14px;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  z-index: 1000;
}

/*pop up help box*/
.help-popup {
  background: #ffffff;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  max-width: 360px;
  padding: 12px;
  font-size: 0.95em;
  line-height: 1.4;
}

.help-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.help-popup-title {
  font-weight: bold;
  color: #1a4d80;
  text-decoration: none;
}

.help-popup-title:hover {
  text-decoration: underline;
}

.help-popup-close {
  background: none;
  border: none;
  font-size: 1.2em;
  color: #888;
  cursor: pointer;
}

.help-popup-close:hover {
  color: #000;
}

.help-popup-body {
  color: #333;
}

.help-link {
  cursor: pointer;
  position: relative;
}

.help-link::after {
  content: " \f059"; /* Font Awesome: question-circle */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  margin-left: 0px;
  font-size: 0.85em;
  color:#3498db;
}