/* A11y Demo Site - Intentionally Problematic CSS */

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* INTENTIONAL ISSUE: Fixed font size in px, not rem */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #333;
  background-color: #f5f5f5;
}

/* INTENTIONAL ISSUE: Removes all focus indicators */
*:focus {
  outline: none;
}

/* Header styles */
.header {
  background: #1a1a2e;
  color: white;
  padding: 15px 20px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  height: 40px;
}

/* Navigation */
.nav {
  display: flex;
  gap: 20px;
  align-items: center;
}

/* INTENTIONAL ISSUE: Nav items are divs, not links/buttons */
.nav-item {
  color: white;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 4px;
  transition: background 0.2s;
}

/* INTENTIONAL ISSUE: Only hover styles, no focus */
.nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Dropdown menu */
.dropdown {
  position: relative;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 180px;
  z-index: 200;
}

/* INTENTIONAL ISSUE: Dropdown only works on hover, not focus */
.dropdown:hover .dropdown-menu {
  display: block;
}

.dropdown-item {
  padding: 10px 16px;
  color: #333;
  cursor: pointer;
}

.dropdown-item:hover {
  background: #f0f0f0;
}

/* Header actions */
.header-actions {
  display: flex;
  gap: 15px;
  align-items: center;
}

.search-input {
  padding: 8px 12px;
  border: none;
  border-radius: 4px;
  width: 200px;
  /* INTENTIONAL ISSUE: Placeholder-only input, no label */
}

/* INTENTIONAL ISSUE: Icon button with no accessible name */
.icon-btn {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.icon-btn svg {
  width: 24px;
  height: 24px;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 80px 20px;
  text-align: center;
}

.hero-title {
  font-size: 48px;
  margin-bottom: 20px;
}

.hero-subtitle {
  font-size: 18px;
  margin-bottom: 30px;
  opacity: 0.9;
}

/* INTENTIONAL ISSUE: CTA is a span with onclick, not a button */
.hero-cta {
  display: inline-block;
  background: white;
  color: #667eea;
  padding: 14px 32px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s;
}

.hero-cta:hover {
  transform: scale(1.05);
}

/* Product Grid */
.products-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 20px;
}

.section-title {
  font-size: 28px;
  margin-bottom: 30px;
  text-align: center;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

/* INTENTIONAL ISSUE: Product cards are divs, not articles */
.product-card {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s;
}

.product-card:hover {
  transform: translateY(-4px);
}

.product-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.product-info {
  padding: 16px;
}

.product-name {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

/* INTENTIONAL ISSUE: Price has poor contrast - #999 on white = 2.8:1 */
.product-price {
  color: #999999;
  font-size: 16px;
  margin-bottom: 12px;
}

/* INTENTIONAL ISSUE: "View Details" is a span, not a link */
.product-link {
  color: #667eea;
  cursor: pointer;
  font-weight: 500;
}

.product-link:hover {
  text-decoration: underline;
}

/* Newsletter Section */
.newsletter {
  background: #1a1a2e;
  color: white;
  padding: 60px 20px;
  text-align: center;
}

.newsletter-title {
  font-size: 24px;
  margin-bottom: 10px;
}

.newsletter-subtitle {
  opacity: 0.8;
  margin-bottom: 20px;
}

.newsletter-form {
  display: flex;
  gap: 12px;
  justify-content: center;
  max-width: 500px;
  margin: 0 auto;
}

/* INTENTIONAL ISSUE: No label for email input */
.newsletter-input {
  flex: 1;
  padding: 12px 16px;
  border: none;
  border-radius: 4px;
  font-size: 16px;
}

.newsletter-btn {
  background: #667eea;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
}

.newsletter-btn:hover {
  background: #5a6fd6;
}

/* Footer */
.footer {
  background: #0f0f1a;
  color: white;
  padding: 40px 20px;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-link {
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
}

.footer-link:hover {
  color: white;
}

/* Login Page Styles */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
  background: white;
  border-radius: 12px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.login-title {
  font-size: 24px;
  text-align: center;
  margin-bottom: 30px;
  color: #333;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: #333;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 16px;
  transition: border-color 0.2s;
}

/* BROKEN VERSION: Input text color fails contrast */
.form-input-broken {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 16px;
  color: #cccccc; /* INTENTIONAL: 1.6:1 contrast - FAILS */
}

.form-input:focus {
  border-color: #667eea;
  outline: 2px solid rgba(102, 126, 234, 0.3);
  outline-offset: 2px;
}

.form-error {
  color: #d32f2f;
  font-size: 13px;
  margin-top: 6px;
  display: none;
}

.form-error.visible {
  display: block;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 20px 0;
}

/* BROKEN VERSION: Button is a div */
.btn-broken {
  display: block;
  width: 100%;
  background: #667eea;
  color: white;
  padding: 14px;
  border-radius: 6px;
  text-align: center;
  cursor: pointer;
  font-weight: 600;
  font-size: 16px;
  margin-top: 20px;
}

.btn-broken:hover {
  background: #5a6fd6;
}

/* FIXED VERSION: Real button */
.btn {
  display: block;
  width: 100%;
  background: #667eea;
  color: white;
  padding: 14px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 16px;
  margin-top: 20px;
}

.btn:hover {
  background: #5a6fd6;
}

.btn:focus {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

/* BROKEN VERSION: Link is a span */
.link-broken {
  display: block;
  text-align: center;
  margin-top: 20px;
  color: #667eea;
  cursor: pointer;
}

.link-broken:hover {
  text-decoration: underline;
}

/* FIXED VERSION: Real link */
.form-link {
  display: block;
  text-align: center;
  margin-top: 20px;
  color: #667eea;
  text-decoration: none;
}

.form-link:hover {
  text-decoration: underline;
}

.form-link:focus {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

.required-mark {
  color: #d32f2f;
}

/* Dashboard Styles */
.dashboard-container {
  /* INTENTIONAL ISSUE: Fixed width causes horizontal scroll at high zoom */
  width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* INTENTIONAL ISSUE: Large sticky header consumes viewport at high zoom */
.dashboard-header {
  position: sticky;
  top: 0;
  height: 180px;
  background: #1a1a2e;
  color: white;
  padding: 20px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.dashboard-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dashboard-title {
  font-size: 28px;
  font-weight: 600;
}

.dashboard-user {
  display: flex;
  gap: 15px;
  align-items: center;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin: 30px 0;
  /* INTENTIONAL: Cards can get cut off at high zoom */
  overflow: hidden;
}

.stat-card {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stat-label {
  color: #666;
  font-size: 14px;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: #333;
}

/* Filters */
.filters-row {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  align-items: center;
}

/* INTENTIONAL ISSUE: Custom dropdown that doesn't work with keyboard */
.custom-dropdown {
  position: relative;
}

.dropdown-trigger {
  background: white;
  border: 1px solid #ddd;
  padding: 10px 16px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 150px;
}

.dropdown-trigger:hover {
  border-color: #667eea;
}

.custom-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 100%;
  z-index: 50;
}

/* INTENTIONAL ISSUE: Only shows on click, no keyboard support */
.custom-dropdown.open .custom-dropdown-menu {
  display: block;
}

.custom-dropdown-item {
  padding: 10px 16px;
  cursor: pointer;
}

.custom-dropdown-item:hover {
  background: #f0f0f0;
}

.export-btn {
  margin-left: auto;
  background: #667eea;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
}

/* Data Table */
.data-table-container {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* INTENTIONAL ISSUE: Table without caption */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  background: #f8f9fa;
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
  color: #333;
  border-bottom: 2px solid #eee;
  /* INTENTIONAL ISSUE: Sortable columns only work with click */
  cursor: pointer;
}

.data-table th:hover {
  background: #eef0f2;
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #eee;
}

/* INTENTIONAL ISSUE: Status colors only, no text indicator */
.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-dot.shipped { background: #22c55e; }
.status-dot.pending { background: #eab308; }
.status-dot.failed { background: #ef4444; }

/* INTENTIONAL ISSUE: Action button is a div, not a real button */
.action-btn {
  background: #f0f0f0;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}

.action-btn:hover {
  background: #e0e0e0;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 20px;
}

.pagination-btn {
  background: white;
  border: 1px solid #ddd;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
}

.pagination-btn:hover {
  border-color: #667eea;
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination-info {
  color: #666;
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.visible {
  display: flex;
}

.modal {
  background: white;
  border-radius: 12px;
  padding: 30px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-title {
  font-size: 20px;
  font-weight: 600;
}

/* INTENTIONAL ISSUE: Close button has no aria-label, uses X character only */
.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.modal-close:hover {
  background: #f0f0f0;
}

.modal-body {
  color: #666;
  line-height: 1.6;
}

.modal-footer {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Notifications dropdown */
.notifications-dropdown {
  position: relative;
}

.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: white;
  font-size: 11px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notifications-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  width: 300px;
  z-index: 200;
}

.notifications-dropdown:hover .notifications-menu {
  display: block;
}

.notification-item {
  padding: 12px 16px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
}

.notification-item:hover {
  background: #f8f9fa;
}

.notification-item:last-child {
  border-bottom: none;
}

/* Utility classes */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Fixed/Accessible version overrides */
.accessible .form-input {
  color: #333333; /* 12.6:1 contrast - PASSES */
}

.accessible *:focus {
  outline: 2px solid #005fcc;
  outline-offset: 2px;
}

.accessible .form-input[aria-invalid="true"] {
  border-color: #d32f2f;
}
