body {
      background: #000000;
      display: flex;
      justify-content: center;
      align-items: center;
      height: 100vh;
      margin: 0;
      font-family: Arial, sans-serif;
      padding: 10px;
    }


    .calculator {
      position: relative;
      overflow: hidden;
      border-radius: 20px;
      box-shadow: 0 0 35px #797979;
      width: 320px;
      background: #000000;
      padding: 5px 10px 10px 10px;
      z-index: 1;
    }

  
    .display {
      background: black;
      color: white;
      font-size: 2rem;
      text-align: right;
      padding: 100px 20px 20px 20px;
      border-bottom: 1px solid #333;
      height: 60px;
      overflow-x: auto;
      margin-bottom: 2px;
    }

   
    .display {
      font-size: 2.5rem;
      min-height: 80px;
      display: flex;
      align-items: center;
      justify-content: flex-end;
      padding: 20px;
      word-wrap: break-word;
      word-break: break-all;
      transition: all 0.3s ease;
  }


.display.showing-function {
  color: #f08222;
  font-style: italic;
}

    
    .more {
      position: relative;
      display: flex;
      justify-content: flex-end;
      align-items: center;
      margin-bottom: 5px;
    }

    
    .magic-btn {
      width: 50px;
      height: 50px;
      padding: 13px;
      background: black;
      border: none;
      border-radius: 50%;
      display: grid;
      grid-template-columns: 1fr 1fr;
      grid-template-rows: 1fr 1fr;
      margin-right: -5px;
      line-height: 0.6;
      justify-content: center;
      align-items: center;
      font-size: 18px;
      color: #fff;
    }
    .magic-btn span { transition: all 0.4s ease;
    }

    
    .rs-drawer {
      margin-right: -15px;
      height: 50px;
      width: 50px;
      border: none;
      border-radius: 50%;
      background: url('4square.png') no-repeat center center;
      background-size: cover;
    }
    .rs-drawer:active { transform: scale(1.1); }

   
    .options {
      margin-right: -20px;
      height: 50px;
      width: 50px;
      border: none;
      border-radius: 50%;
      background: url('3dots.png') no-repeat center center;
      background-size: contain;
      transition: transform 0.2s ease;
    }
    .options:active { transform: scale(0.9); }

   
    .dropDown {
      position: absolute;
      top: 70px;
      right: 20px;
      background: #333333;
      padding: 2px 20px;
      width: 120px;
      color: #ebebeb;
      border-radius: 8px;
      opacity: 0;
      visibility: hidden;
      transform: translateY(-10px);
      transition: opacity 0.3s ease, transform 0.3s ease;
      z-index: 1000;
    }
    .dropDown.active { opacity: 1; visibility: visible; transform: translateY(0); }

    
    .keypad-wrapper {
      width: 100%;
      height: 400px;
      overflow: hidden;
      position: relative;
    }
    .keypad {
      display: grid;
      grid-template-columns: repeat(5, 1fr);
      grid-template-rows: repeat(7, 1fr);
      gap: 4px;
      width: 100%;
      height: 100%;
      transform-origin: bottom right;
      transition: transform 0.4s ease;
    }
    .normal .keypad { transform: scale(1.3); }
    .scientific .keypad { transform: scale(1); }

.calculator.normal .keypad {
  transform: scale(1.25, 1.4); 
  transform-origin: bottom right;
  transition: transform 0.4s ease;
}
.calculator.scientific .keypad {
  transform: scale(1,1); 
  transform-origin: bottom right;
  transition: transform 0.4 ease;
}
    .keypad button {
      border: none;
      border-radius: 50%;
      background: #2e2e2e;
      color: #fff;
      font-size: 20px;
      padding: 5px 2px;
      font-weight: 500;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: background 0.2s, transform 0.1s;
    }
    .keypad button:active { background: #444; transform: scale(0.9); }

    .diff { 
      background: #1e1e1e !important; }
    .equal { 
      background: #f08222 !important; 
      color: white; 
      border-radius: 15px; }

    .keypad button:contains("="){
      font-family: Arail, sans-serif;
    }

   
    .keypad button {
      transition: color 0.3s ease;
    }
    .keypad button{
      color: #ffffff;
    }
    .keypad button.orange-mode{
      color: #f08222;
      font-weight: bold;
    }
    .keypad button[style*="color: #f08222"]{
      color: #f08222 !important;
      font-weight: bold;
    }

   
    .overlay {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0,0,0,0.5);
      opacity: 0;
      visibility: hidden;
      transition: opacity 0.3s ease;
      z-index: 9;
    }
    .overlay.show { opacity: 1; visibility: visible; }

   
    .drawer {
      position: absolute;
      top: 0;
      right: 0;
      height: 100%;
      width: 320px;
      background: #000;
      box-shadow: -2px 0 10px rgba(0,0,0,0.6);
      transform: translateX(100%);
      transition: transform 0.4s ease-in-out;
      z-index: 1000;
      padding: 20px;
      display: flex;
      flex-direction: column;
    }
    .drawer.open { transform: translateX(0); }
    .drawer-header { 
      display: flex; 
      align-items: center;
      height: 30px;
      padding-bottom: 15px;
      gap: 5px; 
      margin-bottom: 5px; }

    .close-drawer {
      background: none;
      height: 55px;
      width: 55px;
      border: none;
      border-radius: 50%;
      color: #e6e6e6;
    }
    .close-drawer:active { transform: scale(0.85); }

    .options-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 10px;
      margin-left: 10px;
    }
    .option {
      display: flex;
      flex-direction: column;
      background: #1e1e1e;
      color: white;
      border-radius: 12px;
      align-items: center;
      justify-content: center;
      text-align: center;
      width: 80px;
      padding: 30px 10px;
      font-size: 0.9rem;
      transition: 0.3s;
    }
    .option i { font-size: 25px; margin-bottom: 15px;
    }
    .option:active {
      background: #333;
      transform: scale(0.9);
    }
    
    .opDrawer{
      position: fixed;
      top: 0;
      right: 0;
      width: 100%;
      max-width: 400px;
      height: 100%;
      background: #000;
      display: flex;
      flex-direction: column;
      transform: translateX(100%);
      transition: transform 0.3s ease;
      z-index: 1000;
      padding: 0;
    }
    
    .opDrawer.open{
      transform: translateX(0);
    }
    
    .opHeader {
  display: flex;
  align-items: center;
  padding: 5px 15px;
  font-size: 24px;
  height: 70px; 
  font-weight: bold;
  color: #e6e6e6;
  background: none;
  gap: 5px;
  flex-shrink: 0; 
}

    .display-container{
      flex-shrink: 0;
      display: flex;
      flex-direction: column;
      justify-content: center;
      background: none;
      padding: 10px;
      padding-left: 30px;
      gap: 15px;
      width: calc(100% - 50px);
      margin: 0 auto;
      height: 200px;
    }
    
    .display-box{
      background: #1a1a1a;
      padding: 10px;
      border-radius: 15px;
      font-size: 20px;
      transition: all 0.3s ease;
      margin-top: -5px;
    }
    
    .display-box:first-child {
  background: #2a2a2a; 
   margin-top: -5px;
}

#from-value {
  color: #f08222; 
  font-size: 24px;
  font-weight: bold;
  min-height: 30px;
  display: flex;
  align-items: center;
  transition: all 0.3s ease;
}

#to-value {
  color: #ffffff; 
  font-size: 20px;
  min-height: 30px;
  display: flex;
  align-items: center;
  transition: all 0.3s ease;
}


.display-box:first-child select {
  color: #f08222;
  font-weight: bold;
}

    .display-box select{
      background: none;
      border: none;
      border-radius: 20px;
      padding: 10px;
      outline: none;
      color: #969696;
      font-size: 16px;
      font-weight: bold;
      margin-bottom: 5px;
      margin-left: -10px;
      width: 100%;
    }
    .display-box select:active{
      background: #2a2a2a;
    }
    .display-box strong{
      display: block;
      margin-top: 5px;
      color: #353535;
    }

    .key-pad{
      background: #000;
      padding: 15px;
      display: grid;
      grid-template-columns: repeat(4,1fr);
      gap: 10px;
      padding-left: 25px;
      padding-right: 25px;
      flex: 1;
      align-content: start;
      margin-left: 10px;
      width: calc(100% - 50px);
    }
    .btn{
      background: #1a1a1a;
      border: none;
      border-radius: 50%;
      color: #e9e9e9;
      font-size: 18px;
      font-weight: 500;
      height: 55px;
      width: 55px;
      display: flex;
      justify-content: center;
      align-items: center;
      cursor: pointer;
      transition: 0.2s;
      margin: 0 auto;
  }
  .btn:active{
    background: #333;
    transform: scale(0.9);
  }
  .spe{
    background: #323232;
    color: #ffffff;
  }
  .spe:active{
    background: #444;
    transform: scale(0.9);
  }
  .empty{
    background: none;
    border: none;
    border-radius: 50%;
  }