/**
 * CAGE Code Lookup Styles
 */

/* ============================================
   CAGE Input Group
   ============================================ */
.cage-lookup-group {
  display: flex;
  gap: 8px;
}

.cage-input {
  flex: 1;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #f1f5f9;
  font-size: 14px;
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  letter-spacing: 1px;
}

.cage-input::placeholder {
  color: #64748b;
  font-family: inherit;
  letter-spacing: 0;
}

.cage-input:focus {
  outline: none;
  border-color: rgba(0, 180, 216, 0.5);
  background: rgba(0, 180, 216, 0.05);
}

.cage-lookup-btn {
  padding: 10px 14px;
  background: rgba(0, 180, 216, 0.1);
  border: 1px solid rgba(0, 180, 216, 0.3);
  border-radius: 8px;
  color: #00b4d8;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.cage-lookup-btn:hover {
  background: rgba(0, 180, 216, 0.2);
  border-color: rgba(0, 180, 216, 0.5);
}

/* ============================================
   CAGE Modal
   ============================================ */
.cage-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2100;
  display: none;
  align-items: center;
  justify-content: center;
}

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

.cage-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
}

.cage-modal-content {
  position: relative;
  width: 90%;
  max-width: 480px;
  max-height: 85vh;
  background: #0f1a2e;
  border: 1px solid rgba(0, 180, 216, 0.2);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.cage-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.3);
}

.cage-modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #f1f5f9;
}

.cage-modal-close {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #94a3b8;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s;
}

.cage-modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #f1f5f9;
}

.cage-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

/* ============================================
   Loading State
   ============================================ */
.cage-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: #94a3b8;
  gap: 16px;
}

.cage-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(0, 180, 216, 0.2);
  border-top-color: #00b4d8;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================
   Error State
   ============================================ */
.cage-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 32px;
}

.cage-error-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.cage-error-message {
  color: #f87171;
  font-size: 15px;
  line-height: 1.5;
}

/* ============================================
   Not Found State
   ============================================ */
.cage-not-found {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 32px;
}

.cage-not-found-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.cage-not-found-title {
  font-size: 18px;
  font-weight: 600;
  color: #f1f5f9;
  margin-bottom: 8px;
}

.cage-not-found-message {
  color: #94a3b8;
  font-size: 14px;
  margin-bottom: 16px;
}

.cage-not-found-help {
  color: #64748b;
  font-size: 13px;
  line-height: 1.5;
}

/* ============================================
   Result Card
   ============================================ */
.cage-result {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cage-result-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cage-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.cage-badge.verified {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.cage-code-display {
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  font-size: 16px;
  font-weight: 600;
  color: #00b4d8;
  letter-spacing: 1px;
}

.cage-company-name {
  font-size: 20px;
  font-weight: 700;
  color: #f1f5f9;
}

.cage-company-location {
  font-size: 14px;
  color: #94a3b8;
}

/* Details Grid */
.cage-details-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 12px;
}

.cage-detail {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cage-detail:last-child {
  grid-column: span 2;
}

.cage-detail-label {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cage-detail-value {
  font-size: 14px;
  color: #e2e8f0;
}

.cage-detail-value.status-active {
  color: #10b981;
  font-weight: 600;
}

/* Sections */
.cage-section {
  padding-top: 8px;
}

.cage-section-title {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

/* Tags */
.cage-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cage-tag {
  display: inline-block;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  font-size: 12px;
  color: #e2e8f0;
}

.cage-tag.sba {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.cage-tag.naics {
  background: rgba(0, 180, 216, 0.1);
  border-color: rgba(0, 180, 216, 0.2);
  color: #00b4d8;
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
}

/* Actions */
.cage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.cage-action-btn {
  flex: 1;
  min-width: 140px;
  padding: 10px 16px;
  background: rgba(0, 180, 216, 0.1);
  border: 1px solid rgba(0, 180, 216, 0.3);
  border-radius: 8px;
  color: #00b4d8;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
}

.cage-action-btn:hover {
  background: rgba(0, 180, 216, 0.2);
  border-color: rgba(0, 180, 216, 0.5);
}

.cage-action-btn.primary {
  background: linear-gradient(135deg, #00b4d8 0%, #0077b6 100%);
  border-color: transparent;
  color: white;
}

.cage-action-btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 180, 216, 0.3);
}

.cage-action-btn.secondary {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: #94a3b8;
}

.cage-action-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
}

.cage-action-btn.compare {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
  color: #f59e0b;
}

.cage-action-btn.compare:hover {
  background: rgba(245, 158, 11, 0.2);
}

.cage-action-btn.claim {
  background: linear-gradient(135deg, #d4a012 0%, #b8860b 100%);
  border-color: transparent;
  color: #000;
  font-weight: 600;
}

.cage-action-btn.claim:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(212, 160, 18, 0.3);
}

/* ============================================
   Mobile Responsive
   ============================================ */
@media (max-width: 768px) {
  .cage-modal-content {
    width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
  }

  .cage-details-grid {
    grid-template-columns: 1fr;
  }

  .cage-detail:last-child {
    grid-column: 1;
  }

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

  .cage-action-btn {
    min-width: 100%;
  }
}

/* 480px breakpoint for smaller phones */
@media (max-width: 480px) {
  .cage-modal-content {
    padding: 12px;
  }

  .cage-input {
    padding: 12px;
    font-size: 16px; /* prevents iOS zoom */
  }

  .cage-lookup-btn {
    padding: 12px 16px;
    min-height: 44px;
  }

  .cage-result-grid {
    grid-template-columns: 1fr;
  }

  .cage-action-btn {
    min-height: 44px;
    padding: 12px;
  }

  .cage-details-grid {
    gap: 8px;
    padding: 12px;
  }

  .cage-detail-value {
    font-size: 13px;
  }
}
