/* ===== General Reset ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

/* ===== Body Background ===== */
body {
  height: 100vh;
  background: linear-gradient(135deg, #000428, #004e92);
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #fff;
  overflow-x: hidden;
}

/* ===== Neon Glass Topbar ===== */
.topbar {
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  display: flex;
  justify-content: center;
  padding: 10px 0;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 25px rgba(0, 255, 255, 0.3);
  animation: neonPulse 3s infinite alternate;
}

/* Glow animation */
@keyframes neonPulse {
  from {
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.4);
  }
  to {
    box-shadow: 0 0 35px rgba(0, 255, 255, 0.8);
  }
}
/* 🌟 Glassy Topbar */
.topbar {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0, 255, 255, 0.25);
  border-radius: 0 0 20px 20px;
  padding: 12px 0;
  margin-bottom: 20px;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 90%;
  max-width: 1100px;
}

/* 🩵 Logo Only */
.brand-logo {
  width: 600px;
  height: 100px;
  object-fit: contain;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 25px rgba(0, 255, 255, 0.6);
  filter: drop-shadow(0 0 10px #00fff7);
  transition: all 0.3s ease;
}

.brand-logo:hover {
  transform: scale(1.08);
  filter: drop-shadow(0 0 25px #00ffff);
}

/* 📱 Responsive */
@media (max-width: 480px) {
  .brand-logo {
    width: 200px;
  }
}

/* ===== Container ===== */
.container {
  margin-top: 110px;
  width: 100%;
  max-width: 1200px;
  backdrop-filter: blur(15px);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  box-shadow: 0 0 30px rgba(0, 255, 255, 0.4);
  padding: 20px;
  transition: 0.3s ease;
}

/* ===== Navbar ===== */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.navbar h2 {
  color: cyan;
  text-shadow: 0 0 15px cyan;
}

/* ===== Theme Toggle ===== */
.theme-switch input {
  display: none;
}

.theme-switch label {
  width: 50px;
  height: 25px;
  background: #111;
  display: block;
  border-radius: 25px;
  position: relative;
  cursor: pointer;
  box-shadow: inset 0 0 8px rgba(0, 255, 255, 0.3);
}

.theme-switch label::after {
  content: '';
  width: 20px;
  height: 20px;
  background: cyan;
  border-radius: 50%;
  position: absolute;
  top: 2.5px;
  left: 3px;
  transition: 0.3s;
}

.theme-switch input:checked + label {
  background: #fff;
}

.theme-switch input:checked + label::after {
  left: 27px;
  background: #111;
}

/* ===== Calculator ===== */
.calculator {
  text-align: center;
  padding: 15px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.1);
}

#display {
  width: 100%;
  height: 60px;
  background: transparent;
  border: none;
  color: #0ff;
  font-size: 1.8rem;
  text-align: right;
  outline: none;
  margin-bottom: 10px;
  text-shadow: 0 0 10px #0ff;
}

/* ===== Buttons ===== */
.buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.btn {
  padding: 15px;
  font-size: 1.2rem;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.2);
}

.btn:hover {
  background: rgba(0, 255, 255, 0.3);
  box-shadow: 0 0 25px cyan;
  transform: scale(1.08);
}

.btn.clear {
  background: rgba(255, 0, 0, 0.35);
  box-shadow: 0 0 15px red;
}

/* ===== History ===== */
.history {
  margin-top: 20px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  text-align: left;
  max-height: 150px;
  overflow-y: auto;
}

.history h3 {
  color: #0ff;
  margin-bottom: 10px;
  text-shadow: 0 0 10px cyan;
}

.history ul {
  list-style: none;
  color: #fff;
  font-size: 0.9rem;
}

/* ===== Footer ===== */
footer {
  margin-top: 15px;
  text-align: center;
  font-size: 0.8rem;
  opacity: 0.8;
}

/* ===== Dark Mode ===== */
body.dark {
  background: linear-gradient(135deg, #0a0a0a, #1b1b1b);
}

body.dark .container {
  background: rgba(0, 0, 0, 0.6);
  box-shadow: 0 0 25px rgba(255, 255, 255, 0.1);
}

body.dark .navbar h2 {
  color: magenta;
  text-shadow: 0 0 15px magenta;
}

body.dark .btn:hover {
  background: rgba(255, 0, 255, 0.3);
  box-shadow: 0 0 25px magenta;
}

body.dark .brand-text {
  color: #ff66ff;
  text-shadow: 0 0 15px rgba(255, 0, 255, 0.6);
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
  .container {
    width: 95%;
    padding: 15px;
  }

  .navbar h2 {
    font-size: 1.3rem;
  }

  #display {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .topbar-inner {
    justify-content: center;
  }

  .brand-text {
    display: none; /* Hide text for very small screens */
  }

  .brand-logo {
    width: 200px;
    height:100px;
  }

  .container {
    width: 95%;
    padding: 12px;
    margin-top: 90px;
  }

  .btn {
    padding: 12px;
    font-size: 1rem;
  }

  footer {
    font-size: 0.7rem;
  }
}
