/**
 * Enhanced CSS for Warranty Lookup Plugin
 * Features: Dark mode, Responsive design, Animations, Modern UI
 */

/* CSS Variables for theming */
:root {
  --primary-color: #DC2626;
  --primary-hover: #B91C1C;
  --success-color: #10B981;
  --warning-color: #F59E0B;
  --error-color: #EF4444;
  --text-primary: #1F2937;
  --text-secondary: #6B7280;
  --bg-primary: #FFFFFF;
  --bg-secondary: #F9FAFB;
  --border-color: #E5E7EB;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --border-radius: 8px;
  --transition: all 0.3s ease;
}

/* Dark mode variables */
.warranty-dark-mode {
  --text-primary: #F9FAFB;
  --text-secondary: #D1D5DB;
  --bg-primary: #1F2937;
  --bg-secondary: #111827;
  --border-color: #374151;
}

/* Base styles */
* {
  box-sizing: border-box;
}

/* Dark mode toggle */
.dark-mode-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
}

.dark-mode-switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}

.dark-mode-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.dark-mode-switch .slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: var(--transition);
  border-radius: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.dark-mode-switch input:checked + .slider {
  background-color: var(--primary-color);
}

.dark-mode-switch .slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: var(--transition);
  border-radius: 50%;
}

.dark-mode-switch input:checked + .slider:before {
  transform: translateX(26px);
}

/* Form tra cứu */
#warranty-lookup-form {
  max-width: 600px;
  margin: 40px auto;
  padding: 30px;
  background: var(--bg-primary);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.warranty-dark-mode #warranty-lookup-form {
  background: var(--bg-primary);
  border-color: var(--border-color);
}

/* Enhanced search input container */
.search-input-container {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 15px;
}

.search-input {
  flex: 1;
  min-width: 300px;
  padding: 14px 18px;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 16px;
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: var(--transition);
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.search-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1), 0 4px 8px rgba(0,0,0,0.1);
  outline: none;
  transform: translateY(-1px);
}

.search-buttons {
  display: flex;
  gap: 8px;
}

/* Search type indicator */
.search-type-indicator {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 12px 16px;
  margin-bottom: 20px;
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  transition: var(--transition);
}

.search-type-indicator .indicator-text {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 500;
}

/* Dynamic indicator states */
.search-type-indicator.serial-detected {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  border-color: #2196f3;
  color: #1565c0;
}

.search-type-indicator.phone-detected {
  background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%);
  border-color: #4caf50;
  color: #2e7d32;
}

/* Dark mode support for search elements */
.warranty-dark-mode .search-input {
  background: var(--bg-primary);
  border-color: var(--border-color);
  color: var(--text-primary);
}

.warranty-dark-mode .search-type-indicator {
  background: linear-gradient(135deg, #374151 0%, #4b5563 100%);
  border-color: var(--border-color);
  color: var(--text-secondary);
}

.warranty-dark-mode .search-type-indicator.serial-detected {
  background: linear-gradient(135deg, #1e3a8a 0%, #3730a3 100%);
  border-color: #60a5fa;
  color: #93c5fd;
}

.warranty-dark-mode .search-type-indicator.phone-detected {
  background: linear-gradient(135deg, #14532d 0%, #166534 100%);
  border-color: #4ade80;
  color: #86efac;
}

/* Legacy support */
.d-flex {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

#warranty-lookup-form input[type="text"] {
  flex: 1;
  min-width: 250px;
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 16px;
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: var(--transition);
}

#warranty-lookup-form input[type="text"]:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
  outline: none;
}

.btn {
  padding: 12px 20px;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: var(--transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-primary:disabled {
  background-color: #9CA3AF;
  cursor: not-allowed;
  transform: none;
}

.btn-outline-secondary {
  background-color: transparent;
  color: var(--text-secondary);
  border: 2px solid var(--border-color);
}

.btn-outline-secondary:hover {
  background-color: var(--bg-secondary);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.btn-sm {
  padding: 8px 12px;
  font-size: 12px;
}

/* Enhanced loading animation */
.warranty-loading {
  text-align: center;
  padding: 40px 20px;
  background: var(--bg-primary);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
}

.loading-spinner {
  display: inline-block;
  position: relative;
  width: 80px;
  height: 80px;
  margin-bottom: 20px;
}

.spinner-ring {
  box-sizing: border-box;
  display: block;
  position: absolute;
  width: 64px;
  height: 64px;
  margin: 8px;
  border: 8px solid var(--primary-color);
  border-radius: 50%;
  animation: spinner-ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
  border-color: var(--primary-color) transparent transparent transparent;
}

.spinner-ring:nth-child(1) { animation-delay: -0.45s; }
.spinner-ring:nth-child(2) { animation-delay: -0.3s; }
.spinner-ring:nth-child(3) { animation-delay: -0.15s; }

@keyframes spinner-ring {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-text {
  color: var(--text-secondary);
  font-size: 16px;
  margin: 0;
}

/* Kết quả tra cứu */
#warranty-result {
  max-width: 700px;
  margin: 40px auto;
  padding: 0 20px;
}

.lookup-result {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  padding: 0;
  font-size: 16px;
  overflow: hidden;
  animation: slideInUp 0.5s ease-out;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.result-header {
  background: linear-gradient(135deg, #021d59, #AAA);
  color: white;
  padding: 20px 30px;
  display: flex;
  align-items: center;
  gap: 15px;
  box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

.status-icon {
  font-size: 2em;
}

.result-header h3 {
  margin: 0;
  font-size: 1.5em;
  font-weight: 600;
  color:#fff;
}

.warranty-info {
  padding: 30px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid var(--border-color);
}

.info-row:last-child {
  border-bottom: none;
}

.info-row.highlight {
  background: var(--bg-secondary);
  margin: 0 -30px;
  padding: 15px 30px;
}

.info-row .label {
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.info-row .value {
  font-weight: 500;
  color: var(--text-secondary);
  text-align: right;
  flex: 1;
}

.info-row .value code {
  background: var(--bg-secondary);
  padding: 4px 8px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  color: var(--primary-color);
}

.status-badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
}

.status-badge.valid {
  background: #D1FAE5;
  color: #065F46;
}

.status-badge.warning {
  background: #FEF3C7;
  color: #92400E;
}

.status-badge.expired {
  background: #FEE2E2;
  color: #991B1B;
}

.result-actions {
  padding: 20px 30px;
  background: var(--bg-secondary);
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.action-btn {
  flex: 1;
  min-width: 150px;
  padding: 12px 20px;
  border: 2px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-primary);
  border-radius: var(--border-radius);
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
  text-align: center;
}

.action-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.print-btn:hover {
  border-color: var(--success-color);
  color: var(--success-color);
}

.share-btn:hover {
  border-color: #3B82F6;
  color: #3B82F6;
}

/* Error states */
.lookup-error {
  background: var(--bg-primary);
  border: 1px solid #FCA5A5;
  border-radius: var(--border-radius);
  padding: 40px 30px;
  text-align: center;
  animation: slideInUp 0.5s ease-out;
}

.error-icon {
  font-size: 3em;
  margin-bottom: 15px;
}

.lookup-error h3 {
  color: var(--error-color);
  margin: 0 0 10px 0;
  font-size: 1.5em;
}

.lookup-error p {
  color: var(--text-secondary);
  margin: 0;
}

/* Consent wrapper */
.consent-wrapper {
  font-size: 14px;
  color: var(--text-primary);
  margin: 20px 0;
  text-align: left;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 20px;
  border-radius: var(--border-radius);
  transition: var(--transition);
}

.consent-wrapper label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}

.consent-wrapper input[type="checkbox"] {
  margin-top: 3px;
  transform: scale(1.3);
  accent-color: var(--primary-color);
  cursor: pointer;
}

.consent-wrapper a {
  color: var(--primary-color);
  text-decoration: underline;
}

.consent-wrapper strong {
  font-weight: 600;
}

/* CAPTCHA Styles */
.captcha-wrapper {
  max-width: 600px;
  margin: 20px auto;
}

.captcha-box {
  background: #fff3cd;
  border: 2px solid #ffc107;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(255, 193, 7, 0.2);
}

.captcha-box h4 {
  margin: 0 0 15px 0;
  color: #856404;
  font-size: 18px;
}

.captcha-box p {
  font-size: 20px;
  font-weight: bold;
  color: #856404;
  margin: 15px 0;
  padding: 10px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  display: inline-block;
  min-width: 120px;
}

.captcha-input-group {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  margin: 15px 0;
  flex-wrap: wrap;
}

.captcha-input-group input {
  padding: 12px;
  border: 2px solid #ffc107;
  border-radius: 8px;
  font-size: 16px;
  text-align: center;
  width: 120px;
  font-weight: bold;
}

.captcha-input-group input:focus {
  outline: none;
  border-color: #DC2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.captcha-input-group button {
  padding: 12px 24px;
  background: #28a745;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s ease;
}

.captcha-input-group button:hover {
  background: #218838;
}

.captcha-input-group button:disabled {
  background: #6c757d;
  cursor: not-allowed;
}

.captcha-help {
  color: #856404;
  font-style: italic;
  margin-top: 10px;
  display: block;
}

/* Notification Styles */
.warranty-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 20px;
  border-radius: 8px;
  color: white;
  font-weight: bold;
  z-index: 10000;
  transform: translateX(400px);
  transition: transform 0.3s ease;
  max-width: 350px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.warranty-notification.show {
  transform: translateX(0);
}

.warranty-notification.success {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: #17a2b8;
  border-left: 4px solid #1e7e34;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.warranty-notification.error {
  background: linear-gradient(135deg, #dc3545, #c82333);
  color: #ffffff;
  border-left: 4px solid #a02622;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.warranty-notification.warning {
  background: linear-gradient(135deg, #ffc107, #e0a800);
  color: #212529;
  border-left: 4px solid #d39e00;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(255,255,255,0.3);
}

.warranty-notification.info {
  background: linear-gradient(135deg, #17a2b8, #138496);
  color: #ffffff;
  border-left: 4px solid #117a8b;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.close-notification {
  background: none;
  border: none;
  color: inherit;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  float: right;
  margin-left: 10px;
  padding: 0;
  line-height: 1;
}

/* Dark Mode Styles */
.dark-mode-container {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1000;
}

.dark-mode-switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}

.dark-mode-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #2196F3;
}

input:checked + .slider:before {
  transform: translateX(26px);
}

/* Dark Mode Theme */
.warranty-dark-mode {
  background-color: #1a1a1a;
  color: #e0e0e0;
}

.warranty-dark-mode #warranty-lookup-form {
  background: #2d2d2d;
  padding: 30px;
  border-radius: 15px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.warranty-dark-mode input[type="text"] {
  background: #3a3a3a;
  border-color: #555;
  color: #e0e0e0;
}

.warranty-dark-mode input[type="text"]:focus {
  border-color: #DC2626;
  background: #404040;
}

.warranty-dark-mode .consent-wrapper {
  background: #2a2a2a;
  border-color: #555;
}

.warranty-dark-mode .lookup-result {
  background: #2d2d2d;
  border-color: #555;
  color: #e0e0e0;
}

.warranty-dark-mode .captcha-box {
  background: #3a3a3a;
  border-color: #ffc107;
  color: #e0e0e0;
}

/* Scanner Modal Styles */
.scanner-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.scanner-container {
  background: white;
  border-radius: 15px;
  padding: 20px;
  max-width: 90vw;
  max-height: 90vh;
  overflow: hidden;
}

.scanner-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid #eee;
}

.scanner-header h3 {
  margin: 0;
  color: #333;
}

.close-scanner {
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 50%;
  width: 35px;
  height: 35px;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scanner-footer {
  margin-top: 15px;
  text-align: center;
  color: #666;
}

#qr-reader, #barcode-reader {
  width: 100%;
  max-width: 400px;
  height: 300px;
  border: 2px solid #DC2626;
  border-radius: 10px;
  overflow: hidden;
}

/* Search Type Indicator */
.search-type-indicator {
  margin: 15px 0;
  padding: 12px;
  border-radius: 8px;
  background: #f8f9fa;
  border-left: 4px solid #6c757d;
  transition: all 0.3s ease;
}

.search-type-indicator.serial-detected {
  background: #d1ecf1;
  border-left-color: #17a2b8;
}

.search-type-indicator.phone-detected {
  background: #d4edda;
  border-left-color: #28a745;
}

.indicator-text {
  font-size: 14px;
  color: #495057;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Phone Search Results */
.phone-search-results {
  margin-top: 20px;
}

.results-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 25px;
  padding: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 12px;
}

.header-icon {
  font-size: 2em;
}

.header-content h3 {
  margin: 0 0 5px 0;
  font-size: 1.4em;
  color: #fff;
}

.header-content p {
  margin: 0;
  opacity: 0.9;
}

.results-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
}

.result-card {
  background: white;
  border: 2px solid #e9ecef;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.result-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.result-card.valid {
  border-color: #28a745;
}

.result-card.warning {
  border-color: #ffc107;
}

.result-card.expired {
  border-color: #dc3545;
}

.card-header {
  padding: 15px 20px;
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-header .status-icon {
  font-size: 1.5em;
}

.product-info h4 {
  margin: 0 0 5px 0;
  font-size: 1.1em;
  color: #333;
}

.serial-code {
  margin: 0;
  font-size: 0.9em;
  color: #666;
}

.serial-code code {
  background: #e9ecef;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
}

.card-body {
  padding: 20px;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.info-item .label {
  font-size: 0.85em;
  color: #666;
  font-weight: 500;
}

.info-item .value {
  font-weight: 600;
  color: #333;
}

.info-item.highlight .value {
  color: #DC2626;
  font-size: 1.1em;
}

.status-badge {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.85em;
  font-weight: bold;
}

.status-badge.valid {
  background: #d4edda;
  color: #155724;
}

.status-badge.warning {
  background: #fff3cd;
  color: #856404;
}

.status-badge.expired {
  background: #f8d7da;
  color: #721c24;
}

.card-actions {
  padding: 15px 20px;
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
  display: flex;
  gap: 10px;
  justify-content: center;
}

.action-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 0.9em;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.print-btn {
  background: #17a2b8;
  color: white;
}

.print-btn:hover {
  background: #138496;
}

.share-btn {
  background: #28a745;
  color: white;
}

.share-btn:hover {
  background: #218838;
}

/* Pagination */
.pagination-container {
  margin-top: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.pagination-info {
  color: #666;
  font-size: 0.9em;
}

.pagination-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pagination-buttons .btn {
  padding: 8px 12px;
  border: 1px solid #dee2e6;
  background: white;
  color: #495057;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.9em;
  cursor: pointer;
  transition: all 0.3s ease;
}

.pagination-buttons .btn:hover {
  background: #e9ecef;
}

.pagination-buttons .btn-primary {
  background: #DC2626;
  color: white;
  border-color: #DC2626;
}

.pagination-buttons .btn-outline-secondary {
  border-color: #6c757d;
  color: #6c757d;
}

.pagination-buttons .btn-outline-secondary:hover {
  background: #6c757d;
  color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
  #warranty-lookup-form {
    margin: 20px auto;
    padding: 20px;
  }

  .search-input-container {
    flex-direction: column;
    gap: 15px;
  }

  .search-buttons {
    justify-content: center;
  }

  .results-grid {
    grid-template-columns: 1fr;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .pagination-container {
    flex-direction: column;
    text-align: center;
  }

  .scanner-container {
    margin: 20px;
    max-width: calc(100vw - 40px);
  }

  #qr-reader, #barcode-reader {
    max-width: 100%;
    height: 250px;
  }

  .dark-mode-container {
    top: 10px;
    left: 10px;
  }

  .warranty-notification {
    top: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
    transform: translateY(-100px);
  }

  .warranty-notification.show {
    transform: translateY(0);
  }
}

@media (max-width: 480px) {
  .captcha-input-group {
    flex-direction: column;
  }

  .captcha-input-group input {
    width: 100%;
    max-width: 200px;
  }

  .card-actions {
    flex-direction: column;
  }

  .action-btn {
    width: 100%;
    justify-content: center;
  }
}

/* CAPTCHA Styles */
.captcha-wrapper {
  max-width: 600px;
  margin: 20px auto;
  background: #fff3cd;
  border: 2px solid #ffeaa7;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.captcha-box h4 {
  color: #856404;
  margin-bottom: 15px;
  font-size: 18px;
  text-align: center;
}

#captcha-question {
  font-size: 16px;
  font-weight: bold;
  color: #333;
  text-align: center;
  margin: 15px 0;
  padding: 10px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #ddd;
}

.captcha-input-group {
  display: flex;
  gap: 10px;
  margin: 15px 0;
  align-items: center;
}

.captcha-input-group input {
  flex: 1;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 16px;
}

.captcha-input-group button {
  padding: 10px 20px;
  background: #28a745;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.3s ease;
}

.captcha-input-group button:hover {
  background: #218838;
}

.captcha-help {
  display: block;
  color: #856404;
  font-size: 14px;
  text-align: center;
  margin-top: 10px;
}

/* Dark mode CAPTCHA */
.warranty-dark-mode .captcha-wrapper {
  background: #2d3748;
  border-color: #4a5568;
  color: #e2e8f0;
}

.warranty-dark-mode #captcha-question {
  background: #1a202c;
  border-color: #4a5568;
  color: #e2e8f0;
}

.warranty-dark-mode .captcha-input-group input {
  background: #2d3748;
  border-color: #4a5568;
  color: #e2e8f0;
}

.warranty-dark-mode .captcha-input-group input:focus {
  border-color: #63b3ed;
  box-shadow: 0 0 0 2px rgba(99, 179, 237, 0.2);
}

/* Scanner modals */
.scanner-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.scanner-container {
  background: var(--bg-primary);
  border-radius: var(--border-radius);
  overflow: hidden;
  max-width: 90vw;
  max-height: 90vh;
  animation: scaleIn 0.3s ease-out;
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.scanner-header {
  background: var(--primary-color);
  color: white;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.scanner-header h3 {
  margin: 0;
  font-size: 1.2em;
}

.close-scanner {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: var(--transition);
}

.close-scanner:hover {
  background: rgba(255, 255, 255, 0.2);
}

#qr-reader, #barcode-reader {
  width: 400px;
  height: 300px;
  background: #000;
}

.scanner-footer {
  padding: 20px;
  text-align: center;
  background: var(--bg-secondary);
  color: var(--text-secondary);
}

.scanner-footer p {
  margin: 0;
  font-size: 14px;
}

/* Notifications */
.warranty-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 15px 20px;
  box-shadow: var(--shadow-lg);
  z-index: 10000;
  min-width: 300px;
  max-width: 400px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  transform: translateX(100%);
  opacity: 0;
  transition: var(--transition);
}

.warranty-notification.show {
  transform: translateX(0);
  opacity: 1;
}

.warranty-notification.success {
  border-color: var(--success-color);
  background: #ECFDF5;
}

.warranty-notification.warning {
  border-color: var(--warning-color);
  background: #FFFBEB;
}

.warranty-notification.error {
  border-color: var(--error-color);
  background: #FEF2F2;
}

.close-notification {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* CAPTCHA container */
#captcha-container {
  background: var(--bg-secondary);
  border: 1px solid var(--warning-color);
  border-radius: var(--border-radius);
  padding: 20px;
  margin: 20px 0;
}

#captcha-container label {
  display: block;
  margin-bottom: 10px;
  font-weight: 600;
  color: var(--text-primary);
}

#captcha-question {
  font-size: 18px;
  font-weight: bold;
  color: var(--primary-color);
  margin: 10px 0;
}

#captcha-answer {
  width: 100%;
  padding: 10px;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 16px;
  background: var(--bg-primary);
  color: var(--text-primary);
}

/* Language switcher */
#warranty-language-switcher {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 15px;
  box-shadow: var(--shadow-md);
}

#warranty-language-select {
  border: 1px solid var(--border-color);
  padding: 8px;
  border-radius: 4px;
  font-size: 14px;
  background: var(--bg-primary);
  color: var(--text-primary);
  width: 100%;
}

/* Responsive design */
@media (max-width: 768px) {
  #warranty-lookup-form {
    margin: 20px;
    padding: 20px;
  }
  
  .d-flex {
    flex-direction: column;
    align-items: stretch;
  }
  
  #warranty-lookup-form input[type="text"] {
    min-width: auto;
    width: 100%;
  }
  
  .btn {
    width: 100%;
    justify-content: center;
  }
  
  .result-actions {
    flex-direction: column;
  }
  
  .action-btn {
    min-width: auto;
  }
  
  .info-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }
  
  .info-row .value {
    text-align: left;
  }
  
  #qr-reader, #barcode-reader {
    width: 300px;
    height: 225px;
  }
  
  .scanner-container {
    margin: 20px;
  }
  
  .warranty-notification {
    right: 10px;
    left: 10px;
    min-width: auto;
    max-width: none;
  }
  
  .dark-mode-container {
    top: 10px;
    right: 10px;
  }
  
  #warranty-language-switcher {
    top: 60px;
    right: 10px;
    left: 10px;
  }
}

@media (max-width: 480px) {
  #warranty-lookup-form {
    margin: 10px;
    padding: 15px;
  }
  
  .result-header {
    padding: 15px 20px;
  }
  
  .warranty-info {
    padding: 20px;
  }
  
  .info-row.highlight {
    margin: 0 -20px;
    padding: 15px 20px;
  }
  
  .result-actions {
    padding: 15px 20px;
  }
}

/* Print styles */
@media print {
  .dark-mode-container,
  #warranty-language-switcher,
  .warranty-notification,
  .scanner-modal {
    display: none !important;
  }
  
  #warranty-lookup-form {
    box-shadow: none;
    border: 1px solid #ddd;
  }
  
  .lookup-result {
    box-shadow: none;
    border: 2px solid #000;
  }
}

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

/* Focus styles for better accessibility */
button:focus,
input:focus,
select:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --border-color: #000000;
    --text-secondary: #000000;
  }
  
  .warranty-dark-mode {
    --border-color: #FFFFFF;
    --text-secondary: #FFFFFF;
  }
}

/* Grace Period Success Message */
.grace-period-notice {
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  border: 2px solid #28a745;
  border-radius: 12px;
  padding: 15px 20px;
  margin: 15px 0;
  color: #155724;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.2);
  animation: slideInFromTop 0.5s ease-out;
}

.grace-period-notice .icon {
  font-size: 1.5em;
  flex-shrink: 0;
}

.grace-period-notice .message {
  flex: 1;
}

.grace-period-notice .timer {
  font-size: 0.9em;
  opacity: 0.8;
  margin-top: 5px;
}

/* Enhanced notification styles for grace period */
.warranty-notification.grace-period {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  border-left: 4px solid #1e7e34;
  color: white;
}

/* Animation for grace period notice */
@keyframes slideInFromTop {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Pulse animation for important notices */
.pulse-animation {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.2);
  }
  50% {
    box-shadow: 0 4px 20px rgba(40, 167, 69, 0.4);
  }
  100% {
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.2);
  }
}

/* Dark mode support for grace period */
.warranty-dark-mode .grace-period-notice {
  background: linear-gradient(135deg, #1e3a2e 0%, #2d5a3d 100%);
  border-color: #48bb78;
  color: #c6f6d5;
}

/* Mobile responsive for grace period notice */
@media (max-width: 768px) {
  .grace-period-notice {
    flex-direction: column;
    text-align: center;
    gap: 8px;
  }
  
  .grace-period-notice .icon {
    font-size: 2em;
  }
}

/* Phone Search Results Styles */
.phone-search-results {
  max-width: 1200px;
  margin: 0 auto;
}

.results-header {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  color: white;
  padding: 25px 30px;
  border-radius: var(--border-radius) var(--border-radius) 0 0;
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 0;
}

.header-icon {
  font-size: 2.5em;
  flex-shrink: 0;
}

.header-content h3 {
  margin: 0 0 8px 0;
  font-size: 1.5em;
  font-weight: 600;
}

.header-content p {
  margin: 0;
  opacity: 0.9;
  font-size: 1em;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 20px;
  padding: 30px;
  background: var(--bg-secondary);
  border-radius: 0 0 var(--border-radius) var(--border-radius);
}

.result-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  animation: slideInUp 0.3s ease-out;
}

.result-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.result-card.valid {
  border-left: 4px solid var(--success-color);
}

.result-card.warning {
  border-left: 4px solid var(--warning-color);
}

.result-card.expired {
  border-left: 4px solid var(--error-color);
}

.card-header {
  padding: 20px;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  gap: 15px;
}

.card-header .status-icon {
  font-size: 1.8em;
  flex-shrink: 0;
}

.product-info h4 {
  margin: 0 0 5px 0;
  font-size: 1.1em;
  font-weight: 600;
  color: var(--text-primary);
}

.serial-code {
  margin: 0;
  font-size: 0.9em;
  color: var(--text-secondary);
}

.serial-code code {
  background: var(--primary-color);
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85em;
  font-weight: 600;
}

.card-body {
  padding: 20px;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.info-item.highlight {
  grid-column: 1 / -1;
  background: var(--bg-secondary);
  padding: 12px;
  border-radius: 6px;
  text-align: center;
}

.info-item .label {
  font-size: 0.85em;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-item .value {
  font-weight: 500;
  color: var(--text-primary);
}

.info-item .status-badge {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.8em;
  font-weight: 600;
  text-align: center;
}

.card-actions {
  padding: 15px 20px;
  background: var(--bg-secondary);
  display: flex;
  gap: 10px;
}

.card-actions .action-btn {
  flex: 1;
  padding: 8px 12px;
  font-size: 0.85em;
  min-width: auto;
}

/* Pagination Styles */
.pagination-container {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-top: none;
  padding: 20px 30px;
  border-radius: 0 0 var(--border-radius) var(--border-radius);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.pagination-info {
  color: var(--text-secondary);
  font-size: 0.9em;
}

.pagination-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pagination-buttons .btn {
  padding: 8px 12px;
  font-size: 0.85em;
  min-width: 40px;
}

/* Responsive Design for Phone Results */
@media (max-width: 768px) {
  .results-grid {
    grid-template-columns: 1fr;
    padding: 20px;
  }
  
  .result-card {
    margin-bottom: 0;
  }
  
  .results-header {
    padding: 20px;
    flex-direction: column;
    text-align: center;
    gap: 15px;
  }
  
  .header-icon {
    font-size: 2em;
  }
  
  .info-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .info-item.highlight {
    grid-column: 1;
  }
  
  .card-actions {
    flex-direction: column;
  }
  
  .pagination-container {
    flex-direction: column;
    text-align: center;
  }
  
  .pagination-buttons {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .results-header {
    padding: 15px;
  }
  
  .results-grid {
    padding: 15px;
  }
  
  .card-header,
  .card-body,
  .card-actions {
    padding: 15px;
  }
  
  .pagination-container {
    padding: 15px;
  }
}

/* Dark mode support for phone results */
.warranty-dark-mode .results-header {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
}

.warranty-dark-mode .results-grid {
  background: var(--bg-secondary);
}

.warranty-dark-mode .result-card {
  background: var(--bg-primary);
  border-color: var(--border-color);
}

.warranty-dark-mode .card-header,
.warranty-dark-mode .card-actions {
  background: var(--bg-secondary);
}

.warranty-dark-mode .serial-code code {
  background: var(--primary-color);
  color: white;
}
