@font-face {
  font-family: 'Digital-7';
  src: url('./fonts/digital-7.ttf') format('truetype');
}


body {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  margin: 0;
  background: #2b2b2b;
}


.calculator {
  width: 255px;
  height: 550px;
  background: #d4c8b6;
  border-radius: 25px 25px 0 0;
  border-radius: 25px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}


.calculator-cover {
  width: calc(100% + 30px);
  height: 200px;
  background: #000;
  border-radius: 30px 30px 0px 0px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #fff;
  font-family: Arial, sans-serif;
  font-weight: bold;
  position: relative;
  left: -15px;
  top: -20px;
  text-align: center;
}


.brand-name {
  font-size: 15px;
  font-family: 'B52', monospace;
  letter-spacing: 10px;
  margin-top: -40px;
  margin-right: -10px;
}


.calculator-top {
  background: #3b0000;
  height: 70px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}




.calculator-display {
  font-family: 'Digital-7', monospace; 
  font-size: 40px;
  color: #ff0000;
  text-align: right;
  width: 100%;
  padding: 10px;
  box-sizing: border-box;
  background: #3b0000;
  border-radius: 15px;
  height: 60px;
}


.calculator-display-text {
  font-family: 'Digital-7', monospace; 
  font-size: 48px;
  color: #ff0000;
}



/* Стили для минусового сегмента слева */
.segment-minus-left {
  width: 12px; /* Ширина минуса */
  height: 3px; /* Толщина минуса */
  background-color: #3b0000; /* Выключенный цвет */
  border-radius: 2px;
  position: absolute;
  left: 35px; /* Позиция слева от дисплея */
  top: 162px; /* Позиция по вертикали */
  transition: background-color 0.3s ease;
}

/* Активный минус (красный цвет) */
.segment-minus-left.active {
  background-color: red;
}

/* Сегмент (младшие разряды) */
.segment-overflow {
  width: 9px; /* Ширина сегмента */
  height: 3px; /* Толщина */
  background-color: #3b0000; 
  border-radius: 2px;
  position: absolute;
  left: 39px; 
  top: 148px; 
  transition: background-color 0.3s ease;
  display: none; 
}

.segment-overflow.active {
  display: block;
  background-color: red;
}

.segment-memory, .segment-constant{
  width: 3px; 
  height: 12px; 
  background-color: #3b0000; 
  margin-right: 5px;
  display: inline-block;
  transition: background-color 0.3s ease;
  border-radius: 2px; 
  box-sizing: border-box;
}


.segment-memory {
  position: relative;
  left: 20px; 
  top: 0px; 
}


.segment-constant {
  position: relative;
  left: 30px; 
}


.segment.active {
  background-color: red;
}


.toggle-switch-container {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 15px;
  position: relative
}


.toggle-switch {
  position: relative;
  width: 40px;
  height: 20px;
  top: 10px; 
  left: 15px;
  background-color: #d4c8b6;
  border-radius: 10px;
  border: 2px solid #b7ab96;
  cursor: pointer;
}


.toggle-switch .switch {
  position: absolute;
  width: 10px;
  height: 15px;
  background-color: #333;
  border-radius: 2px;
  top: 2.5px;
  left: 5px;
  transition: left 0.2s ease;
}


.toggle-switch .plate {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 1px solid #aaa;
  box-sizing: border-box;
  border-radius: 10px;
  z-index: 1;
}


.toggle-switch.on .switch {
  left: 25px;
}


.rectangle {
  position: absolute; 
  top: 5px;
  left: 8px;
  width: 76px; 
  height: 32px; 
  background-color: rgba(0, 0, 0, 0.1); 
  border-top-left-radius: 6px; 
  border-bottom-left-radius: 6px;
  border-top-right-radius: 16px; 
  border-bottom-right-radius: 16px;
}


.rectangle_big {
  position: absolute; 
  top: -134px; 
  left: -15px; 
  width: 266px; 
  height: 450px; 
  border: 2px solid #a89696; 
  border-radius: 26px; 
  pointer-events: none;
}


.calculator-buttons {
  margin-top: 7px;
  left: px;
  display: grid;
  grid-template-columns: repeat(4, calc(27% - 4px)); 
  row-gap: 20px;
  /* justify-items: center;*/
  align-items: center;
  position: relative;
  top: -5px; 
  left: 8px; 
}


.button {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 45px;
  height: 45px;
  border-radius: 4px;
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
}


.button.red {
  background: #e53935;
}


.button.green {
  background: #43a047;
}


.button.black {
  background: #212121;
}



.instruction-container {
  position: absolute;
  left: 0;
  top: 0; 
  transform: translateY(-50%);
  width: 500px;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  color: #fff;
  padding: 20px;
  border-radius: 0 15px 15px 0;
  transition: transform 0.4s ease-in-out;
  transform: translateX(-100%);
  box-shadow: 3px 3px 15px rgba(0, 0, 0, 0.5);
  font-family: Arial, sans-serif;
}

.instruction-toggle {
  position: absolute;  /* Фиксированное расположение относительно родительского контейнера */
  right: -200px;  /* Расположите кнопку справа от калькулятора */
  top: 20px;    /* Расположите кнопку на 20px ниже верхнего края */
  background: #444;
  color: white;
  padding: 10px 20px;  /* Увеличиваем кнопку */
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 5px;  /* Округлим углы */
  cursor: pointer;
  font-size: 16px;     /* Размер текста */
  transition: background 0.3s ease-in-out;
  white-space: nowrap; /* Запрещаем перенос текста */
  z-index: 10;         /* Поверх других элементов, если нужно */
}

.instruction-toggle:hover {
  background: #037ffc;
}

.instruction-container.open {
  transform: translateX(0);
}



.instruction-content h2, .instruction-content h3 {
  margin-bottom: 10px;
  font-size: 18px;
  color: #ffcc00;
}

.instruction-content p {
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 10px;
}

.instruction-content ul {
  padding-left: 18px;
  margin-bottom: 15px;
}

.instruction-content ul li {
  font-size: 14px;
  margin-bottom: 5px;
}

.instruction-content b {
  color: #ffcc00;
}
.instruction-link {
  text-decoration: none;
  color: #ffcc00;
  font-family: 'Arial', sans-serif;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s ease;
}

.instruction-link:hover {
  color: #ff9900; /* Цвет при наведении */
}
