/* =============================================================================
   BTC TIME SERVICE - MASTER STYLESHEET v0.0.19
   Unified CSS for: Time Display + FAQ + Legals + Donate Pages
   Theme: Green Terminal / CRT Scanline Aesthetic
   ============================================================================= */

/* --- RESET & BASE --- */
* { 
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
}

body { 
  font-family: 'Courier New', Courier, monospace; 
  background: #0a0a0a; 
  color: #00ff88; 
  margin: 0; 
  padding: 20px; 
  line-height: 1.6; 
  position: relative;
  min-height: 100vh;
}

/* CRT Scanline Effect Overlay */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0, 255, 136, 0.02) 50%,
    transparent 100%
  );
  background-size: 100% 4px;
}

/* Subtle Vignette */
body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9998;
  background: radial-gradient(ellipse at center, transparent 0%, rgba(0,0,0,0.4) 100%);
}

/* --- BACKGROUND GRADIENTS --- */
body {
  background-image: 
    radial-gradient(ellipse at 20% 80%, rgba(0, 255, 136, 0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(255, 215, 0, 0.02) 0%, transparent 50%);
}

/* --- MAIN CONTAINER (Time Page) --- */
.container.time-page {
  max-width: 700px;
  width: 100%;
  border: 1px solid #00ff88;
  padding: 20px;
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.1), 0 0 40px rgba(0, 255, 136, 0.05);
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(5px);
}

/* --- STATIC PAGE CONTAINER (FAQ, Legals, Donate) --- */
.container.static-page {
  max-width: 800px;
  margin: 0 auto;
  border: 1px solid #00ff88;
  padding: 30px;
  box-shadow: 0 0 15px rgba(0, 255, 136, 0.2);
  background: rgba(10, 10, 10, 0.9);
}

/* --- NAVIGATION --- */
nav {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin: 15px 0;
  padding: 10px 0;
  border-top: 1px dashed #004422;
  border-bottom: 1px dashed #004422;
}

nav a {
  color: #fff;
  text-decoration: none;
  padding: 4px 12px;
  border: 1px solid #00ff88;
  font-size: 0.85em;
  transition: all 0.2s;
  background: rgba(0, 255, 136, 0.05);
}

nav a:hover {
  background: #00ff88;
  color: #000;
  box-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

nav a[target="_blank"]::after {
  content: " ↗";
  font-size: 0.7em;
}

/* --- FOOTER LINKS --- */
.nav-links, .links {
  margin-top: 20px;
  text-align: center;
}

.nav-links a, .links a {
  color: #00ff88;
  text-decoration: none;
  margin: 0 10px;
  transition: color 0.2s;
  padding: 2px 5px;
  border-radius: 3px;
}

.nav-links a:hover, .links a:hover {
  text-decoration: underline;
  color: #fff;
  background: rgba(0, 255, 136, 0.1);
}

/* --- HEADINGS --- */
h1, h2, h3 {
  color: #fff;
  border-bottom: 1px solid #004422;
  padding-bottom: 10px;
}

h1 {
  text-align: center;
  margin-bottom: 30px;
  font-size: 2.2em;
  letter-spacing: 1px;
}

h2 {
  color: #ffd700;
  margin-top: 30px;
  font-size: 1.5em;
}

h3 {
  color: #00ff88;
  margin-top: 20px;
  font-size: 1.2em;
}

/* --- TIME PAGE ELEMENTS --- */
.iso-line {
  text-align: center;
  color: #666;
  font-size: 0.9em;
  margin-bottom: 10px;
}

.box {
  border: 1px solid #00ff88;
  padding: 15px;
  margin: 10px 0;
  background: rgba(0, 255, 136, 0.03);
  transition: border-color 0.3s, background 0.3s;
}

.box:hover {
  border-color: #00ff88;
  background: rgba(0, 255, 136, 0.06);
}

.label {
  color: #888;
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 5px;
  display: block;
}

/* PRICE COLOR CLASSES (Green/Red/Yellow) */
.price {
  font-size: 1.8em;
  font-weight: bold;
  text-align: center;
  margin: 10px 0;
  transition: color 0.5s, text-shadow 0.5s;
}

.price-green { 
  color: #00ff88; 
  text-shadow: 0 0 10px rgba(0, 255, 136, 0.3); 
}

.price-red { 
  color: #ff4444; 
  text-shadow: 0 0 10px rgba(255, 68, 68, 0.3); 
}

.price-yellow { 
  color: #ffd700; 
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.3); 
}

.trend-indicator {
  text-align: center;
  font-size: 0.85em;
  margin-top: -5px;
  margin-bottom: 5px;
  color: #888;
}

.data-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.data-item {
  border-top: 1px solid #222;
  padding-top: 5px;
  font-size: 0.9em;
}

/* --- SVG CHART STYLING --- */
.chart-container {
  border: 1px solid #00ff88;
  padding: 15px;
  margin: 10px 0;
  background: rgba(0, 255, 136, 0.03);
  overflow-x: auto; /* Allows scrolling if too wide */
  max-width: 100%;  /* Prevents overflow */
}

svg {
  width: 100%;      /* Scale to container */
  height: auto;     /* Maintain aspect ratio */
  max-height: 300px; /* Optional: Limit height */
  display: block;
}

/* --- OHLC TABLE --- */
.ohlc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8em;
  margin-top: 10px;
}

.ohlc-table th {
  color: #888;
  text-align: left;
  padding: 4px 8px;
  border-bottom: 1px solid #333;
}

.ohlc-table td {
  padding: 4px 8px;
  border-bottom: 1px solid #111;
  color: #ccc;
}

.ohlc-table tr:hover td {
  background: rgba(0, 255, 136, 0.05);
}

/* --- STATIC PAGE CONTENT (FAQ, Legals, Donate) --- */
p {
  margin-bottom: 15px;
  color: #ccc;
}

.highlight {
  color: #00ff88;
  font-weight: bold;
}

ul {
  list-style-type: square;
  padding-left: 20px;
  margin-bottom: 15px;
}

li {
  margin-bottom: 8px;
  color: #ccc;
}

ul li::marker {
  color: #00ff88;
}

.warning {
  color: #ff4444;
  border: 1px solid #ff4444;
  padding: 10px;
  margin: 15px 0;
  background: rgba(255, 68, 68, 0.05);
  border-radius: 4px;
}

.donate-address {
  font-family: monospace;
  background: #111;
  padding: 10px;
  border-radius: 4px;
  word-break: break-all;
  color: #ffd700;
}

/* --- FOOTER --- */
footer {
  margin-top: 30px;
  text-align: center;
  color: #555;
  font-size: 0.8em;
  border-top: 1px solid #222;
  padding-top: 15px;
}

.utc_time_static {
  color: #fff;
  font-size: 1.1em;
  margin-top: 10px;
}

/* --- ANIMATIONS --- */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
}

.live-pulse {
  animation: pulse 2s ease-in-out infinite;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fadeIn 0.5s ease-out;
}

/* --- RESPONSIVE DESIGN --- */
@media screen and (max-width: 600px) {
  body {
    padding: 10px;
  }
  
  .container.time-page,
  .container.static-page {
    padding: 15px;
  }
  
  h1 {
    font-size: 1.6em;
  }
  
  .price {
    font-size: 1.4em;
  }
  
  nav {
    gap: 8px;
    flex-wrap: wrap;
  }
  
  nav a {
    padding: 3px 8px;
    font-size: 0.75em;
  }
  
  .data-grid {
    grid-template-columns: 1fr;
  }
  
  .nav-links a,
  .links a {
    display: block;
    margin: 5px 0;
  }
}

/* --- PRINT STYLES --- */
@media print {
  body::before,
  body::after {
    display: none;
  }
  
  .container {
    box-shadow: none;
    border: 1px solid #000;
  }
  
  nav, footer {
    display: none;
  }
}
