/* Base Reset & Font */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  
  html {
    font-size: 16px;
  }
  
  body {
    font-family: 'Spartan', sans-serif;
    background-color: hsl(222, 26%, 31%);
    color: hsl(221, 14%, 31%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 1rem;
  }
  
  body.theme-light {
    background-color: hsl(0, 0%, 90%);
  }
  
  body.theme-dark {
    background-color: hsl(268, 75%, 9%);
  }
  
  /* === Calculator Container === */
  .calculator {
    border: 2px solid hsl(221, 14%, 31%);
    border-radius: 10px;
    font-size: 1.1rem;
    padding: 2rem;
    background-color: hsl(224, 36%, 15%);
    max-width: 36rem;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }
  
  body.theme-light .calculator {
    background-color: hsl(0, 0%, 93%);
    border-color: hsl(185, 42%, 37%);
  }
  
  body.theme-dark .calculator {
    background-color: hsl(268, 71%, 12%);
    border-color: hsl(52, 100%, 62%);
  }
  
  /* === Header === */
  .calculator__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  .calculator__title {
    font-size: 1.5rem;
    color: #fff;
  }
  
  body.theme-light .calculator__title {
    color: #111;
  }
  
  body.theme-dark .calculator__title {
    color: hsl(52, 100%, 62%);
  }
  
  /* === Theme Toggle === */
  .theme-toggle {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.2rem;
    font-size: 0.75rem;
    color: #fff;
  }
  
  .theme-toggle__label {
    font-size: 0.85rem;
  }
  
  .theme-toggle__slider {
    width: 70px;
    height: 24px;
    background-color: hsl(224, 36%, 15%);
    border: 2px solid hsl(221, 14%, 31%);
    border-radius: 30px;
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 2px;
  }
  
  .theme-toggle__circle {
    width: 18px;
    height: 18px;
    background-color: hsl(6, 63%, 50%);
    border-radius: 50%;
    position: absolute;
    left: 2px;
    transition: left 0.3s ease;
  }

  .theme-toggle__modes {
    display: flex;
    justify-content: space-between;
    width: 70px;
    padding: 0 4px;
    color: #fff;
  }

  .theme-toggle__modes span {
    flex: 1;
    text-align: center;
  }
  
  body.theme-light .theme-toggle__slider {
    background-color: hsl(0, 5%, 81%);
  border-color: hsl(185, 42%, 37%);
  }
  
  body.theme-dark .theme-toggle__slider {
    background-color: hsl(268, 71%, 12%);
  border-color: hsl(52, 100%, 62%);
  }
  
  body.theme-light .theme-toggle__circle {
    background-color: hsl(25, 98%, 40%);
  }
  
  body.theme-dark .theme-toggle__circle {
    background-color: hsl(176, 100%, 44%);
  }
  
  /* Position of toggle dot for each theme */
  body:not(.theme-light):not(.theme-dark) .theme-toggle__circle {
    left: 2px;
  }
  
  body.theme-light .theme-toggle__circle {
    left: 20px;
  }
  
  body.theme-dark .theme-toggle__circle {
    left: 40px;
  }
  
  /* === Screen === */
  .calculator__screen {
    height: 5rem;
    font-size: 2.2rem;
    background-color: hsl(224, 36%, 15%);
    color: #fff;
    border-radius: 5px;
    padding: 1.2rem;
    text-align: right;
    overflow: hidden;
    white-space: nowrap;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
  }
  
  body.theme-light .calculator__screen {
    background-color: hsl(0, 0%, 93%);
    color: #111;
  }
  
  body.theme-dark .calculator__screen {
    background-color: hsl(268, 71%, 12%);
    color: hsl(52, 100%, 62%);
  }
  
  /* === Keypad === */
  .calculator__keys {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
  }
  
  .key {
    font-size: 2rem;
    padding: 1.2rem;
    border: none;
    border-radius: 8px;
    background-color: hsl(30, 25%, 89%);
    box-shadow: 0px 4px hsl(28, 16%, 65%);
    cursor: pointer;
    transition: background-color 0.2s ease;
  }
  
  .key:hover {
    background-color: hsl(30, 25%, 79%);
  }
  
  body.theme-light .key {
    background-color: hsl(45, 10%, 90%);
    box-shadow: 0px 4px hsl(35, 11%, 61%);
  }
  
  body.theme-dark .key {
    background-color: hsl(290, 70%, 36%);
    box-shadow: 0px 4px hsl(268, 47%, 21%);
    color: hsl(198, 20%, 13%);
  }
  
  /* === Special Keys === */
  .key--action {
    font-size: 1rem;
    text-transform: uppercase;
    color: #fff;
  }
  
  .key--reset {
    grid-column: span 2;
    background-color: hsl(225, 21%, 49%);
    box-shadow: 0px 4px hsl(224, 28%, 35%);
  }
  
  .key--equal {
    grid-column: span 2;
    background-color: hsl(6, 63%, 50%);
    box-shadow: 0px 4px hsl(6, 70%, 34%);
  }
  
  body.theme-light .key--reset {
    background-color: hsl(185, 42%, 37%);
    box-shadow: 0px 4px hsl(35, 11%, 61%);
  }
  
  body.theme-light .key--equal {
    background-color: hsl(25, 98%, 40%);
    box-shadow: 0px 4px hsl(25, 99%, 27%);
  }
  
  body.theme-dark .key--reset {
    background-color: hsl(268, 47%, 21%);
    box-shadow: 0px 4px hsl(290, 70%, 36%);
  }
  
  body.theme-dark .key--equal {
    background-color: hsl(176, 100%, 44%);
    box-shadow: 0px 4px hsl(177, 92%, 70%);
    color: hsl(198, 20%, 13%);
  }
  