/* ===================== NUMEROCALC (CLEAN CSS) ===================== */

/* ===== ПРОМЕНЛИВИ ===== */
.numerocalc{
  --accent: #c87941;
  --accentBorder: #d4a843;
  
  --btn-bg: #f5edda;
  --btn-border: #d4a843;
  --btn-text: #c87941;
  --btn-bg-hover: #f0d4a0;
  --btn-bg-active: #e8b86a;

  --chart-fate: #0066ff;
  --chart-will: #ff0000;

  --text-main: #8b6914;
  --matrix-line: #c8a050;
  --matrix-text: #7a4f1d;
  --title-color: #7a4f1d;
}

/* ===== ОСНОВЕН КОНТЕЙНЕР ===== */
.numerocalc{
  font-size: 16px;
  font-family: "Commissioner", sans-serif;
  background-image: url('../img/bckgr-Psy-Num.jpg');
  background-position: top;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
  padding-bottom: 60px;
}

.numerocalc .mainBox{
  width: 80%;
  margin: 0 auto;
  text-align: center;
  min-height: 100vh;
}

/* ===== ЗАГЛАВИЕ ===== */
.numerocalc h2{
  color: var(--title-color);
  font-size: 2rem;
  font-weight: 600;
  text-align: center;
  margin: 0;
  padding: 45px 0 35px;
}

.numerocalc .navbarBox{
  display: flex;
  align-items: center;
  flex-direction: column;
}

/* ===== РЕД: ДАТА + БУТОНИ ===== */
.numerocalc .inputBox{
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 0 auto 28px;
}

/* ===== DATE PICKER ===== */
.numerocalc .nc-datewrap{
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 44px;
}

.numerocalc input[type="date"]:not(.nc-date-native),
.numerocalc .input-date,
.numerocalc .js-input-date{
  height: 44px;
  width: 180px;
  border: 1px solid rgba(92, 92, 92, 0.35);
  border-radius: 10px;
  background: rgba(255,255,255,0.85);
  color: rgb(92, 92, 92);
  font-size: 15px;
  text-align: left;
  letter-spacing: 0;
  padding: 0 44px 0 14px;
  text-indent: 1px;
  line-height: 44px;
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
}

.numerocalc .js-input-date::placeholder,
.numerocalc input.input-date::placeholder{
  content: "дд/мм/гггг";
}

/* календар иконка */
.numerocalc .nc-datewrap::after{
  content: "";
  position: absolute;
  right: 16px;
  top: calc(50% - 8px);
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  opacity: 0.85;
  pointer-events: none;
  background-repeat: no-repeat;
  background-size: 18px 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%236b6b6b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
}

/* невидим native date picker */
.numerocalc .nc-date-native{
  position: absolute !important;
  top: 50% !important;
  right: 16px !important;
  transform: translateY(-50%) !important;
  width: 28px !important;
  height: 28px !important;
  opacity: 0 !important;
  cursor: pointer !important;
  pointer-events: auto !important;
  z-index: 999 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
  -webkit-appearance: none;
  appearance: none;
}

.numerocalc .nc-date-native::-webkit-calendar-picker-indicator{
  opacity: 0 !important;
}

.numerocalc .nc-date-native::-webkit-inner-spin-button,
.numerocalc .nc-date-native::-webkit-clear-button{
  display: none !important;
}

/* ===== БУТОНИ ===== */
.numerocalc .buttonsDiv{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  width: auto;
}

.numerocalc .button{
  height: 44px;
  width: 180px;
  border: 1px solid var(--btn-border);
  border-radius: 10px;
  background: var(--btn-bg);
  color: var(--btn-text);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 18px;
  cursor: pointer;
  line-height: 1;
  white-space: nowrap;
}

.numerocalc .button:hover{
  background: var(--btn-bg-hover) !important;
  color: var(--btn-text) !important;
  border-color: var(--btn-border) !important;
  box-shadow: none !important;
}

.numerocalc .button:active{
  background: var(--btn-bg-active) !important;
  color: var(--btn-text) !important;
  box-shadow: none !important;
}

.numerocalc .text-inside-button{
  margin: 0 !important;
  padding: 0;
  line-height: 1 !important;
}

/* ===== ДВЕ КОЛОНИ: МАТРИЦА + ДЯСНО ===== */
.numerocalc .middleBox{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
  width: 100%;
}

.numerocalc .matrix{
  width: 40%;
  display: flex;
  justify-content: center;
}

.numerocalc .rightSide{
  width: 60%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* ===== ТЕКСТОВЕ ВДЯСНО ===== */
.numerocalc .matrixNumbers{
  color: var(--text-main);
  font-size: 1.1rem;
  font-weight: 600;
  text-align: left;
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  line-height: 1.2;
}

.numerocalc .matrixNumbers p{
  margin: 0;
}

/* ===== МАТРИЦА 3x3 ===== */
.numerocalc table{
  border-collapse: collapse;
  border-style: hidden;
  margin: 0 auto;
  color: var(--matrix-text);
}

.numerocalc table th,
.numerocalc table td{
  border: 3px solid var(--matrix-line);
}

.numerocalc .matrix table{
  table-layout: fixed;
  width: 420px;
  height: 420px;
}

.numerocalc .matrix th,
.numerocalc .matrix td{
  width: 140px;
  height: 140px;
  padding: 0;
  text-align: center;
  vertical-align: middle;
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -1px;
  line-height: 1;
  white-space: nowrap;
  overflow: visible !important;
}

/* ===== ГРАФИКА ===== */
.numerocalc .graph{
  width: 100%;
  margin-top: 18px;
  height: 380px;
  position: relative;
  border: none !important;
  box-shadow: none !important;
}

.numerocalc .graph canvas {
  border: none !important;
  box-shadow: none !important;
}

.numerocalc #graph{
  width: 100%;
  height: 380px;
}

/* ===== RESPONSIVE ===== */
@media screen and (max-width:1200px) {
  .numerocalc .mainBox{ 
    width: 92%; 
  }
}

@media screen and (max-width:900px) {
  .numerocalc .middleBox{ 
    gap: 26px; 
  }
  .numerocalc .matrix{ 
    width: 45%; 
  }
  .numerocalc .rightSide{ 
    width: 55%; 
  }
  .numerocalc .statsRow {
    gap: 40px;
  }
}

@media screen and (max-width:700px) {
  .numerocalc .inputBox{
    flex-direction: column;
    gap: 12px;
    margin-bottom: 22px;
  }
  
  .numerocalc .buttonsDiv{
    flex-direction: column;
    gap: 12px;
  }
  
  .numerocalc input[type="date"]:not(.nc-date-native),
  .numerocalc .input-date,
  .numerocalc .button{
    width: 260px;
  }

  .numerocalc .middleBox{
    flex-direction: column;
    align-items: center;
    gap: 22px;
  }
  
  .numerocalc .matrix,
  .numerocalc .rightSide{
    width: 100%;
  }
  
  .numerocalc .rightSide{
    align-items: center;
  }

  /* statsRow на мобилно — вертикален */
  .numerocalc .statsRow{
    flex-direction: column;
    align-items: center;
    gap: 18px;
  }

  .numerocalc .matrixNumbers{
    text-align: center;
  }

  .numerocalc .refMatrix {
    display: none;
  }

  .numerocalc .graph,
  .numerocalc #graph{
    height: 280px;
  }

  .numerocalc .refMatrix td {
    width: 36px;
    height: 30px;
    font-size: 13px;
  }
}

@media screen and (max-width:480px) {
  .numerocalc .matrix table{
    width: 300px;
    height: 300px;
  }
  
  .numerocalc .matrix th,
  .numerocalc .matrix td{
    width: 100px;
    height: 100px;
    font-size: 22px;
    letter-spacing: -1px;
    white-space: nowrap;
    overflow: visible;
  }
}

/* ===== СТАТИСТИКИ + РЕФЕРЕНТНА МАТРИЦА ===== */
.numerocalc .statsRow {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 120px;
  width: 100%;
  margin-bottom: 10px;
}

/* ===== МАЛКА РЕФЕРЕНТНА МАТРИЦА ===== */
.numerocalc .refMatrix {
  flex-shrink: 0;
}

.numerocalc .refMatrix table {
  border-collapse: collapse;
  border-style: hidden;
}

.numerocalc .refMatrix td {
  border: 2px solid var(--matrix-line);
  width: 40px;
  height: 34px;
  text-align: center;
  vertical-align: middle;
  font-size: 15px;
  font-weight: 700;
  color: var(--title-color);
  padding: 0;
}

/* ===================== END ===================== */

/* ===== INFO БУТОН ===== */
.numerocalc .nc-info-btn {
  width: 22px !important;
  height: 22px !important;
  min-width: 22px !important;
  min-height: 22px !important;
  max-width: 22px !important;
  max-height: 22px !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  flex-shrink: 0 !important;
  opacity: 0.75;
  transition: opacity 0.15s;
}

.numerocalc .nc-info-btn:hover {
  opacity: 1;
  background: transparent !important;
  box-shadow: none !important;
}

/* ===== МОДАЛ ===== */
.numerocalc .nc-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.numerocalc .nc-modal-box {
  background: #fdf8f0;
  border-radius: 14px;
  max-width: 620px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 36px 40px 32px;
  position: relative;
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
  box-sizing: border-box;
}

.numerocalc .nc-modal-close {
  position: absolute;
  top: 14px;
  right: 18px;
  background: none;
  border: none;
  font-size: 1.6rem;
  color: var(--text-main);
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

.numerocalc .nc-modal-content h2 {
  font-size: 1.2rem;
  color: var(--title-color);
  margin: 0 0 6px;
  padding: 0;
  text-align: left;
}

.numerocalc .nc-modal-content h3 {
  font-size: 1rem;
  color: var(--title-color);
  margin: 20px 0 4px;
  padding: 0;
  text-align: left;
}

.numerocalc .nc-modal-content p {
  font-size: 0.92rem;
  color: #7a5a2a;
  line-height: 1.6;
  margin: 0 0 8px;
  text-align: left;
}

.numerocalc .nc-modal-content .nc-modal-subtitle {
  font-size: 0.82rem;
  color: #aaa;
  font-style: italic;
  margin-bottom: 18px;
}

@media screen and (max-width: 700px) {
  .numerocalc .nc-modal-box {
    padding: 28px 20px 24px;
  }
}
