* {
  box-sizing: border-box;
}

/* ---------- Disable text selection / cut / copy across the site ----------
   Paired with the copy/cut/contextmenu/keyboard-shortcut blockers in
   index.php's inline <script>. user-select:none stops selection (so there's
   nothing to copy in the first place); the JS layer below additionally
   blocks the copy/cut events and Ctrl/Cmd+C/X/A/P/U/S and right-click,
   as a defense-in-depth measure since CSS alone can be bypassed.
   Skipped entirely when logged in as an admin (index.php adds the
   "admin-mode" class to <body> only for admin sessions), so admins can
   still select/copy/cut content normally. */
body:not(.admin-mode) {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none; /* iOS: disable the press-and-hold copy menu */
}

/* Inputs/selects still need normal selection so users can edit their
   own typed values (name, DOB, mobile number, etc). */
input,
select,
textarea {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

html {
  /* Force mobile browsers to honor the viewport instead of the
     "desktop site" fallback zoomed-out layout. */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: "Segoe UI", Arial, sans-serif;
  background: linear-gradient(160deg, #eafbea 0%, #dcf3dc 45%, #eafbea 100%);
  margin: 0;
  padding: 0;
  color: #3e2723;
  min-height: 100vh;
  display: flex;
  justify-content: center;
}

.container {
  width: 100%;
  max-width: 380px;
  margin: 24px auto;
  padding: 16px 18px 20px;
  background: linear-gradient(155deg, #ffffff 0%, #fbfbf8 55%, #f2efe6 100%);
  border-top: 3px solid #e8c9a0;
  border-left: 3px solid #e0bd8f;
  border-right: 4px solid #8a5c34;
  border-bottom: 5px solid #6f4526;
  border-radius: 18px;
  position: relative;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.95),
    inset -2px -2px 0 rgba(0, 0, 0, 0.04),
    0 3px 0 rgba(0, 0, 0, 0.05),
    0 14px 0 -6px rgba(0, 0, 0, 0.04),
    0 18px 30px rgba(0, 0, 0, 0.22),
    0 34px 60px rgba(46, 125, 50, 0.22);
  transition: transform 0.25s ease, box-shadow 0.25s ease, max-width 0.35s ease;
}

/* Widened state, applied to .container when the Analyze button is
   clicked, so the results (grids/tables) have room to breathe. */
.container.expanded {
  max-width: 820px;
}

.container:hover {
  transform: translateY(-4px);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.95),
    inset -2px -2px 0 rgba(0, 0, 0, 0.04),
    0 3px 0 rgba(0, 0, 0, 0.05),
    0 16px 0 -6px rgba(0, 0, 0, 0.05),
    0 22px 36px rgba(0, 0, 0, 0.26),
    0 40px 70px rgba(46, 125, 50, 0.26);
}

h1 {
  text-align: center;
  color: #ffffff;
  margin: 0 auto 26px;
  padding: 10px 22px;
  letter-spacing: 1.4px;
  font-size: 1.3em;
  font-weight: 800;
  border-radius: 10px;
  width: fit-content;
  max-width: 90%;
  background: linear-gradient(180deg, #79c97e 0%, #4caf50 35%, #2e7d32 75%, #235f26 100%);
  border: 1px solid #1b5e20;
  transform: perspective(400px) rotateX(2deg);
  text-shadow:
    0 1px 0 #1b5e20,
    0 2px 0 #1b5e20,
    0 3px 0 #164a1a,
    0 4px 6px rgba(0, 0, 0, 0.4),
    0 0 14px rgba(255, 255, 255, 0.45);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.55),
    inset 0 -4px 8px rgba(0, 0, 0, 0.25),
    0 6px 0 #1b5e20,
    0 10px 18px rgba(27, 94, 32, 0.45),
    0 18px 30px rgba(0, 0, 0, 0.15);
}

label {
  display: inline-block;
  color: #5c3a1e;
  font-weight: 700;
  margin-bottom: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  background: linear-gradient(180deg, #f3ddc0 0%, #e6c398 100%);
  border: 1px solid #c9a061;
  font-size: 0.9em;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    inset 0 -2px 3px rgba(139, 94, 41, 0.25),
    0 2px 0 rgba(139, 94, 41, 0.35),
    0 3px 5px rgba(0, 0, 0, 0.15);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

input,
select {
  width: 100%;
  padding: 6px 8px;
  border: 2px solid #a97b4f;
  border-radius: 8px;
  margin-bottom: 10px;
  font-family: inherit;
  font-size: 0.9em;
  background: linear-gradient(180deg, #eee8dc 0%, #fffefb 55%);
  box-shadow:
    inset 0 3px 6px rgba(93, 62, 24, 0.28),
    inset 0 -1px 0 rgba(255, 255, 255, 0.9),
    inset 3px 0 5px -3px rgba(93, 62, 24, 0.18),
    0 1px 0 rgba(255, 255, 255, 0.7);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
select:focus {
  outline: none;
  border-color: #2e7d32;
  box-shadow:
    inset 0 3px 6px rgba(93, 62, 24, 0.28),
    inset 0 -1px 0 rgba(255, 255, 255, 0.9),
    0 0 0 4px rgba(46, 125, 50, 0.22);
}

button {
  display: block;
  width: auto;
  min-width: 120px;
  margin: 4px auto 0;
  background: linear-gradient(180deg, #43a047 0%, #2e7d32 100%);
  color: #fff;
  border: 1px solid #1b5e20;
  padding: 7px 18px;
  border-radius: 8px;
  font-size: 0.88em;
  font-weight: 700;
  letter-spacing: 0.4px;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 4px 10px rgba(46, 125, 50, 0.35);
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.15s ease;
}

button:hover {
  background: linear-gradient(180deg, #3e2723 0%, #2b1a15 100%);
  border-color: #1b120e;
}

button:active {
  transform: translateY(1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 2px 5px rgba(0, 0, 0, 0.3);
}

.download-pdf-btn {
  display: block;
  width: auto;
  min-width: 120px;
  margin: 14px auto 0;
  background: linear-gradient(180deg, #1e88e5 0%, #1565c0 100%);
  color: #fff;
  border: 1px solid #0d47a1;
  padding: 7px 18px;
  border-radius: 8px;
  font-size: 0.88em;
  font-weight: 700;
  letter-spacing: 0.4px;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 4px 10px rgba(21, 101, 192, 0.35);
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.15s ease;
}

.download-pdf-btn:hover {
  background: linear-gradient(180deg, #0d47a1 0%, #072e6b 100%);
  border-color: #072e6b;
}

.download-pdf-btn:active {
  transform: translateY(1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 2px 5px rgba(0, 0, 0, 0.3);
}

.download-pdf-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.result {
  margin-top: 22px;
  padding: 16px;
  background: #f1f8e9;
  border: 1px solid #cfe3c1;
  border-left: 5px solid #2e7d32;
  border-radius: 6px;
  color: #3e2723;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 2px 6px rgba(0, 0, 0, 0.06);
}

/* ---------- Table fit-to-screen fix ----------
   script.js injects <table> elements straight into #output/.result.
   Instead of letting a table force horizontal scrolling, every table
   is locked to the container width (table-layout: fixed) and its
   cells shrink/wrap so all columns stay visible on one screen. Font
   size and padding step down at smaller breakpoints so a 4+ column
   table never needs to be scrolled to be read. */
.result table:not(.dasha-table) {
  border-collapse: collapse;
  width: 100% !important;
  table-layout: fixed;
}

.result th:not(.dasha-table th),
.result td:not(.dasha-table td) {
  padding: 8px 6px;
  word-break: break-word;
  overflow-wrap: break-word;
  font-size: 0.95em;
}

/* Two-column (Promise + Vedic) grids: stack instead of squeezing side by side */
@media (max-width: 700px) {
  .grids {
    flex-direction: column;
  }

  .grids .grid-item {
    flex: 1 1 100%;
    padding: 10px;
  }

  .result {
    padding: 12px 10px;
  }

  .result table:not(.dasha-table) {
    font-size: 0.82em;
  }

  .result th:not(.dasha-table th),
  .result td:not(.dasha-table td) {
    padding: 5px 4px;
    line-height: 1.25;
  }
}

@media (max-width: 420px) {
  .result table:not(.dasha-table) {
    font-size: 0.72em;
  }

  .result th:not(.dasha-table th),
  .result td:not(.dasha-table td) {
    padding: 4px 3px;
    line-height: 1.15;
  }

  .container {
    padding: 12px 10px 16px;
  }
}

/* ---------- Mobile responsiveness ----------
   Works even when "Desktop site" is off, because index.php's top-left
   logo / top-right contact block are position:absolute and would
   otherwise overlap the form on narrow screens. These rules restack
   everything vertically below ~700px. */
@media (max-width: 700px) {
  body {
    display: block;
  }

  .top-left,
  .top-right {
    position: static !important;
    text-align: center !important;
    max-width: none !important;
    margin: 12px auto 0 !important;
  }

  .top-right {
    padding: 0 16px;
  }

  .container {
    margin: 12px 10px !important;
    padding: 14px 12px 16px;
    border-radius: 12px;
  }

  h1 {
    font-size: 1.1em;
    padding: 9px 16px;
  }

  input,
  select {
    padding: 6px 8px;
    margin-bottom: 10px;
    font-size: 0.86em;
  }

  label {
    font-size: 0.85em;
    padding: 3px 8px;
    margin-bottom: 5px;
  }
}

@media (max-width: 420px) {
  .container {
    margin: 8px 6px !important;
    padding: 12px 10px 14px;
  }

  h1 {
    font-size: 1em;
    letter-spacing: 0.6px;
    padding: 8px 14px;
  }

  input,
  select {
    padding: 6px 8px;
    margin-bottom: 8px;
    font-size: 0.82em;
  }

  label {
    font-size: 0.8em;
    padding: 3px 7px;
  }
}

/* Highlight classes */
.excellent {
  background-color: green;   /* ✅ Green highlight */
  color: white;
  font-weight: bold;
  padding: 8px;
  border-radius: 4px;
}

.average {
  background-color: silver;
  color: black;
  font-weight: bold;
  padding: 8px;
  border-radius: 4px;
}

.negative {
  background-color: red;     /* ✅ Red highlight */
  color: white;
  font-weight: bold;
  padding: 8px;
  border-radius: 4px;
}
/* Container for Promise + Vedic side by side */
.grids {
  display: flex;
  gap: 20px;
  justify-content: space-between;
  align-items: flex-start;
}

.grids .grid-item {
  flex: 1 1 50%;   /* each takes half width */
  border: 1px solid #ccc;
  padding: 15px;
  background: #f9f9f9;
  border-radius: 8px;
}

.grids h3 {
  margin-top: 0;
}


/* Lucky / Bad / Neutral Numbers table highlights */
.lucky-number {
  background: green !important;
  color: white !important;
  font-weight: bold;
}

.bad-number {
  background: red !important;
  color: white !important;
  font-weight: bold;
}

.neutral-number {
  background: silver !important;
  color: black !important;
  font-weight: bold;
}

.luckiest-number {
  background: orange !important;
  color: #4d2600 !important;
  font-weight: bold;
}

/* Favorable / Bad / Most Favorable Colors table highlights */
.favorable-color {
  background: green !important;
  color: white !important;
  font-weight: bold;
}

.bad-color {
  background: red !important;
  color: white !important;
  font-weight: bold;
}

.most-favorable-color {
  background: orange !important;
  color: #4d2600 !important;
  font-weight: bold;
}

/* First Name / Full Name Vibration table highlights */
.vibration-excellent {
  background: orange !important;
  color: #4d2600 !important;
  font-weight: bold;
  padding: 8px;
  border-radius: 4px;
}

.vibration-good {
  background: green !important;
  color: white !important;
  font-weight: bold;
  padding: 8px;
  border-radius: 4px;
}

.vibration-neutral {
  background: silver !important;
  color: black !important;
  font-weight: bold;
  padding: 8px;
  border-radius: 4px;
}

.vibration-bad {
  background: red !important;
  color: white !important;
  font-weight: bold;
  padding: 8px;
  border-radius: 4px;
}

/* Balance / Unbalance / Missing / Repeated / Hard / Soft Numbers table highlights */
/* NOTE: script.js injects a .summary-3d-table style with a gradient
   background-image + inset box-shadow on <td>. background-color alone
   sits underneath that gradient and never shows, so these use the
   `background` shorthand (resets the gradient image) and clear the
   inset shadow so the flat highlight color is actually visible. */
.balance-number {
  background: green !important;
  box-shadow: none !important;
  color: white !important;
  font-weight: bold;
  padding: 8px;
  border-radius: 4px;
}

.unbalance-number {
  background: red !important;
  box-shadow: none !important;
  color: white !important;
  font-weight: bold;
  padding: 8px;
  border-radius: 4px;
}

.missing-number {
  background: silver !important;
  box-shadow: none !important;
  color: black !important;
  font-weight: bold;
  padding: 8px;
  border-radius: 4px;
}

.repeated-number {
  background: red !important;
  box-shadow: none !important;
  color: white !important;
  font-weight: bold;
  padding: 8px;
  border-radius: 4px;
}

.hard-number {
  background: orange !important;
  box-shadow: none !important;
  color: #4d2600 !important;
  font-weight: bold;
  padding: 8px;
  border-radius: 4px;
}

.soft-number {
  background: silver !important;
  box-shadow: none !important;
  color: black !important;
  font-weight: bold;
  padding: 8px;
  border-radius: 4px;
}

/* Vedic Grid Yogs row highlights */
.yog-green {
  background-color: green;
  color: white;
}

.yog-yellow {
  background-color: gold;
  color: #4d3800;
}

.yog-orange {
  background-color: orange;
  color: #4d2600;
}

/* Vedic Grid Yogs - row highlight based on "Completes with" */
.cw-green {
  background-color: lightgreen;
  color: #1b4d1b;
  font-weight: bold;
}

.cw-yellow {
  background-color: gold;
  color: #4d3800;
  font-weight: bold;
}

.cw-red {
  background-color: #ff8a80;
  color: #4d0000;
  font-weight: bold;
}

/* Personality Strength / Weakness boxes */
.personality-strength {
  background-color: #e8f5e9;
  border-left: 6px solid green;
  color: #1b4d1b;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 15px;
}

.personality-strength h4 {
  margin-top: 0;
  color: green;
}

.personality-weakness {
  background-color: #ffebee;
  border-left: 6px solid red;
  color: #4d1b1b;
  padding: 15px;
  border-radius: 8px;
}

.personality-weakness h4 {
  margin-top: 0;
  color: red;
}

/* Compatibility (Personality-Destiny) highlights */
.compat-excellent {
  background-color: orange;
  color: #4d2600;
  font-weight: bold;
}

.compat-verygood {
  background-color: green;
  color: white;
  font-weight: bold;
}

.compat-good {
  background-color: green;
  color: white;
  font-weight: bold;
}

.compat-average {
  background-color: silver;
  color: black;
  font-weight: bold;
}

.compat-belowaverage {
  background-color: red;
  color: white;
  font-weight: bold;
}

.compat-negative {
  background-color: red;
  color: white;
  font-weight: bold;
}

.compat-deadly {
  background-color: red;
  color: white;
  font-weight: bold;
}

.compat-verydeadly {
  background-color: red;
  color: white;
  font-weight: bold;
}

/* Lucky Profession box */
.lucky-profession {
  background-color: #fff8e1;
  border-left: 6px solid #f9a825;
  color: #4d3800;
  padding: 15px;
  border-radius: 8px;
  margin-top: 15px;
}

.lucky-profession h4 {
  margin-top: 0;
  color: #f9a825;
}

.lucky-profession ul {
  margin: 0;
  padding-left: 20px;
}
