/* Browser Compatibility Banner - Aiving Burgundy Theme */
.browser-compat-banner {
  background: linear-gradient(135deg, var(--accent-color), var(--accent-dark));
  color: var(--text-light);
  padding: 16px 20px;
  margin: 0;
  border-bottom: 3px solid var(--accent-dark);
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1000;
  animation: slideDown 0.3s ease;
}

.banner-content {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
}

.banner-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  margin-top: 2px;
  opacity: 0.9;
}

.banner-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.banner-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0;
  color: var(--text-light);
}

.banner-body {
  font-size: 0.9rem;
  font-weight: 400;
  line-height: 1.4;
  margin: 0;
  opacity: 0.95;
  color: var(--text-light);
}

.banner-dismiss {
  position: absolute;
  top: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.2);
  color: var(--text-light);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.banner-dismiss:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.banner-dismiss:focus {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

.banner-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.banner-actions .btn {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-light);
  border: 2px solid rgba(255, 255, 255, 0.3);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-block;
  white-space: nowrap;
  margin: 0;
  width: auto;
  min-width: 120px;
}

.banner-actions .btn:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-1px);
  text-decoration: none;
  color: var(--text-light);
}

.banner-actions .btn:focus {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

.banner-actions .btn-primary {
  background: rgba(255, 255, 255, 0.9);
  color: var(--accent-color);
  border-color: rgba(255, 255, 255, 0.9);
  font-weight: 700;
}

.banner-actions .btn-primary:hover {
  background: rgba(255, 255, 255, 1);
  border-color: rgba(255, 255, 255, 1);
  color: var(--accent-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Feedback notification */
.compat-feedback {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--success-color);
  color: white;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  z-index: 10000;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: slideDown 0.3s ease;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .browser-compat-banner {
    padding: 12px 16px;
  }
  
  .banner-content {
    gap: 8px;
    padding-right: 40px; /* Make room for dismiss button */
  }
  
  .banner-icon {
    font-size: 1.25rem;
  }
  
  .banner-title {
    font-size: 0.95rem;
  }
  
  .banner-body {
    font-size: 0.85rem;
  }
  
  .banner-actions {
    gap: 8px;
    margin-top: 10px;
  }
  
  .banner-actions .btn {
    padding: 6px 12px;
    font-size: 0.85rem;
    flex: 1;
    min-width: 100px;
  }
  
  .banner-dismiss {
    width: 28px;
    height: 28px;
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .banner-actions {
    flex-direction: column;
  }
  
  .banner-actions .btn {
    width: 100%;
    min-width: auto;
  }
}

/* Button Components */
.btn {
  background: var(--gradient-header); color:#fff; border:none; padding:14px 18px;
  border-radius: var(--radius-full); font-size:1rem; cursor:pointer; width:100%; margin: 10px 0;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.btn:disabled { opacity:.6; cursor:not-allowed; transform:none; }
.btn-secondary{
  background: var(--background-primary);
  color: var(--primary-color);
  border:2px solid var(--primary-color);
}

/* WiFi Components */
.wifi-list-container{ margin: 14px 0; }
.wifi-list{
  max-height: 200px; overflow-y:auto; border:2px solid var(--background-tertiary);
  border-radius: var(--radius-md); margin-bottom: 12px; display:none;
}
.scan-section{ 
  margin: 14px 0 8px; 
  display: flex; 
  gap: 10px; 
  flex-wrap: wrap;
}

/* When reload button is hidden, make scan button full width */
.scan-section #scanBtn {
  flex: 1;
  width: 100%;
}
.wifi-item{ padding:6px 12px; border-bottom:1px solid var(--background-tertiary); cursor:pointer; display:flex; justify-content:space-between; align-items:flex-start; }
.wifi-item:hover{ background: var(--background-secondary); }
.wifi-item.selected{ background: var(--info-light); border-left:4px solid var(--primary-color); }
.wifi-info{ flex: 1; min-width: 0; }
.wifi-info .wifi-name{ font-weight:700; color: var(--text-primary); margin-bottom:0; display: flex; flex-direction: column; gap: 1px; }
.wifi-details{ font-size:.9em; color: var(--text-secondary); }
.wifi-cache-badge{ 
  font-size:.75em; padding:2px 6px; border-radius:8px; margin-left:8px;
  background: var(--info-light); color: var(--info-color); border:1px solid var(--info-color);
}
.wifi-cache-badge.fresh{ 
  background: var(--success-light); color: var(--success-color); border-color: var(--success-color);
}
.wifi-age{ font-size:.8em; color: var(--text-secondary); margin-top:2px; }
.strength-bar{ width:60px; height:8px; background: var(--background-tertiary); border-radius:6px; overflow:hidden; }
.strength-fill{ height:100%; background: linear-gradient(90deg, #ff4444, #ffaa00, #44ff44); transition:width .3s ease; }

/* Inline WiFi Password Input */
.wifi-password-container {
  background: var(--background-secondary);
  border: 1px solid var(--primary-color);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  padding: 16px;
  margin-bottom: 8px;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.wifi-password-input {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.password-input-group {
  display: flex;
  gap: 6px;
  align-items: center;
}

.wifi-password-field {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--text-secondary);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  background: var(--background-primary);
  color: var(--text-primary);
  transition: border-color 0.3s ease;
  min-width: 0;
}

.wifi-password-field:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.wifi-password-toggle {
  padding: 8px 10px;
  background: var(--background-tertiary);
  border: 1px solid var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.3s ease;
  min-width: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wifi-password-toggle:hover {
  background: var(--background-secondary);
  border-color: var(--primary-color);
}

.wifi-connect-actions {
  display: flex;
  justify-content: flex-end;
}

.wifi-connect-btn {
  padding: 10px 20px;
  font-size: 0.9rem;
  min-width: 100px;
}

/* WiFi Error Messages */
.wifi-error-messages {
  margin: 8px 0;
  animation: errorSlideIn 0.3s ease-out;
}

@keyframes errorSlideIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.wifi-error-text {
  color: var(--accent-color);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 6px;
  line-height: 1.4;
}

.wifi-support-link {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.wifi-support-link a {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.wifi-support-link a:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

/* WiFi Connected Badge */
.wifi-connected-badge {
  font-size: 0.7rem;
  padding: 2px 5px;
  border-radius: 8px;
  margin-left: 0;
  margin-top: 1px;
  background: var(--success-light);
  color: var(--success-color);
  border: 1px solid var(--success-color);
  font-weight: 600;
  align-self: flex-start;
  width: fit-content;
}
.wifi-disclaimer{ 
  margin: 12px 0; 
  padding: 12px; 
  background: var(--info-light); 
  border: 1px solid var(--info-color); 
  border-radius: var(--radius-md); 
  font-size: 0.9em; 
  color: var(--info-color);
}

.wifi-disclaimer-simple {
  margin: 8px 0 16px 0;
  font-size: 0.85em;
  color: var(--accent-color);
  text-align: left;
}

.connection-status-text {
  margin: 8px 0 12px 0;
  font-size: 0.9em;
  color: var(--text-secondary);
  text-align: left;
}

.connection-status-text p {
  margin: 0;
  font-weight: 500;
}

/* Hide the reload cached networks button */
#cachedBtn {
  display: none !important;
}

/* Hide banner elements in step 4 */
#wifi-config #connectionStatusText,
#wifi-config #wifiStatus,
#wifi-config #networkStatus {
  display: none !important;
}
.connect-section{ display:none; animation: fadeIn .25s ease; }

/* Form Components */
.form-group{ margin-bottom:14px; }
.form-group label{ display:block; margin-bottom:6px; font-weight:700; color: var(--text-primary); }
.input-group{ position:relative; }
.form-control{
  width:100%; padding:14px; border:2px solid var(--background-tertiary);
  border-radius: var(--radius-md); background: var(--background-primary); color: var(--text-primary);
}
.form-control:focus{ outline:none; border-color: var(--primary-color); }
.password-toggle{
  position:absolute; right:10px; top:50%; transform: translateY(-50%);
  background:none; border:none; font-size:1.1rem; color: var(--text-secondary); cursor:pointer;
}

/* Status Components */
.status{ padding:12px; border-radius: var(--radius-md); margin-bottom:12px; display:none; }
.status.success{ background: var(--success-light); color: var(--success-color); border:1px solid var(--success-color);}
.status.error{ background: var(--error-light); color: var(--error-color); border:1px solid var(--error-color);}
.status.info{ background: var(--info-light); color: var(--info-color); border:1px solid var(--info-color);}
.loading{ display:inline-block; width:20px; height:20px; border:3px solid var(--background-tertiary); border-top:3px solid var(--primary-color); border-radius:50%; animation: spin 1s linear infinite; margin-right:8px; }
@keyframes spin{ to{ transform: rotate(360deg);} }

/* Platform Segmented Control - Modern Left-to-Right Toggle */
.platform-segmented-control {
  display: flex;
  background: var(--background-secondary);
  border: 2px solid var(--primary-color);
  border-radius: var(--radius-full);
  padding: 4px;
  margin: 16px 0 20px;
  position: relative;
  overflow: hidden;
}

.platform-segment {
  flex: 1;
  background: transparent;
  border: none;
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 2;
  border-radius: var(--radius-full);
  min-height: 48px;
}

.platform-segment:hover {
  color: var(--primary-color);
  transform: translateY(-1px);
}

.platform-segment.active {
  background: var(--primary-color);
  color: white;
  box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
  transform: translateY(-1px);
}

.platform-segment.active:hover {
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(74, 144, 226, 0.4);
}

.platform-icon {
  font-size: 1.1rem;
  transition: transform 0.3s ease;
}

.platform-segment.active .platform-icon {
  transform: scale(1.1);
}

.platform-label {
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Instructions Container - Left/Right slide animation */
.platform-instructions-container {
  position: relative;
  margin: 0;
  min-height: 120px; /* Reduced height since no padding on instructions */
  overflow: hidden; /* Hide sliding content */
}

.platform-instructions {
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  visibility: hidden;
}

/* Default positioning for inactive instructions */
.platform-instructions:not(.active) {
  transform: translateX(100%);
}

/* iPhone instructions start from left when inactive */
#iphoneInstructions:not(.active) {
  transform: translateX(-100%);
}

.platform-instructions.active {
  opacity: 1;
  transform: translateX(0);
  visibility: visible;
  position: relative;
  background: transparent;
  border: none;
  box-shadow: none;
}

/* Slide out animation for inactive content */
.platform-instructions.slide-out-left {
  transform: translateX(-100%);
  opacity: 0;
}

.platform-instructions.slide-out-right {
  transform: translateX(100%);
  opacity: 0;
}

.platform-instructions h4 {
  margin: 0 0 8px 0 !important;
}

/* Platform Selection Subsection Styling */
.platform-selection-subsection {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border: 1px solid #dee2e6;
  border-left: 4px solid #4a90e2;
  border-radius: var(--radius-md);
  padding: 16px;
  margin: 12px 0;
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.platform-selection-subsection h4 {
  font-weight: 600;
  letter-spacing: 0.5px;
  text-align: center;
  margin: 0 0 12px 0;
  color: var(--primary-color);
}

.platform-instructions ol {
  margin: 0;
}

/* Step 4 Connection States */
.step4-not-connected,
.step4-connected {
  transition: all 0.4s ease;
  opacity: 1;
}

.step4-connected {
  animation: fadeInUp 0.5s ease;
}

.step4-not-connected {
  animation: fadeIn 0.3s ease;
}

.connection-required-card {
  text-align: center;
  padding: 32px 24px;
  background: var(--background-secondary);
  border: 2px dashed var(--info-color);
  border-radius: var(--radius-lg);
  margin: 20px 0;
}

.connection-required-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.7;
}

.connection-required-card h4 {
  color: var(--text-primary);
  margin: 0 0 12px 0;
  font-size: 1.3rem;
  font-weight: 600;
}

.connection-required-card p {
  color: var(--text-secondary);
  margin: 0 0 24px 0;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.connection-required-card .btn {
  min-width: 180px;
  margin: 0;
}

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

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

/* Troubleshoot Toggle Components */
.troubleshoot-toggle-container {
  margin: 16px 0 0 0;
  display: flex;
  justify-content: center;
}

.troubleshoot-toggle {
  background: var(--background-primary);
  border: 1px solid var(--text-secondary);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: all 0.3s ease;
  min-width: 200px;
  justify-content: center;
}

.troubleshoot-toggle:hover {
  background: var(--background-secondary);
  border-color: var(--primary-color);
  color: var(--primary-color);
  transform: translateY(-1px);
}

.troubleshoot-toggle:active {
  transform: translateY(0);
}

.troubleshoot-icon {
  font-size: 1rem;
}

.troubleshoot-text {
  font-weight: 500;
}

.troubleshoot-arrow {
  font-size: 0.8rem;
  transition: transform 0.3s ease;
  display: inline-block;
}

.troubleshoot-toggle.expanded .troubleshoot-arrow {
  transform: rotate(180deg);
}

.troubleshoot-section {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: all 0.4s ease;
  margin: 0;
  padding: 0;
}

.troubleshoot-section.active {
  opacity: 1;
  max-height: 300px;
  margin: 16px 0 0 0;
  padding: 16px;
  background: var(--background-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--background-tertiary);
}

.troubleshoot-section h4 {
  margin: 0 0 8px 0 !important;
}

.troubleshoot-section ol {
  margin: 0;
}

/* Critical Warning Components - Smoother Design */
.critical-warning-banner {
  background: linear-gradient(135deg, #4a90e2, #357abd);
  color: white;
  padding: 10px 20px;
  text-align: center;
  font-weight: 500;
  font-size: 0.9rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(74, 144, 226, 0.15);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.warning-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-width: 800px;
  margin: 0 auto;
}

.warning-icon {
  font-size: 1.1rem;
  opacity: 0.9;
}

.warning-text {
  flex: 1;
  line-height: 1.4;
}

.critical-connection-warning {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border: 1px solid #dee2e6;
  border-left: 4px solid #4a90e2;
  border-radius: var(--radius-md);
  margin: 16px 0;
  padding: 16px;
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  animation: warningSlideIn 0.4s ease-out;
}

.warning-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.warning-icon-large {
  font-size: 1.4rem;
  color: #4a90e2;
}

.warning-header h4 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.warning-body p {
  margin: 6px 0;
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--text-secondary);
}

.warning-body p:first-child {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
}

.warning-actions {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.action-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 6px 10px;
  background: rgba(74, 144, 226, 0.1);
  border-radius: var(--radius-sm);
  color: #4a90e2;
}

.warning-tip {
  margin-top: 12px;
  padding: 10px;
  background: rgba(255, 193, 7, 0.1);
  border: 1px solid rgba(255, 193, 7, 0.3);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.warning-tip strong {
  color: #f39c12;
}

@keyframes warningSlideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
