/* =============================================================
   WebDriverUniversity — Shared Subpage Theme (subpage.css)
   Single source of truth for all subpage cosmetics.
   Replaces subpage-theme.css. Loads LAST in <head>.
   Uses !important where needed to beat Bootstrap 3 and
   per-page style.css. Never touches IDs, name attrs,
   event handlers, or HTML structure.
   ============================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* --- Design tokens --- */
:root {
  --bg:          #0f0f0f;
  --surface:     #181818;
  --surface-2:   #1f1f1f;
  --border:      #2a2a2a;
  --accent:      #f45950;
  --accent-glow: rgba(244, 89, 80, 0.35);
  --text:        #ededed;
  --text-dim:    #9a9a9a;
}

/* =============================================
   1. RESET & BASE
   ============================================= */
*, *::before, *::after {
  box-sizing: border-box;
}

html,
body {
  background-color: var(--bg) !important;
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  padding-top: 84px;
}

/* Pages without a fixed navbar (Login-Portal, contact-form-thank-you) */
body.no-navbar {
  padding-top: 0 !important;
}

/* =============================================
   2. NAVBAR
   html body prefix beats Bootstrap 3 specificity
   ============================================= */
html body .navbar,
html body .navbar.navbar-inverse,
html body .navbar.navbar-inverse.navbar-fixed-top,
html body nav.navbar {
  background-color: rgba(15, 15, 15, 0.92) !important;
  background-image: none !important;
  border: none !important;
  border-bottom: 1px solid var(--border) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  min-height: 84px !important;
  margin-bottom: 0 !important;
}

html body .navbar .container,
html body .navbar .container-fluid {
  height: 84px;
  display: flex;
  align-items: center;
  padding: 0 32px;
}

html body .navbar-header {
  display: flex !important;
  align-items: center;
  float: none !important;
}

html body #nav-title,
html body .navbar-brand {
  color: #ededed !important;
  font-weight: 700 !important;
  font-size: 16px !important;
  letter-spacing: -0.01em;
  height: auto !important;
  padding: 4px 0 !important;
  display: inline-flex !important;
  align-items: center;
  gap: 10px;
  text-shadow: none;
  line-height: 1;
}

html body #nav-title::before,
html body .navbar-brand::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--accent-glow);
  flex-shrink: 0;
}

html body #nav-title:hover,
html body .navbar-brand:hover,
html body .navbar-brand:focus {
  color: var(--accent) !important;
}

html body .navbar-toggle {
  border-color: var(--border) !important;
  background-color: transparent !important;
  margin-top: 22px;
}

html body .navbar-toggle:hover,
html body .navbar-toggle:focus {
  background-color: var(--surface) !important;
}

html body .navbar-toggle .icon-bar {
  background-color: var(--text) !important;
}

/* =============================================
   3. HEADINGS
   ============================================= */
#main-header,
h1, h2, h3, h4 {
  color: var(--text);
}

h2 {
  font-size: 26px;
}

/* =============================================
   4. FOOTER
   ============================================= */

/* <footer> inside <blockquote> is a citation — reset page-footer styles */
html body blockquote footer {
  background-color: transparent !important;
  border-top: none !important;
  padding: 0 !important;
  position: static !important;
  height: auto !important;
}

html body footer,
html body .footer {
  background-color: var(--bg) !important;
  border-top: 1px solid var(--border) !important;
  padding: 20px 32px;
  color: var(--text-dim) !important;
  font-size: 13px;
}

html body footer p,
html body .footer p {
  color: var(--text-dim) !important;
}

html body footer a,
html body .footer a {
  color: var(--text-dim) !important;
  text-decoration: none;
}

html body footer a:hover,
html body .footer a:hover {
  color: var(--accent) !important;
}

/* =============================================
   5. LINKS
   ============================================= */
a {
  color: var(--accent);
}

a:hover {
  color: #ff7276;
}

/* =============================================
   6. MODALS — Bootstrap 3 CSS-only re-skin
   data-toggle, data-target, data-dismiss untouched
   ============================================= */
html body .modal-content {
  background-color: var(--surface) !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
}

html body .modal-header {
  border-bottom: 1px solid var(--border) !important;
  background-color: var(--surface-2) !important;
}

html body .modal-footer {
  border-top: 1px solid var(--border) !important;
}

html body .modal-title {
  color: var(--text) !important;
}

html body .modal .close {
  color: var(--text-dim) !important;
  opacity: 0.8;
  text-shadow: none;
}

html body .modal .close:hover {
  color: var(--text) !important;
  opacity: 1;
}

html body .modal-body p {
  color: var(--text) !important;
}

/* Bootstrap modal backdrop — keep original opacity behaviour */
.modal-backdrop.in {
  opacity: 0.5;
}

/* =============================================
   7. COMMON CONTAINERS
   ============================================= */
html body .thumbnail {
  background-color: var(--surface) !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
}

html body .section-title {
  background-color: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

html body .section-title h1 {
  color: var(--accent);
}

html body .caption h4 {
  color: var(--text);
}

html body .caption p {
  color: var(--text-dim);
}

/* Page-Object-Model: section_header was #E62C21 in per-page CSS */
html body .section_header {
  color: var(--accent) !important;
}

/* Page-Object-Model: carousel red border */
html body #carousel-example-generic {
  border-color: var(--border) !important;
}

/* =============================================
   8. TABLES
   #t01/#t02 forced with !important (Data-Table page).
   Generic table rule has NO !important so jQuery UI
   datepicker calendar tables (more specific selectors)
   keep their own styling naturally.
   ============================================= */
html body #t01,
html body #t02 {
  background-color: var(--surface) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

html body #t01 th,
html body #t02 th {
  background-color: var(--surface-2) !important;
  color: var(--text) !important;
}

html body #t01 tr:nth-child(even),
html body #t02 tr:nth-child(even) {
  background-color: var(--surface-2) !important;
}

/* Generic (no !important — jQuery UI specificity wins in datepicker context) */
html body table {
  background-color: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

html body th {
  background-color: var(--surface-2);
  color: var(--text);
}

html body tr:nth-child(even) {
  background-color: var(--surface-2);
}

/* jQuery UI datepicker — restore via higher-specificity inherit rules */
html body .ui-widget table,
html body .ui-widget th,
html body .ui-widget td,
html body .ui-widget tr:nth-child(even) {
  background-color: inherit;
  color: inherit;
  border-color: inherit;
}

/* =============================================
   9. FORM ELEMENTS
   Excluded: input[type="file"] — File-Upload page keeps browser default
   Excluded: input[type="checkbox"], input[type="radio"]
   Datepicker calendar buttons use .ui-button — not targeted here
   ============================================= */
html body input[type="text"],
html body input[type="email"],
html body input[type="password"],
html body input[type="tel"],
html body textarea,
html body select {
  background-color: var(--surface-2) !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
  border-radius: 6px;
  padding: 8px 12px;
}

html body input[type="text"]::placeholder,
html body input[type="email"]::placeholder,
html body input[type="password"]::placeholder,
html body input[type="tel"]::placeholder,
html body textarea::placeholder {
  color: var(--text-dim) !important;
  opacity: 1;
}

html body input[type="text"]:focus,
html body input[type="email"]:focus,
html body input[type="password"]:focus,
html body input[type="tel"]:focus,
html body textarea:focus,
html body select:focus {
  border-color: var(--accent) !important;
  outline: none !important;
  box-shadow: 0 0 0 2px rgba(244, 89, 80, 0.15) !important;
}

/* =============================================
   10. BUTTONS — generic Bootstrap btn-default only
   Challenge-specific buttons kept by per-page CSS
   ============================================= */
html body .btn-default {
  background-color: var(--surface-2) !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
}

html body .btn-default:hover,
html body .btn-default:focus {
  background-color: var(--surface) !important;
  border-color: var(--accent) !important;
  color: var(--text) !important;
}

/* =============================================
   11. SCROLLBAR (cosmetic only)
   ============================================= */
::-webkit-scrollbar          { width: 6px; }
::-webkit-scrollbar-track    { background: var(--bg); }
::-webkit-scrollbar-thumb    { background: var(--border); }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ================================================================
   EDGE CASE PROTECTIONS — STEP 6
   Elements that must keep their original challenge appearance.
   Most are naturally protected because this file only targets
   class selectors (.thumbnail, .section-title, etc.) or
   explicit input types — not these element IDs.
   Explicit overrides added below as a safety net.
   ================================================================ */

/* --- Actions: jQuery UI draggable/droppable, interaction boxes ---
   These IDs carry no .thumbnail or other targeted class, so they
   are naturally protected — no subpage.css rule reaches them.
   Per-page style.css sets their colours directly. ---  */

/* --- Scrolling page: coloured zone divs --- */
html body #zone1,
html body #zone2,
html body #zone3,
html body #zone4 {
  background-color: revert !important;
  color:            revert !important;
}

/* --- Login-Portal: bubble animation — dark theme colors --- */
html body .bg-bubbles {
  background-color: #0f0f0f !important;
}
html body .bg-bubbles li {
  background-color: rgba(244, 89, 80, 0.06) !important;
}

/* --- Login-Portal: form inputs — explicit dark theme (ids used as selectors in course tests) --- */
html body #text,
html body #password {
  background-color: #1f1f1f !important;
  border: 1px solid #2a2a2a !important;
  color: #ededed !important;
}

/* --- Ajax-Loader: spinner only — #button1 styled in Ajax-Loader/css/style.css --- */
html body #loader {
  background-color: revert !important;
}

/* --- jQuery UI: autocomplete dropdown + datepicker popup ---
   Positioning and z-index untouched throughout this file.
   Restore visual styles so jQuery UI theme applies. */
html body .ui-autocomplete,
html body .ui-autocomplete *,
html body .ui-menu,
html body .ui-menu * {
  background-color: revert !important;
  color:            revert !important;
  border-color:     revert !important;
}
