@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap');

/* Light Theme Variables */
body.light-mode ,body{
  --bg-color: #f0f0f0;
  --text-color: #222222;
  --display-bg: #ffffff;
  --display-text: #222222;
  --btn-bg: #e0e0e0;
  --btn-text: #000000;
  --btn-hover: #d5d5d5;
  --btn-active: #cccccc;
  --operator-color: #008080;
    --equal-btn-bg: #226d5d;
}

/* Dark Theme Variables
body.dark-mode{
  --bg-color: #22252e;
  --text-color: #ffffff;
  --display-bg: #2a2d38;
  --display-text: #ffffff;
  --btn-bg: #2a2d38;
  --btn-text: #ffffff;
  --btn-hover: #1f212b;
  --btn-active: #1a1c24;
  --operator-color: #5ac3ad;
  --equal-btn-bg: #226d5d;
} */


/* for theme toggle button */
 
/* toggle style ends */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  font-family: 'Poppins', sans-serif;
  height: 100%;
  width: 100%;
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: background-color 0.3s, color 0.3s;
  display: flex;
    justify-content: center;
    align-items: center;
}

#theme-toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 6px 12px;
  border: none;
  border-radius: 5px;
  background-color: #5ac3ad;
  color: #fff;
  cursor: pointer;
  z-index: 999;
  cursor: not-allowed;
}

.calculator {
  max-width: 400px;
  width: 100%;
  margin: auto;
  padding: 20px;
  border-radius: 20px;
  background-color: var(--bg-color);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: auto;
}

.display {
  margin-bottom: 20px;
}

.display input {
  width: 100%;
  font-size: 2rem;
  padding: 15px;
  text-align: right;
  border: none;
  border-radius: 12px;
  background-color: var(--display-bg);
  color: var(--display-text);
  outline: none;
}

.buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.btn {
  padding: 20px;
  font-size: 1.4rem;
  border: none;
  border-radius: 16px;
  background-color: var(--btn-bg);
  color: var(--btn-text);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

/* Hover only on non-touch devices */
@media (hover: hover) and (pointer: fine) {
  .btn:hover {
    background-color: var(--btn-hover);
    transform: scale(1.03);
    border-radius: 22px;
  }
  #equal-btn:hover {
    background-color: var(--equal-btn-bg);
    color: white;
  }
}

.btn:active {
  background-color: var(--btn-active);
  transform: scale(0.97);
  border-radius: 14px;
}

.btn.operator {
  color: var(--operator-color);
}

#equal-btn {
  background-color: #5ac3ad;
  color: white;
}

.equal-btn:active {
  background-color: #4ab2a0;
}



/* Mobile Optimized Fullscreen Layout */
@media (max-width: 600px) {
  body {
    padding: 0;
    margin: 0;
    height: 100vh;
    overflow: hidden;
  }

  .calculator {
    height: 90vh;
    max-width: 100vw;
    border-radius: 0;
    padding: 20px;
  }

  .display input {
    margin-top:20px;
    font-size: 2.5rem;
    padding: 20px 15px;
  }

  .btn {
    font-size: 1.6rem;
    padding: 16px;
    border-radius: 20px;
  }

  #theme-toggle {
    top: 12px;
    right: 12px;
    font-size: 0.85rem;
  }
}
