﻿/* ====== GOVT TYPING SITE - MAIN STYLESHEET ====== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: #eef1f5;
  color: #000;
  font: 14px Arial, sans-serif;
  min-height: 100vh;
}

a {
  text-decoration: none;
  color: #563D64;
}
a:hover {
  text-decoration: underline;
}

/* ===== NAVBAR ===== */
.navbar {
  background: #fff;
  border-top: 4px solid #563D64;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  padding: 0 15px;
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.navbar-brand img {
  border-radius: 50%;
  height: 50px;
  width: 50px;
}
.navbar-brand span {
  font-size: 20px;
  font-weight: bold;
  color: #563D64;
}
.nav-links {
  list-style: none;
  display: flex;
  gap: 5px;
  align-items: center;
  flex-wrap: wrap;
}
.nav-links li a {
  display: block;
  padding: 18px 12px;
  color: #555;
  font-size: 13px;
  font-weight: bold;
}
.nav-links li a:hover,
.nav-links li a.active {
  color: #563D64;
  text-decoration: none;
  border-bottom: 3px solid #563D64;
}
.nav-links li a.sso-nav-btn {
  background: #563D64;
  border-bottom: 0;
  border-radius: 4px;
  color: #fff;
  margin-left: 4px;
  padding: 9px 14px;
}
.nav-links li a.sso-nav-btn:hover {
  background: #422d4d;
  border-bottom: 0;
  color: #fff;
}
.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.highlight-settings {
  align-items: center;
  background: #f4f4f4;
  border: 1px solid #d4d4d4;
  border-radius: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 10px;
  padding: 8px 10px;
}
.highlight-settings label {
  align-items: center;
  display: inline-flex;
  gap: 6px;
  font-weight: bold;
}
.highlight-settings input[type="number"] {
  border: 1px solid #aaa;
  border-radius: 3px;
  padding: 5px 7px;
  width: 72px;
}
.highlight-settings.locked { opacity: 0.65; }

/* ===== HERO SECTION (Home Page) ===== */
.hero-section {
  background: linear-gradient(135deg, #563D64 0%, #2f6d7a 100%);
  color: #fff;
  padding: 34px 20px;
  text-align: center;
  border-bottom: 5px solid #FEC151;
}
.hero-section h1 {
  font-size: 36px;
  margin-bottom: 12px;
  color: #fff;
}
.hero-section p {
  font-size: 18px;
  margin-bottom: 30px;
  opacity: 0.9;
}
.hero-btn {
  display: inline-block;
  background: #FEC151;
  color: #563D64;
  padding: 14px 35px;
  border-radius: 30px;
  font-size: 16px;
  font-weight: bold;
  border: none;
  cursor: pointer;
  text-decoration: none;
  margin: 5px;
  transition: background 0.3s;
}
.hero-btn:hover {
  background: #E6A832;
  color: #333;
  text-decoration: none;
}
.hero-btn.secondary {
  background: transparent;
  border: 2px solid #FEC151;
  color: #FEC151;
}
.hero-btn.secondary:hover {
  background: #FEC151;
  color: #563D64;
}

/* ===== CARDS / FEATURE TILES ===== */
.section-wrap {
  max-width: 1100px;
  margin: 30px auto;
  padding: 0 15px;
}
.portal-strip {
  background: #563D64;
  color: #fff;
  font-size: 13px;
  padding: 8px 15px;
}
.portal-strip-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.portal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  max-width: 1100px;
  margin: 25px auto;
  padding: 0 15px;
}
.portal-panel,
.portal-sidebar {
  background: #fff;
  border: 1px solid #d4d7dc;
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.portal-panel-title,
.portal-sidebar-title {
  background: #563D64;
  color: #fff;
  padding: 10px 14px;
  font-size: 16px;
  font-weight: bold;
}
.portal-list {
  list-style: none;
  padding: 12px 16px;
}
.portal-list li {
  border-bottom: 1px solid #ececec;
  padding: 9px 0;
}
.portal-list li:last-child { border-bottom: none; }
.portal-list a {
  color: #27384a;
  font-weight: bold;
}
.portal-sidebar-body {
  padding: 14px;
  line-height: 1.6;
  color: #444;
}
.section-title {
  text-align: center;
  font-size: 24px;
  color: #563D64;
  margin-bottom: 25px;
  font-weight: bold;
}
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.18);
}
.card-header-bar {
  height: 8px;
}
.card-body {
  padding: 20px;
}
.card-icon {
  font-size: 36px;
  margin-bottom: 10px;
}
.card h3 {
  font-size: 17px;
  color: #333;
  margin-bottom: 8px;
}
.card p {
  font-size: 13px;
  color: #666;
  margin-bottom: 15px;
  line-height: 1.5;
}
.card-link {
  display: inline-block;
  background: #563D64;
  color: #fff;
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: bold;
  transition: background 0.2s;
}
.card-link:hover {
  background: #7B5C8A;
  color: #fff;
  text-decoration: none;
}

/* color variants */
.bar-purple { background: #563D64; }
.bar-green  { background: #71B938; }
.bar-blue   { background: #3470D6; }
.bar-orange { background: #E06739; }

/* ===== STATS STRIP ===== */
.stats-strip {
  background: #563D64;
  color: #fff;
  padding: 20px 15px;
  text-align: center;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 40px;
}
.stat-item .stat-number {
  font-size: 32px;
  font-weight: bold;
  color: #FEC151;
}
.stat-item .stat-label {
  font-size: 14px;
  margin-top: 4px;
}

/* ===== TYPING TUTOR PAGE ===== */
.tutor-wrap {
  max-width: none;
  margin: 8px auto;
  padding: 0 10px 10px;
  width: 100%;
}
.tutor-header-panel {
  background: linear-gradient(to bottom, #E06739, #F5924C);
  color: #fff;
  padding: 10px 15px;
  border-radius: 5px 5px 0 0;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.tutor-body {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 0 0 5px 5px;
  padding: 10px;
}

/* Time bar */
.time-info-bar {
  background: #E8E8E8;
  padding: 6px 12px;
  border-radius: 4px;
  display: flex;
  gap: 25px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.time-info-bar span {
  font-size: 14px;
  color: #333;
}
.time-info-bar .val {
  font-size: 18px;
  font-weight: bold;
  color: #000;
  margin-left: 6px;
}
#timer-val { color: #E06739; }

/* Chunk indicator */
.chunk-label {
  background: #545454;
  color: #fff;
  display: inline-block;
  padding: 4px 14px;
  border-radius: 3px;
  font-size: 14px;
  margin-bottom: 10px;
}

/* Text display area */
.passage-box {
  border: 1px solid #ECECEC;
  background: #FFFAAE;
  padding: 12px 15px;
  font-size: 19px;
  font-family: Arial, sans-serif;
  color: #333;
  min-height: 82px;
  line-height: 1.8;
  margin-bottom: 12px;
  border-radius: 4px;
}
.passage-box .word {
  display: inline;
  padding: 0 2px;
  border-radius: 2px;
}
.passage-box .word.current {
  background: #FFD700;
  border-bottom: 2px solid #E06739;
}
.passage-box .word.correct {
  color: #2d8a2d;
}
.passage-box .word.incorrect {
  color: #cc0000;
  text-decoration: underline wavy #cc0000;
}
.passage-box .word.typed {
  color: #888;
}

/* Typing textarea */
.typing-area-wrap {
  position: relative;
  margin-bottom: 12px;
}
#write_text {
  width: 100%;
  min-height: 22vh;
  border: 2px solid #563D64;
  border-radius: 4px;
  padding: 10px;
  font-family: Arial, sans-serif;
  font-size: 18px;
  resize: vertical;
  outline: none;
  transition: border-color 0.3s;
}
#write_text:focus {
  border-color: #E06739;
  box-shadow: 0 0 5px rgba(224,103,57,0.3);
}

/* Chunk nav buttons */
.chunk-nav {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.btn-submit {
  background: linear-gradient(to bottom, #71B938, #5A9A28);
  color: #fff;
  border: 1px solid #4A8A1A;
  border-radius: 4px;
  padding: 8px 28px;
  font-size: 16px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.2s;
}
.btn-submit:hover {
  background: linear-gradient(to bottom, #5A9A28, #4A8A1A);
}
.btn-repeat {
  background: linear-gradient(to bottom, #E06739, #F5924C);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 8px 20px;
  font-size: 14px;
  cursor: pointer;
  font-weight: bold;
}
.btn-repeat:hover {
  background: linear-gradient(to bottom, #C05629, #D07A3A);
}
.chunk-step-btn {
  display: none;
}

/* Language tabs */
.lang-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 10px;
  border-bottom: 2px solid #ddd;
}
.lang-tab {
  padding: 8px 20px;
  cursor: pointer;
  font-size: 15px;
  font-weight: bold;
  background: #fafafa;
  color: #555;
  border: 1px solid #ddd;
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  margin-right: 3px;
  transition: background 0.2s;
}
.lang-tab.active {
  background: linear-gradient(to bottom, #A1B956, #87AB17);
  color: #fff;
  border-color: #87AB17;
}
.lang-tab:hover:not(.active) {
  background: #e8e8e8;
}

/* Progress bar */
.typing-progress-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.chunk-dot {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  background: #ddd;
  color: #555;
}
.chunk-dot.active {
  background: #E06739;
  color: #fff;
}
.chunk-dot.done {
  background: #71B938;
  color: #fff;
}
.progress-label {
  min-width: 50px;
  background: #545454;
  color: #fff;
  text-align: center;
  padding: 5px 8px;
  font-size: 14px;
}
.progress-outer {
  flex: 1;
  background: #efefef;
  border: 1px solid #ADA8A8;
  height: 20px;
  border-radius: 3px;
  overflow: hidden;
}
.progress-inner {
  height: 100%;
  background: linear-gradient(to right, #71B938, #A1D35A);
  transition: width 0.4s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: bold;
  color: #333;
}

/* ===== RESULT PAGE ===== */
.result-wrap {
  max-width: 900px;
  margin: 25px auto;
  padding: 0 15px 40px;
}
.result-header {
  background: linear-gradient(to bottom, #E06739, #F5924C);
  color: #fff;
  padding: 12px 18px;
  border-radius: 5px 5px 0 0;
  font-size: 18px;
  font-weight: bold;
}
.result-body {
  background: #fff;
  border: 1px solid #ddd;
  border-top: none;
  border-radius: 0 0 5px 5px;
  padding: 20px;
}
.result-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin-bottom: 25px;
}
.stat-box {
  border-radius: 6px;
  padding: 12px 15px;
  color: #fff;
  text-align: center;
  height: 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}
.stat-box .stat-title {
  font-size: 14px;
  margin-bottom: 4px;
}
.stat-box .stat-value {
  font-size: 26px;
  font-weight: bold;
}
.stat-box .stat-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}
.bg-purple { background-color: #9787F7; }
.bg-purple .stat-icon { background: #8374DE; }
.bg-tile   { background-color: #5DC5E2; }
.bg-tile .stat-icon   { background: #51B1CC; }
.bg-blue   { background-color: #607FE6; }
.bg-blue .stat-icon   { background: #5069BD; }
.bg-green  { background-color: #95CA0D; }
.bg-green .stat-icon  { background: #7BA01A; }
.bg-red    { background-color: #E67DCC; }
.bg-red .stat-icon    { background: #D074B9; }
.bg-navy   { background-color: #4FBDFF; }
.bg-navy .stat-icon   { background: #49A7E0; }

/* Typed text comparison */
.comparison-section fieldset {
  border: 1px solid #6F6F6F;
  padding: 10px 15px 15px;
  margin-bottom: 18px;
  background: #F5F5F5;
  border-radius: 4px;
}
.comparison-section legend {
  background: #545454;
  color: #fff;
  padding: 5px 14px;
  border-radius: 3px;
  font-size: 14px;
  font-weight: normal;
}
.text-compare-box {
  font-size: 16px;
  font-family: Arial, sans-serif;
  line-height: 1.8;
  padding: 10px;
}
ins.diff-ok  { color: #000; background: none; text-decoration: none; }
del.diff-err { color: red; background: #fdd; text-decoration: none; }

/* Keyboard layout (optional) */
.keyboard-wrap {
  background: #444;
  padding: 12px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: fit-content;
  margin: 0 auto;
}
.kb-row {
  display: flex;
  gap: 5px;
  justify-content: center;
}
.kb-key {
  background: #e8e8e8;
  border: 1px solid #999;
  border-radius: 4px;
  min-width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  cursor: default;
  transition: background 0.15s;
  box-shadow: 0 2px 0 #888;
}
.kb-key.wide { min-width: 60px; }
.kb-key.wider { min-width: 90px; }
.kb-key.widest { min-width: 200px; }
.kb-key.active {
  background: #FEC151;
  border-color: #D69E31;
  box-shadow: 0 1px 0 #888;
}

/* ===== FOOTER ===== */
.site-footer {
  display: none;
  background: #333;
  color: #ccc;
  text-align: center;
  padding: 18px 15px;
  font-size: 13px;
  margin-top: 30px;
}
.site-footer a {
  color: #FEC151;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .hero-section h1 { font-size: 26px; }
  .navbar-inner { align-items: flex-start; flex-direction: column; padding: 8px 0; }
  .nav-links { display: flex; }
  .nav-links li a { padding: 9px 8px; }
  .time-info-bar { gap: 12px; }
  .tutor-wrap, .result-wrap { padding: 0 8px 30px; }
  .portal-layout { grid-template-columns: 1fr; }
}

fieldset:has(#keyboard_wrap) {
  display: none;
}
