/* ============================================
   Global UX/UI Consistency Enhancements
   Ensures professional, clean, organized look
   ============================================ */

/* ============================================
   Typography Consistency
   ============================================ */

/* Ensure consistent heading sizes and spacing */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-bold, 700);
  line-height: var(--line-height-tight, 1.3);
  margin-top: 1.5em;
  margin-bottom: 0.75em;
  color: var(--text-primary, #FFFFFF);
}

h1 {
  font-size: var(--font-size-4xl, 2.5rem);
  margin-top: 0;
}

h2 {
  font-size: var(--font-size-3xl, 2rem);
  border-bottom: 2px solid var(--border-color, rgba(255, 255, 255, 0.1));
  padding-bottom: 0.5rem;
}

h3 {
  font-size: var(--font-size-2xl, 1.5rem);
}

h4 {
  font-size: var(--font-size-xl, 1.25rem);
}

h5 {
  font-size: var(--font-size-lg, 1.125rem);
}

h6 {
  font-size: var(--font-size-base, 1rem);
}

/* Consistent paragraph spacing */
p {
  line-height: var(--line-height-normal, 1.6);
  margin-bottom: 1rem;
}

/* Consistent list styling */
ul, ol {
  line-height: var(--line-height-normal, 1.6);
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.5rem;
}

/* ============================================
   Component Consistency
   ============================================ */

/* Status Banner - Consistent styling */
.status-banner {
  background: linear-gradient(135deg, #4f8cff 0%, #3a7ae8 100%);
  color: #FFFFFF;
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md, 8px);
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: var(--shadow-md, 0 4px 6px rgba(0, 0, 0, 0.3));
}

.status-banner .status-indicator {
  font-size: 1.25rem;
  line-height: 1;
}

@media (max-width: 768px) {
  .status-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

/* Reading Info - Consistent styling */
.reading-info {
  color: var(--text-secondary, #a6adbb);
  font-size: var(--font-size-sm, 0.875rem);
  margin-bottom: 1.5rem;
  padding: 0.75rem 1rem;
  background: var(--bg-elevated, rgba(255, 255, 255, 0.05));
  border-left: 4px solid var(--brand-primary, #4f8cff);
  border-radius: var(--radius-sm, 4px);
}

/* Page Feedback - Consistent styling */
.page-feedback {
  background: var(--bg-elevated, rgba(255, 255, 255, 0.05));
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  border-radius: var(--radius-lg, 12px);
  padding: 1.5rem;
  margin-top: 3rem;
  text-align: center;
}

.page-feedback p {
  margin-bottom: 1rem;
}

.page-feedback p:last-child {
  margin-bottom: 0;
}

.feedback-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0.75rem 1.5rem;
  margin: 0.5rem;
  border-radius: var(--radius-md, 8px);
  font-weight: var(--font-weight-semibold, 600);
  text-decoration: none;
  transition: all var(--transition-base, 200ms ease);
  cursor: pointer;
}

.feedback-yes {
  background: var(--success, #28a745);
  color: #FFFFFF;
}

.feedback-yes:hover {
  background: #218838;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md, 0 4px 6px rgba(0, 0, 0, 0.3));
}

.feedback-no {
  background: var(--error, #dc3545);
  color: #FFFFFF;
}

.feedback-no:hover {
  background: #c82333;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md, 0 4px 6px rgba(0, 0, 0, 0.3));
}

.feedback-suggest {
  background: var(--info, #17a2b8);
  color: #FFFFFF;
}

.feedback-suggest:hover {
  background: #138496;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md, 0 4px 6px rgba(0, 0, 0, 0.3));
}

.page-meta {
  color: var(--text-secondary, #a6adbb);
  font-size: var(--font-size-xs, 0.75rem);
  margin-top: 1rem;
}

/* ============================================
   Button Consistency
   ============================================ */

/* Ensure all buttons meet accessibility standards */
.btn,
.btn-primary,
.btn-secondary,
button[type="submit"],
button[type="button"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0.75rem 1.5rem;
  border: 2px solid transparent;
  border-radius: var(--radius-md, 8px);
  font-weight: var(--font-weight-semibold, 600);
  font-size: var(--font-size-base, 1rem);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-base, 200ms ease);
}

.btn:focus,
.btn-primary:focus,
.btn-secondary:focus,
button:focus {
  outline: 3px solid var(--focus-color, #FFD54F);
  outline-offset: 3px;
}

.btn-primary {
  background: var(--brand-primary, #4f8cff);
  color: #FFFFFF;
}

.btn-primary:hover {
  background: var(--brand-primary-hover, #3a7ae8);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg, 0 10px 15px rgba(0, 0, 0, 0.3));
}

.btn-secondary {
  background: var(--brand-secondary, #1e7e34);
  color: #FFFFFF;
}

.btn-secondary:hover {
  background: var(--brand-secondary-hover, #155728);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg, 0 10px 15px rgba(0, 0, 0, 0.3));
}

.button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  align-items: center;
  margin: 1.5rem 0;
}

@media (max-width: 768px) {
  .button-group {
    flex-direction: column;
    width: 100%;
  }
  
  .button-group .btn,
  .button-group .btn-primary,
  .button-group .btn-secondary {
    width: 100%;
  }
}

/* ============================================
   Layout Consistency
   ============================================ */

/* Main content container */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

@media (max-width: 768px) {
  main {
    padding: 1.5rem 1rem;
  }
}

/* Section spacing */
section {
  margin-bottom: 3rem;
}

/* Horizontal rule styling */
hr {
  border: none;
  border-top: 2px solid var(--border-color, rgba(255, 255, 255, 0.1));
  margin: 3rem 0;
}

/* ============================================
   Card/Panel Consistency
   ============================================ */

.card,
.panel,
.info-box,
.feature-box {
  background: var(--bg-elevated, rgba(255, 255, 255, 0.05));
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  border-radius: var(--radius-lg, 12px);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.3));
}

.card h2,
.card h3,
.panel h2,
.panel h3 {
  margin-top: 0;
}

/* ============================================
   Link Consistency
   ============================================ */

a {
  color: var(--link-primary, #66B2FF);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
  transition: all var(--transition-fast, 150ms ease);
}

a:hover {
  color: var(--link-hover, #99D0FF);
  text-decoration-thickness: 3px;
}

a:focus {
  outline: 3px solid var(--focus-color, #FFD54F);
  outline-offset: 3px;
}

/* Ensure external links are identifiable */
a[target="_blank"]::after {
  content: " ↗";
  font-size: 0.85em;
  vertical-align: super;
}

/* ============================================
   Form Consistency
   ============================================ */

input[type="text"],
input[type="email"],
input[type="search"],
input[type="tel"],
input[type="url"],
textarea,
select {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 0.75rem 1rem;
  font-size: var(--font-size-base, 1rem);
  border: 2px solid var(--border-color, rgba(255, 255, 255, 0.2));
  border-radius: var(--radius-md, 8px);
  background: var(--bg-elevated, rgba(255, 255, 255, 0.05));
  color: var(--text-primary, #FFFFFF);
  transition: all var(--transition-fast, 150ms ease);
}

input:focus,
textarea:focus,
select:focus {
  outline: 3px solid var(--focus-color, #FFD54F);
  outline-offset: 3px;
  border-color: var(--brand-primary, #4f8cff);
}

label {
  display: block;
  font-weight: var(--font-weight-semibold, 600);
  margin-bottom: 0.5rem;
  color: var(--text-primary, #FFFFFF);
}

/* ============================================
   Table Consistency
   ============================================ */

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 2rem;
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  border-radius: var(--radius-md, 8px);
  overflow: hidden;
}

th {
  background: var(--bg-elevated, rgba(255, 255, 255, 0.05));
  color: var(--text-primary, #FFFFFF);
  font-weight: var(--font-weight-bold, 700);
  text-align: left;
  padding: 1rem;
  border-bottom: 2px solid var(--border-color, rgba(255, 255, 255, 0.2));
}

td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
}

tr:hover {
  background: var(--bg-elevated, rgba(255, 255, 255, 0.03));
}

/* ============================================
   Responsive Images
   ============================================ */

img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-md, 8px);
}

figure {
  margin: 2rem 0;
}

figcaption {
  margin-top: 0.5rem;
  font-size: var(--font-size-sm, 0.875rem);
  color: var(--text-secondary, #a6adbb);
  text-align: center;
}

/* ============================================
   Code Block Consistency
   ============================================ */

code {
  font-family: 'Courier New', Courier, monospace;
  background: var(--bg-elevated, rgba(255, 255, 255, 0.05));
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm, 4px);
  font-size: 0.9em;
}

pre {
  background: var(--bg-elevated, rgba(255, 255, 255, 0.05));
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  border-radius: var(--radius-md, 8px);
  padding: 1.5rem;
  overflow-x: auto;
  margin-bottom: 2rem;
}

pre code {
  background: none;
  padding: 0;
}

/* ============================================
   Blockquote Consistency
   ============================================ */

blockquote {
  border-left: 4px solid var(--brand-primary, #4f8cff);
  background: var(--bg-elevated, rgba(255, 255, 255, 0.05));
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  border-radius: var(--radius-md, 8px);
  font-style: italic;
}

blockquote p {
  margin-bottom: 0.5rem;
}

blockquote p:last-child {
  margin-bottom: 0;
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
  .status-banner,
  .page-feedback,
  .button-group,
  nav,
  header,
  footer {
    display: none !important;
  }
  
  body {
    background: white !important;
    color: black !important;
  }
  
  a {
    color: #000 !important;
    text-decoration: underline !important;
  }
  
  h1, h2, h3, h4, h5, h6 {
    page-break-after: avoid;
    color: #000 !important;
  }
  
  img {
    page-break-inside: avoid;
  }
}
