/* WordWeb Modern Styles - Bootstrap 5 Enhancements */

/* Can streamline light/dark using https://jrson.me/blog/revisiting-the-perfect-dark-mode-switch-in-2024/ */

/* CSS Custom Properties for consistent theming */
:root {
  /* Light mode colors (default) */
  --primary-color: #336666;
  --secondary-color: #2f4d58;
  --accent-color: #f49434;
  --text-dark: #1c3939;
  --text-light: #2f4c5a;
  --text-body: #333;
  --text-muted: #777;
  --background-light: #ffffff;
  --background-body: #ffffff;
  --background-section: #ffffff;
  --background-alt: #f8f9fa;
  --border-color: #ddd;
  --border-color-light: #e5e5e5;
  --shadow-color: rgba(0, 0, 0, 0.1);
  --text-on-primary: #ffffff;
  --text-on-secondary: #ffffff;
  --warning-bg: #ecd672;
  --warning-text: #000;
  --link-color: #528fcc;
  --link-hover: #1f5c99;

  /* Layout */
  --border-radius: 0.375rem;
  --transition-speed: 0.3s;
  --font-family-primary: "Raleway", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-family-secondary: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Dark mode colors - consolidated approach to avoid duplication */
@media (prefers-color-scheme: dark) {
  :root {
    --accent-color: #ff9f47;
    --text-dark: #e0e0e0;
    --text-light: #b0b0b0;
    --text-body: #e0e0e0;
    --text-muted: #a0a0a0;
    --background-light: #1a1a1a;
    --background-body: #1a1a1a;
    --background-section: #2a2a2a;
    --background-alt: #333333;
    --border-color: #444;
    --border-color-light: #555;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --text-on-primary: #dddddd;
    --text-on-secondary: #dddddd;
    --warning-bg: #6b5a1f;
    --warning-text: #fff;
    --link-color: #6ba3d6;
    --link-hover: #4a8bc2;
  }
}

/* Manual dark mode override - inherits same values as prefers-color-scheme */
[data-theme="dark"] {
  --accent-color: #ff9f47;
  --text-dark: #e0e0e0;
  --text-light: #b0b0b0;
  --text-body: #e0e0e0;
  --text-muted: #a0a0a0;
  --background-light: #1a1a1a;
  --background-body: #1a1a1a;
  --background-section: #2a2a2a;
  --background-alt: #333333;
  --border-color: #444;
  --border-color-light: #555;
  --shadow-color: rgba(0, 0, 0, 0.3);
  --text-on-primary: #dddddd;
  --text-on-secondary: #dddddd;
  --warning-bg: #6b5a1f;
  --warning-text: #fff;
  --link-color: #6ba3d6;
  --link-hover: #4a8bc2;
}

/* Manual light mode override */
[data-theme="light"] {
  --text-dark: #1c3939;
  --text-light: #2f4c5a;
  --text-body: #333;
  --text-muted: #777;
  --background-light: #ffffff;
  --background-body: #ffffff;
  --background-section: #ffffff;
  --background-alt: #f8f9fa;
  --border-color: #ddd;
  --border-color-light: #e5e5e5;
  --shadow-color: rgba(0, 0, 0, 0.1);
  --text-on-primary: #ffffff;
  --text-on-secondary: #ffffff;
  --warning-bg: #ecd672;
  --warning-text: #000;
  --link-color: #528fcc;
  --link-hover: #1f5c99;
}

/* Modern font stack and dark mode support */
body {
  font-family: var(--font-family-secondary);
  line-height: 1.6;
  background-color: var(--background-body);
  color: var(--text-body);
  transition:
    background-color var(--transition-speed) ease,
    color var(--transition-speed) ease;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-family-primary);
}

body,
form,
td,
input,
textarea,
select,
.normtext,
p,
li,
.th {
  font-family: var(--font-family-secondary) !important;
}

.th {
  font-weight: 600;
}

/* CSS-only info icons - styling moved to wordweb-essential.css */

/* Hero section button improvements */
.hero-btn {
  font-size: 16px;
  font-weight: 600;
  padding: 12px 8px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  min-width: 0; /* Allow buttons to shrink */
}

/* Large screens - full text */
@media (min-width: 992px) {
  .hero-btn {
    font-size: 16px;
    padding: 12px 20px;
  }
}

/* Medium screens - slightly smaller */
@media (min-width: 768px) and (max-width: 991px) {
  .hero-btn {
    font-size: 14px;
    padding: 10px 12px;
  }
}

/* Small screens - compact */
@media (min-width: 576px) and (max-width: 767px) {
  .hero-btn {
    font-size: 13px;
    padding: 8px 8px;
  }
}

/* Mobile - stack vertically */
@media (max-width: 575px) {
  .hero-btn {
    font-size: 14px;
    padding: 10px 15px;
  }

  /* Stack buttons vertically on mobile */
  .hero-btn-container .col-6 {
    flex: 0 0 100%;
    max-width: 100%;
    margin-bottom: 10px;
  }
}

/* Navbar enhancements */
.navbar {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all var(--transition-speed) ease;
}

.navbar-brand .titlename {
  font-family: var(--font-family-primary);
  color: var(--text-dark);
  font-weight: 600;
  font-size: 1.1rem;
  line-height: 1.1;
}

.navbar-brand .subhead {
  color: var(--text-light);
  font-size: 0.875rem;
}

/* Navbar brand styling - clean and simple */
.navbar-brand {
  margin-right: 1rem;
}

.navbar-brand .subhead {
  font-size: 0.875rem;
  color: var(--text-light);
}

.nav-link {
  font-weight: 500;
  transition: color var(--transition-speed) ease;
  white-space: nowrap; /* Prevent menu items from wrapping to multiple lines */
}

.nav-link:hover {
  color: var(--primary-color) !important;
}

/* Ensure navbar items don't wrap */
.navbar-nav .nav-item {
  white-space: nowrap;
}

/* Responsive navbar adjustments - Back to navbar-expand-md */
@media (max-width: 991px) {
  .navbar-nav .nav-item {
    white-space: normal; /* Allow wrapping on mobile when collapsed */
  }
}

/* Button improvements */
.btn {
  border-radius: var(--border-radius);
  font-weight: 500;
  transition: all var(--transition-speed) ease;
  text-decoration: none !important; /* Remove underlines from button links */
}

.btn:hover,
.btn:focus {
  text-decoration: none !important; /* Ensure no underlines on hover/focus */
}

/* Specific button link fixes */
a.btn,
a.btn:hover,
a.btn:focus,
a.btn:active {
  text-decoration: none !important;
}

/* Fix for all button classes */
.btn-blue,
.btn-blue:hover,
.btn-blue:focus,
.btn-theme,
.btn-theme:hover,
.btn-theme:focus {
  text-decoration: none !important;
}

.js-buy {
  background-color: #1f5c99;
  border: none;
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius);
  font-weight: 600;
  transition: all var(--transition-speed) ease;
  cursor: pointer;
}

.js-buy:hover {
  background-color: var(--link-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Process steps styling */
.process-2 {
  background-color: var(--secondary-color);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  text-align: center;
  margin-bottom: 1rem;
}

#footer a {
  color: #ccc;
  text-decoration: none;
  transition: color var(--transition-speed) ease;
}

#footer a:hover {
  color: white;
}

/* Removed duplicate titleline-footer definition - using the one in wordweb-essential.css */

/* Copyright section */
#copyright {
  background-color: #1a3a3a;
  color: #ccc;
  padding: 1rem 0;
  font-size: 0.875rem;
}

#copyright a {
  color: #ccc;
  text-decoration: none;
}

#copyright a:hover {
  color: white;
}

/* Back to top button */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background-color: var(--primary-color);
  color: white;
  padding: 0.75rem;
  border-radius: 50%;
  text-decoration: none;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-speed) ease;
  z-index: 1000;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-indent: 0;
  font-size: 0;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"/></svg>');
  background-size: 24px 24px;
  background-position: center;
  background-repeat: no-repeat;
}

.back-to-top.show {
  opacity: 0.8;
  visibility: visible;
}

.back-to-top:hover {
  opacity: 1;
  transform: translateY(-2px);
  color: white;
}

/* When near footer, increase bottom spacing to avoid overlap with theme toggle */
.back-to-top.near-footer {
  bottom: 6rem;
}

/* Machine hint styling - moved to later section with dark mode support */

/* Simple mobile responsive improvements */
@media (max-width: 576px) {
  .back-to-top {
    bottom: 1rem;
    right: 1rem;
    padding: 0.5rem;
    width: 40px;
    height: 40px;
    background-size: 20px 20px;
  }
}

/* Additional mobile optimizations */
@media (max-width: 576px) {
  .sec-home {
    padding: 20px 0;
  }

  .process-1 h3,
  .process-2 h3 {
    font-size: 15px;
    padding: 15px 20px;
  }

  .process-content {
    padding: 15px 20px 15px;
  }
}

/* Form improvements with dark mode */
.form-control {
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  background-color: var(--background-section);
  color: var(--text-body);
  transition:
    border-color var(--transition-speed) ease,
    box-shadow var(--transition-speed) ease,
    background-color var(--transition-speed) ease,
    color var(--transition-speed) ease;
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(51, 102, 102, 0.25);
  background-color: var(--background-section);
  color: var(--text-body);
}

/* Table improvements */
.table {
  border-radius: var(--border-radius);
  overflow: hidden;
}

.table th {
  background-color: var(--secondary-color);
  color: white;
  border: none;
  font-weight: 600;
}

/* Card-like sections */
.sec {
  padding: 3rem 0;
  background-color: var(--background-section);
  color: var(--text-body);
  transition:
    background-color var(--transition-speed) ease,
    color var(--transition-speed) ease;
}

.sec-blue {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: var(--text-on-primary);
}

.sec-hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

/* Titleline styling moved to wordweb-essential.css for consistency */

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus indicators */
.btn:focus,
.nav-link:focus,
.form-control:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Cookie consent banner styling */
#cc-main {
  font-family: var(--font-family-secondary) !important;
}

#cc-main .cm {
  background-color: var(--background-light) !important;
  border: 1px solid #ddd !important;
  border-radius: var(--border-radius) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

#cc-main .cm__btn {
  background-color: var(--primary-color) !important;
  border: none !important;
  border-radius: var(--border-radius) !important;
  font-weight: 500 !important;
  transition: all var(--transition-speed) ease !important;
}

#cc-main .cm__btn:hover {
  background-color: var(--secondary-color) !important;
  transform: translateY(-1px) !important;
}

#cc-main .cm__btn--secondary {
  background-color: transparent !important;
  color: var(--text-dark) !important;
  border: 1px solid #ddd !important;
}

#cc-main .cm__btn--secondary:hover {
  background-color: #f8f9fa !important;
  border-color: var(--primary-color) !important;
}

/* Fix list markers - targeted approach */
/* Navigation should have NO bullets */
.navbar-nav,
.navbar-nav ul,
.navbar-nav li {
  list-style: none !important;
}

/* Content lists should use arrows */
.sec ul {
  list-style: none;
  padding: 0 0 0 10px;
  margin: 0 0 15px;
}

.sec ul li {
  line-height: 1.5;
  margin: 0 0 15px;
}

/* Home page two-panel layout - Bootstrap 5 responsive design */
.sec-home {
  padding: 50px 0;
  font-size: 14px;
  line-height: 1.5;
}

/* Ensure equal height columns at all breakpoints */
.sec-home .row {
  display: flex;
  flex-wrap: wrap;
}

.sec-home .col-lg-6,
.sec-home .col-md-6,
.sec-home .col-sm-12 {
  display: flex;
  flex-direction: column;
}

/* Responsive behavior - always 2 columns on medium+ screens, 1 column on small */
@media (min-width: 768px) {
  .sec-home .col-lg-6,
  .sec-home .col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
  }
}

@media (max-width: 767px) {
  .sec-home .col-sm-12 {
    flex: 0 0 100%;
    max-width: 100%;
    margin-bottom: 2rem;
  }
}

/* Process boxes styling - cleaner design */
.process-1,
.process-2 {
  position: relative;
  width: 100%;
  background: #528fcc;
  padding: 20px 30px;
  color: white;
  border-radius: 5px 5px 0 0;
}

.process-1 h3,
.process-2 h3,
.process-3 h3 {
  color: #fff;
  font-size: 17px;
  text-transform: uppercase;
  margin: 0;
  font-weight: 600;
  line-height: 1.2;
}

.process-1 p,
.process-2 p,
.process-3 p {
  color: #f5f5f5;
  font-size: 12px;
  margin: 0;
  line-height: 16px;
}

/* Process content styling - improved for Bootstrap 5 with dark mode */
.process-content {
  position: relative;
  margin-bottom: 20px;
  overflow: hidden;
  padding: 20px 30px 20px;
  background: var(--background-section);
  border: 1px solid var(--border-color);
  border-top: none;
  border-radius: 0 0 5px 5px;
  flex: 1;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 4px var(--shadow-color);
  min-height: 400px; /* Ensure minimum height for consistency */
  color: var(--text-body);
  transition:
    background-color var(--transition-speed) ease,
    border-color var(--transition-speed) ease,
    color var(--transition-speed) ease;
}

/* Process content list styling moved to wordweb-essential.css */
.process-content ul {
  flex: 1;
  margin-bottom: 1rem;
}

.process-content .text-center,
.process-content div.text-center {
  margin-top: auto;
  padding-top: 1rem;
}

/* Button styling improvements */
.process-content .btn {
  white-space: nowrap;
  min-width: 160px; /* Increased for better consistency */
  display: inline-block;
}

/* Button sizing for different screen sizes */
.process-content .text-center .btn,
.process-content div.text-center .btn {
  margin: 0.25rem 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Desktop and large tablets */
@media (min-width: 992px) {
  .process-content .text-center .btn,
  .process-content div.text-center .btn {
    width: 180px;
    font-size: 13px;
    padding: 0.5rem 0.75rem;
  }
}

/* Medium tablets */
@media (min-width: 768px) and (max-width: 991px) {
  .process-content .text-center .btn,
  .process-content div.text-center .btn {
    width: 160px;
    font-size: 12px;
    padding: 0.5rem 0.5rem;
  }
}

/* Small tablets */
@media (min-width: 577px) and (max-width: 767px) {
  .process-content .text-center .btn,
  .process-content div.text-center .btn {
    width: 140px;
    font-size: 11px;
    padding: 0.4rem 0.4rem;
  }
}

/* Mobile */
@media (max-width: 576px) {
  .process-content .text-center .btn,
  .process-content div.text-center .btn {
    display: block;
    width: 100%;
    margin: 0.25rem 0;
    font-size: 14px;
  }

  .process-content .me-2 {
    margin-right: 0 !important;
  }
}

/* Ordering page improvements - restore original styling */
.qty,
.pqty {
  width: 60px;
  padding: 5px 10px;
  border: 1px solid #ddd;
  text-align: center;
  background: #fff;
  font-size: 14px;
  margin: 0;
}

.qty:focus,
.pqty:focus {
  border: 1px solid #528fcc;
  background: #fff;
  outline: none;
}

/* Table styling improvements with dark mode */
#ordertable {
  background: var(--background-section);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 2px 8px var(--shadow-color);
  transition: background-color var(--transition-speed) ease;
}

#ordertable tr.th {
  background-color: #1f5c99;
  color: #fff;
}

#ordertable tr:nth-child(even) {
  background-color: var(--background-alt);
}

#ordertable tr:hover {
  background-color: var(--background-alt);
  filter: brightness(1.05);
}

#ordertable td {
  padding: 0.75rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--border-color-light);
  color: var(--text-body);
  transition: color var(--transition-speed) ease;
  background-color: var(--background-section);
}

/* Fix all table backgrounds in dark mode */
table {
  background-color: var(--background-section) !important;
  transition: background-color var(--transition-speed) ease;
}

table td {
  background-color: var(--background-section) !important;
  color: var(--text-body) !important;
  transition:
    background-color var(--transition-speed) ease,
    color var(--transition-speed) ease;
}

/* Ensure table rows have proper backgrounds */
table tr {
  background-color: var(--background-section) !important;
  transition: background-color var(--transition-speed) ease;
}

/* Fix specific table styling for ordering pages */
table[style*="border-collapse: separate"] {
  background-color: transparent !important;
}

table[style*="border-collapse: separate"] td:not(.process-2) {
  background-color: var(--background-section) !important;
  color: var(--text-body) !important;
}

/* Ensure process-2 styling works in tables */
table td.process-2,
td.process-2 {
  background: #528fcc !important;
  color: #fff !important;
  padding: 20px 30px !important;
}

table td.process-2 p,
td.process-2 p {
  color: #f5f5f5 !important;
  font-size: 12px;
  margin: 0;
  line-height: 16px;
}

/* Button improvements for ordering page - restore original */
.btn-blue {
  background-color: #528fcc !important;
  color: #fff !important;
  border: 0 !important;
  -webkit-box-shadow: 0 2px 0 0 #1f5c99 !important;
  -moz-box-shadow: 0 2px 0 0 #1f5c99 !important;
  -o-box-shadow: 0 2px 0 0 #1f5c99 !important;
  box-shadow: 0 2px 0 0 #1f5c99 !important;
}

.btn-blue:hover,
.btn-blue:focus {
  background-color: #1f5c99 !important;
  color: #fff !important;
  -webkit-box-shadow: 0 2px 0 0 #143d66 !important;
  -moz-box-shadow: 0 2px 0 0 #143d66 !important;
  -o-box-shadow: 0 2px 0 0 #143d66 !important;
  box-shadow: 0 2px 0 0 #143d66 !important;
}

/* Currency selector styling with dark mode */
select[name="CUR"] {
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background-color: var(--background-section);
  color: var(--text-body);
  font-weight: 500;
  transition:
    border-color var(--transition-speed) ease,
    background-color var(--transition-speed) ease,
    color var(--transition-speed) ease;
}

select[name="CUR"]:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(51, 102, 102, 0.25);
  outline: none;
  background-color: var(--background-section);
  color: var(--text-body);
}

/* All select dropdowns styling with dark mode */
select {
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background-color: var(--background-section) !important;
  color: var(--text-body) !important;
  transition:
    border-color var(--transition-speed) ease,
    background-color var(--transition-speed) ease,
    color var(--transition-speed) ease;
}

select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(51, 102, 102, 0.25);
  outline: none;
  background-color: var(--background-section) !important;
  color: var(--text-body) !important;
}

/* Dropdown options styling */
select option {
  background-color: var(--background-section) !important;
  color: var(--text-body) !important;
}

/* Enhanced input styling for all pages including users.html */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea {
  background-color: var(--background-section) !important;
  color: var(--text-body) !important;
  border: 1px solid var(--border-color) !important;
  transition:
    border-color var(--transition-speed) ease,
    background-color var(--transition-speed) ease,
    color var(--transition-speed) ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
textarea:focus {
  background-color: var(--background-section) !important;
  color: var(--text-body) !important;
  border-color: var(--primary-color) !important;
  box-shadow: 0 0 0 0.2rem rgba(51, 102, 102, 0.25) !important;
}

/* Quantity input boxes styling */
input.qty {
  width: 50px !important;
  max-width: 50px;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background-color: var(--background-section) !important;
  color: var(--text-body) !important;
  text-align: center;
  font-size: 14px;
  transition:
    border-color var(--transition-speed) ease,
    background-color var(--transition-speed) ease,
    color var(--transition-speed) ease;
}

input.qty:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(51, 102, 102, 0.25);
  outline: none;
  background-color: var(--background-section) !important;
  color: var(--text-body) !important;
}

/* Specific styling for pqty (product quantity) inputs */
input.pqty {
  width: 50px !important;
  max-width: 50px;
}

/* Bootstrap 5 navigation styling - Updated for new structure with dark mode */
.navbar {
  background-color: var(--background-section) !important;
  border: none;
  box-shadow: 0 2px 4px var(--shadow-color);
  padding: 0.5rem 0;
  transition:
    background-color var(--transition-speed) ease,
    box-shadow var(--transition-speed) ease;
}

/* Simple navbar layout - let Bootstrap handle most of it */
.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Faster Bootstrap collapse animation */
.navbar-collapse {
  transition: height 0.2s ease-in-out;
}

.navbar-collapse.collapsing {
  transition: height 0.2s ease-in-out;
}

.navbar-brand {
  padding: 0;
  margin-right: 1rem;
}

.navbar-brand .subhead {
  color: var(--text-light);
  font-size: 0.875rem;
  font-weight: 400;
}

.navbar .nav-link {
  color: var(--text-body);
  text-transform: uppercase;
  font-size: 14px;
  font-weight: 500;
  padding: 7px 10px;
  margin: 0 5px;
  border-radius: 5px;
  transition: all var(--transition-speed) ease;
}

.navbar .nav-link:hover,
.navbar .nav-link:focus {
  background-color: var(--primary-color);
  color: var(--text-on-primary) !important;
}

.navbar .nav-link.active {
  background-color: var(--primary-color);
  color: var(--text-on-primary) !important;
}

/* Mobile toggle button for Bootstrap 5 - Clean design */
.navbar-toggler {
  border: 1px solid var(--primary-color);
  background-color: transparent;
  padding: 4px 6px;
}

.navbar-toggler:focus {
  box-shadow: 0 0 0 0.25rem rgba(82, 143, 204, 0.25);
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2882, 143, 204, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='m4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Dark mode navbar toggler icon - consolidated to avoid duplication */
@media (prefers-color-scheme: dark) {
  .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28138, 170, 214, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='m4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
  }
}

[data-theme="dark"] .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28138, 170, 214, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='m4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Mobile navbar adjustments */
@media (max-width: 767px) {
  /* Let text size be natural - no need to shrink */

  /* Ensure navbar brand doesn't take too much space */
  .navbar-brand {
    max-width: 75%; /* Leave room for hamburger */
  }

  /* Ensure hamburger button stays on the right */
  .navbar-toggler {
    margin-left: auto;
    border-radius: 4px;
  }

  /* Keep subhead visible - there's room for it */
  .subhead {
    font-size: 0.75rem !important;
    line-height: 1.2;
  }

  /* Adjust logo size on small screens */
  .navbar-brand .logo img {
    height: 40px !important;
  }

  /* Navbar collapse styling */
  .navbar-collapse {
    margin-top: 1rem;
    width: 100%; /* Ensure full width */
  }

  .navbar-nav .nav-link {
    padding: 10px 15px;
    margin: 0;
    border-radius: 0;
    border-bottom: 1px solid var(--border-color-light);
  }

  .navbar-nav .nav-link:hover {
    background-color: var(--background-alt);
    color: var(--primary-color);
  }
}

/* Responsive improvements for home page - Bootstrap 5 approach */
@media (min-width: 768px) {
  .sec-home .row {
    align-items: stretch; /* Ensure equal height columns */
  }

  .process-content {
    min-height: 450px; /* Increased for better balance */
  }
}

@media (max-width: 767px) {
  .sec-home {
    padding: 30px 0; /* Reduce padding on mobile */
  }

  .process-1,
  .process-2 {
    margin-bottom: 1rem;
  }

  .process-content {
    min-height: auto; /* Allow natural height on mobile */
    margin-bottom: 2rem;
  }
}

/* Fix for intermediate screen sizes (tablets) */
@media (min-width: 768px) and (max-width: 991px) {
  .sec-home .col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
  }

  .process-content {
    min-height: 420px;
    padding: 15px 20px 15px;
  }

  .process-content .btn {
    font-size: 13px;
    padding: 0.5rem 1rem;
  }
}

/* Remove old navigation compatibility styles - now handled above */

/* Additional responsive fixes for edge cases */
@media (min-width: 992px) and (max-width: 1199px) {
  /* Large tablets / small desktops */
  .process-content {
    min-height: 440px;
    padding: 18px 25px 18px;
  }
}

@media (min-width: 1200px) {
  /* Large desktops */
  .process-content {
    min-height: 460px;
    padding: 25px 35px 25px;
  }
}

/* Ensure consistent button spacing across all screen sizes */
.btn.me-2 {
  margin-right: 0.5rem !important;
}

.btn.mb-2 {
  margin-bottom: 0.5rem !important;
}

/* Fix spacing above Subscribe Now - reduce top padding */
.sec-hero {
  padding: 30px 0 30px;
}

/* Also fix general section spacing */
.sec {
  padding: 40px 0;
}

/* FAQ styling improvements */
.sec h4 {
  color: var(--text-dark);
  transition: color var(--transition-speed) ease;
  font-size: 1.2rem;
  font-weight: 900;
  margin-top: 25px;
  margin-bottom: 10px;
  padding-bottom: 5px;
  border-bottom: 1px solid #e5e5e5c3;
}

.sec h4:first-of-type {
  margin-top: 15px;
}

/* Hide word list info sections - they're now in Bootstrap modals */
.remodal {
  display: none;
}

/* Remodal dark mode styling */
.remodal {
  background-color: var(--background-section);
  color: var(--text-body);
  border: 1px solid var(--border-color);
}

.remodal-close {
  color: var(--text-body);
}

.remodal-close:hover {
  color: var(--primary-color);
}

/* Info circle icons styling */
.fa-info-circle {
  color: var(--primary-color);
  transition: color var(--transition-speed) ease;
}

.fa-info-circle:hover {
  color: var(--accent-color);
}

/* Ordering table styling improvements */
#ordertable {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 2rem;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#ordertable tr.th,
#ordertable tr.th td,
table table tr.th td {
  background: #1f5c99 !important;
  color: white !important;
}

#ordertable tr.th td {
  padding: 12px 10px;
  font-weight: 600;
  border: none;
}

#ordertable tr:not(.th) td {
  padding: 10px;
  border-bottom: 1px solid #e5e5e5;
  vertical-align: middle;
}

#ordertable tr:nth-child(even):not(.th) {
  background-color: #f8f9fa;
}

#ordertable tr:hover:not(.th) {
  background-color: #e3f2fd;
  transition: background-color 0.2s;
}

/* Product table styling for subscription cards */
table[style*="border-collapse: separate"] {
  border-spacing: 15px 0px;
  table-layout: fixed;
}

table[style*="border-collapse: separate"] td.process-2 {
  background: #528fcc !important;
  color: var(--text-on-primary) !important;
  padding: 20px 30px;
  border-radius: 8px 8px 0 0;
  text-align: center;
  width: 33.3%;
}

table[style*="border-collapse: separate"] td.process-2 p {
  color: var(--text-on-primary) !important;
  opacity: 0.9;
  margin: 5px 0 0 0;
  font-size: 12px;
  font-style: italic;
}

/* Bootstrap 5 input group styling for quantity controls */
.qty-input-group {
  display: inline-flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
  vertical-align: middle;
  width: 80px !important;
  max-width: 80px !important;
  min-width: 80px !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.qty-input-group .btn {
  background-color: #528fcc;
  border-color: #528fcc;
  color: white;
  font-weight: 600;
  width: 24px !important;
  min-width: 24px !important;
  max-width: 24px !important;
  flex: 0 0 24px;
  padding: 0.25rem 0 !important;
  font-size: 12px;
  line-height: 1;
  transition: all 0.2s ease;
  border-radius: 0 !important;
  position: relative;
  z-index: 1;
}

.qty-input-group .btn:hover {
  background-color: #1f5c99;
  border-color: #1f5c99;
  color: white;
  z-index: 2;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.qty-input-group .btn:active {
  background-color: #1a4d7a;
  border-color: #1a4d7a;
  transform: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.qty-input-group .btn:focus {
  background-color: #528fcc;
  border-color: #528fcc;
  box-shadow: 0 0 0 0.2rem rgba(82, 143, 204, 0.25);
  z-index: 3;
}

.qty-input-group .form-control {
  border-color: #528fcc;
  font-weight: 600;
  width: 32px !important;
  min-width: 32px !important;
  max-width: 32px !important;
  flex: 0 0 32px;
  padding: 0.25rem 0.125rem !important;
  font-size: 12px;
  text-align: center;
  border-radius: 0 !important;
  border-left: none !important;
  border-right: none !important;
  z-index: 1;
}

.qty-input-group .form-control:focus {
  border-color: #1f5c99;
  box-shadow: 0 0 0 0.2rem rgba(82, 143, 204, 0.25);
  z-index: 2;
}

/* Ensure input groups work well in table cells */
td .qty-input-group {
  margin: 0;
}

/* Override any conflicting styles for quantity inputs when in input groups - high specificity */
div.qty-input-group input.qty,
div.qty-input-group input.pqty,
.input-group.qty-input-group input.qty,
.input-group.qty-input-group input.pqty,
.qty-input-group .qty,
.qty-input-group .pqty {
  width: 32px !important;
  max-width: 32px !important;
  min-width: 32px !important;
  margin: 0 !important;
  flex: 0 0 32px !important;
  display: block !important;
  float: none !important;
  padding: 0.25rem 0.125rem !important;
  font-size: 12px !important;
  text-align: center !important;
  border-radius: 0 !important;
  border-left: none !important;
  border-right: none !important;
}

/* Ensure table cells don't interfere with flexbox */
td .qty-input-group,
table td .qty-input-group {
  margin: 0 !important;
  display: inline-flex !important;
  flex-direction: row !important;
}

/* Override Bootstrap input-group defaults that might conflict */
.qty-input-group > .btn:not(:last-child),
.qty-input-group > .form-control:not(:last-child) {
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}

.qty-input-group > .btn:not(:first-child),
.qty-input-group > .form-control:not(:first-child) {
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
}

/* Process-2 styling restored to original */
.process-1,
.process-2 {
  background: #528fcc;
  padding: 20px 30px;
}

.process-1 p,
.process-2 p {
  color: #f5f5f5;
  font-size: 12px;
  margin: 0;
  line-height: 16px;
}

/* Footer App Store button responsive fixes */
#footer img[src*="app-store"],
#footer img[src*="google_play"],
#footer img[alt*="Crossword Compiler"] {
  max-width: 100%;
  height: auto;
  transition: transform 0.2s ease;
}

/* Intermediate screen sizes - reduce App Store button sizes */
@media (min-width: 768px) and (max-width: 991px) {
  #footer img[src*="app-store"] {
    height: 45px !important;
    max-width: 135px;
  }

  #footer img[src*="google_play"] {
    height: 45px !important;
    max-width: 135px;
  }

  #footer img[alt*="Crossword Compiler"] {
    width: 120px !important;
    height: auto;
  }
}

/* Small tablets - further reduce sizes */
@media (min-width: 576px) and (max-width: 767px) {
  #footer img[src*="app-store"] {
    height: 40px !important;
    max-width: 120px;
  }

  #footer img[src*="google_play"] {
    height: 40px !important;
    max-width: 120px;
  }

  #footer img[alt*="Crossword Compiler"] {
    width: 100px !important;
    height: auto;
  }
}

/* Mobile - stack and center */
@media (max-width: 575px) {
  #footer .row .col-md-4 {
    margin-bottom: 1rem;
  }

  #footer img[src*="app-store"],
  #footer img[src*="google_play"],
  #footer img[alt*="Crossword Compiler"] {
    height: auto;
    max-width: 150px;
  }
}

/* Bootstrap modal styling for info popups with dark mode */
.modal-content {
  background-color: var(--background-section);
  color: var(--text-body);
  border: 1px solid var(--border-color);
}

.modal-header {
  background-color: var(--background-section);
  color: var(--text-body);
  border-bottom: 1px solid var(--border-color);
}

.modal-body {
  background-color: var(--background-section);
  color: var(--text-body);
}

.modal-body h3 {
  color: var(--primary-color);
  margin-bottom: 20px;
  font-size: 24px;
}

.modal-body ul {
  list-style: none;
  padding: 0;
}

.modal-body ul li {
  padding: 5px 0;
  border-bottom: 1px solid var(--border-color-light);
  color: var(--text-body);
}

.modal-body ul li:last-child {
  border-bottom: none;
}

.modal-footer {
  background-color: var(--background-section);
  border-top: 1px solid var(--border-color);
}

/* Dark mode close button - consolidated to avoid duplication */
@media (prefers-color-scheme: dark) {
  .btn-close {
    filter: invert(1);
  }
}

[data-theme="dark"] .btn-close {
  filter: invert(1);
}

/* Back to top button dark mode support */
@media (prefers-color-scheme: dark) {
  .back-to-top {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"/></svg>');
  }
}

[data-theme="dark"] .back-to-top {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"/></svg>');
}

/* Footer theme toggle button */
.theme-toggle-footer {
  background: transparent;
  border: 2px solid #fff;
  border-radius: 8px;
  padding: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease; /* Faster transition */
  color: #fff;
  font-size: 14px;
}

.theme-toggle-footer:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  transform: translateY(-2px);
}

.theme-toggle-footer svg {
  width: 20px;
  height: 20px;
  transition: transform 0.2s ease; /* Faster transition */
  flex-shrink: 0;
}

.theme-toggle-footer:hover svg {
  transform: rotate(180deg);
}

/* Responsive footer layout */
@media (max-width: 576px) {
  #copyright .d-flex {
    flex-direction: column;
    align-items: center !important;
    text-align: center;
  }

  #copyright .ms-3 {
    margin-left: 0 !important;
    margin-top: 1rem;
  }
}

/* Download page copy button styling */
.copy-button {
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  color: #fff;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 10px;
  vertical-align: middle;
}

.copy-button:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.8);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.copy-button svg {
  flex-shrink: 0;
}

.license-number {
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 600;
}

/* Mac hint styling with dark mode support */
.machint {
  background: linear-gradient(135deg, var(--warning-bg), var(--warning-bg));
  border-left: 4px solid var(--accent-color);
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: var(--border-radius);
  font-weight: 600;
  text-align: center;
  color: var(--warning-text);
  transition:
    background var(--transition-speed) ease,
    color var(--transition-speed) ease;
}

/* Light mode specific gradient */
@media (prefers-color-scheme: light), (prefers-color-scheme: no-preference) {
  .machint {
    background: linear-gradient(135deg, var(--warning-bg), #f4e285);
  }
}

[data-theme="light"] .machint {
  background: linear-gradient(135deg, var(--warning-bg), #f4e285);
}

/* Mobile app store icons - ensure they stay side by side */
.sec-blue .row .col-6 {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1rem;
}

@media (min-width: 576px) {
  .sec-blue .row .col-6 {
    margin-bottom: 0;
  }
}

/* Utility class for minimum width */
.min-width-0 {
  min-width: 0;
}

/* Old testimonials styling removed - now using new carousel approach in cc-essential.css */

/* Font size utilities for responsive text */
.fs-6 {
  font-size: 1rem !important;
}

.fs-sm-5 {
  font-size: 1rem !important;
}

@media (min-width: 576px) {
  .fs-sm-5 {
    font-size: 1.25rem !important;
  }
}

/* Print styles */
@media print {
  .navbar,
  .back-to-top,
  .theme-toggle-footer,
  #footer,
  #copyright,
  #cc-main {
    display: none !important;
  }

  body {
    font-size: 12pt;
    line-height: 1.4;
    background: white !important;
    color: black !important;
  }

  .sec-home {
    page-break-inside: avoid;
  }

  #ordertable {
    box-shadow: none;
    border: 1px solid #000;
  }
}
