/* Reset */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', sans-serif;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: #0b0b0b;
}

/* App Layout */
.app {
  position: relative;
  width: 380px;
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(16px);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 0 40px rgba(0,255,200,0.2);
  z-index: 10;
}

/* Nav Bar */
nav {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}
.nav-btn {
  flex: 1;
  background: rgba(255,255,255,0.08);
  border: none;
  border-radius: 8px;
  color: #fff;
  padding: 8px 0;
  margin: 0 2px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.nav-btn.active {
  background: rgba(0,255,200,0.25);
  box-shadow: 0 0 8px #00ffc6;
}

/* Buttons base ripple animation */
button {
  position: relative;
  overflow: hidden;
  transition: transform 0.1s ease, background 0.2s ease;
}
button:active {
  transform: scale(0.92);
  box-shadow: 0 0 15px rgba(0,255,200,0.6);
}
button::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 0; height: 0;
  background: rgba(255,255,255,0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width .3s ease, height .3s ease, opacity .5s ease;
  opacity: 0;
}
button:active::after {
  width: 200%;
  height: 200%;
  opacity: 0;
}

/* Ambient Background Canvas */
#ambient {
  position: fixed;
  top:0; left:0;
  width:100%; height:100%;
  z-index:-1;
}

/* Splash Screen */
#splash {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, #101010, #000);
  color: #00ffc6;
  font-family: 'Orbitron', sans-serif;
  font-size: 2rem;
  z-index: 9999;
  transition: opacity 1s ease;
}
#splash.hidden { opacity: 0; pointer-events: none; }
#splash .logo {
  width: 80px;
  margin-bottom: 10px;
  animation: spin 3s linear infinite;
}
@keyframes spin { from{transform:rotate(0)} to{transform:rotate(360deg)} }

/* Streak Counter */
#streak {
  position: fixed;
  bottom: 10px; right: 15px;
  background: rgba(0,255,200,0.15);
  padding: 6px 12px;
  border-radius: 12px;
  color: #00ffc6;
  font-family: 'Roboto Mono', monospace;
  font-size: 0.9rem;
}
/* --- Calculator Core Layout (Shared by All Modes) --- */

.calc {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.calc .display {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  color: #00ffc6;
  font-size: 2rem;
  text-align: right;
  padding: 16px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-family: "Roboto Mono", monospace;
  box-shadow: inset 0 0 10px rgba(0,255,200,0.15);
  overflow-x: auto;
}

.calc .buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  width: 100%;
}

.calc button {
  background: rgba(255,255,255,0.08);
  border: none;
  border-radius: 10px;
  padding: 18px;
  font-size: 1.2rem;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 600;
  letter-spacing: 0.5px;
  box-shadow: 0 0 10px rgba(0,255,200,0.1);
}

.calc button:hover {
  background: rgba(0,255,200,0.15);
  box-shadow: 0 0 15px rgba(0,255,200,0.4);
}

.calc button:active {
  transform: scale(0.95);
}

.calc button.operator {
  background: rgba(0,255,200,0.25);
  color: #00ffc6;
  box-shadow: 0 0 15px rgba(0,255,200,0.3);
}

.calc button.equal {
  background: #16c642;
  color: #fff;
  grid-column: span 2;
  box-shadow: 0 0 20px rgba(22,198,66,0.4);
}

.calc button.clear {
  background: #ff3b30;
  color: #fff;
  box-shadow: 0 0 20px rgba(255,59,48,0.3);
}

.calc button.function {
  background: rgba(255,255,255,0.1);
  color: #b7faff;
}

/* Programmer rows, converter fields, etc. */
.calc .extra {
  width: 100%;
  margin-top: 10px;
}

/* --- Dark Theme Date Calculator --- */
.date-calc {
  background: #1e1e1e;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 8px 20px rgba(0, 255, 200, 0.05);
  width: 340px;
  color: #eaeaea;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.date-calc h2 {
  background: #2b2b2b;
  color: #aefcae;
  font-size: 1.4rem;
  text-align: center;
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 10px;
  box-shadow: inset 0 0 5px rgba(0, 255, 180, 0.2);
}

.date-calc h3 {
  font-size: 1rem;
  color: #aefcae;
  margin-bottom: 8px;
}

.date-calc label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #ccc;
  font-size: 0.9rem;
}

.date-calc input[type="date"],
.date-calc input[type="number"] {
  background: #2b2b2b;
  color: #aefcae;
  border: 1px solid #3f3f3f;
  border-radius: 6px;
  padding: 10px;
  font-size: 1rem;
  transition: border 0.2s ease;
}

.date-calc input:focus {
  border-color: #16c642;
  outline: none;
}

.date-calc button {
  background-color: #16c642;
  color: white;
  border: none;
  padding: 10px;
  border-radius: 6px;
  font-weight: bold;
  width: 100%;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}

.date-calc button:hover {
  background-color: #13a73d;
  transform: translateY(-2px);
}

.date-calc #diffResult,
.date-calc #addResult {
  background: #2b2b2b;
  color: #aefcae;
  padding: 10px;
  border-radius: 6px;
  font-size: 0.9rem;
  margin-top: 8px;
  text-align: center;
  border: 1px solid #3f3f3f;
}

.date-calc hr {
  border: none;
  height: 1px;
  background: rgba(255,255,255,0.1);
  margin: 10px 0;
}

/* === SIDEBAR NAVIGATION === */
.sidebar {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 15px;
  z-index: 10;
}

.sidebar.left {
  left: 20px;
}

.sidebar.right {
  right: 20px;
}

.nav-btn {
  background: #2b2b2b;
  color: #aefcae;
  border: 1px solid rgba(0,255,200,0.3);
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 0 10px rgba(0,255,200,0.1);
}

.nav-btn:hover {
  background: #16c642;
  color: #fff;
  box-shadow: 0 0 15px rgba(0,255,180,0.6);
  transform: scale(1.05);
}

.nav-btn.active {
  background: #16c642;
  color: #fff;
  box-shadow: 0 0 20px rgba(0,255,180,0.8);
}

/* === SPLASH === */
#splash {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, #111 0%, #000 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  color: #aefcae;
  font-family: 'Poppins', sans-serif;
  z-index: 999;
  transition: opacity 1s ease;
}

#splash.hidden {
  opacity: 0;
  pointer-events: none;
}

.splash-content h1 {
  font-size: 2.5rem;
  color: #16c642;
  text-shadow: 0 0 20px rgba(0,255,150,0.6);
  margin-bottom: 10px;
}

.splash-content p {
  color: #aaa;
  font-size: 1rem;
}
.graphing {
  background: #222;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 8px 20px rgba(0, 255, 200, 0.1);
  color: #aefcae;
  width: 400px;
  max-width: 90vw;
  margin: 0 auto;
}

.graphing .display {
  background: #333;
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 10px;
  font-size: 1rem;
}

.graphing input {
  background: transparent;
  border: none;
  color: #aefcae;
  font-size: 1rem;
  outline: none;
  width: 80%;
}

.graphing .buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
}

.graphing button {
  background: #16c642;
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.graphing button.clear {
  background: #ff3b30;
}

.graphing button:hover {
  transform: scale(1.05);
  box-shadow: 0 0 10px rgba(0,255,180,0.5);
}

/* === TITLE BAR === */
#calc-title {
  text-align: center;
  margin-top: 15px;
  color: #16c642;
  font-size: 1.4rem;
  text-shadow: 0 0 10px rgba(0,255,180,0.6);
  font-weight: bold;
}

/* --- FOOTER --- */
footer {
  position: fixed;
  bottom: 10px;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  color: #aefcae;
  opacity: 0.85;
  pointer-events: none; /* so buttons above still clickable */
}

/* Center text */
#footer-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-weight: 600;
  color: #16c642;
  text-shadow: 0 0 10px rgba(0,255,180,0.6);
  pointer-events: none;
}

/* Right-aligned streak */
#streak {
  position: absolute;
  right: 25px;
  font-weight: 600;
  color: #16c642;
  text-shadow: 0 0 10px rgba(0,255,180,0.6);
  pointer-events: none;
}

#calc-title {
  color: #16c642;
  font-size: 1.5rem;
  margin-bottom: 15px;
  text-shadow: 0 0 20px rgba(0,255,180,0.6);
  font-weight: 600;
  letter-spacing: 0.5px;
}