/* ═══════════════════════════════════════════════════════════════════════════
   EONTRA Admin - Domain Management Styles
   ═══════════════════════════════════════════════════════════════════════════ */

/* Tab Navigation */
.domain-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.domain-tab-btn {
  padding: 12px 24px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.domain-tab-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.domain-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.domain-tab-content {
  display: none;
}

.domain-tab-content.active {
  display: block;
}

/* Search Section */
.domain-search-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}

.domain-search-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.domain-search-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.domain-search-form {
  display: flex;
  gap: 12px;
}

.domain-search-form .form-input {
  flex: 1;
  max-width: 400px;
  font-size: 1rem;
  padding: 12px 16px;
}

/* BYO Section */
.byo-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 24px;
}

.byo-section h3 {
  margin: 0 0 8px 0;
  font-size: 1rem;
  font-weight: 600;
}

.byo-section p {
  color: var(--text-secondary);
  margin: 0 0 16px 0;
  font-size: 0.9rem;
}

.byo-form {
  display: flex;
  gap: 12px;
  max-width: 500px;
}

.byo-form .form-input {
  flex: 1;
}

/* Pricing chips */
.pricing-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pricing-chip {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
}

/* Search Results */
#domainSearchResults {
  margin-top: 20px;
  display: none;
}

.search-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.search-result-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.search-result-card.available {
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.05);
}

.search-result-card.available:hover {
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.search-result-card.taken {
  opacity: 0.6;
}

.premium-badge {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-left: 8px;
}

.popular-badge {
  background: var(--primary);
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-left: 8px;
}

.search-result-domain {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.search-result-domain .domain-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.search-result-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-result-price {
  font-weight: 700;
  color: var(--success);
  font-size: 0.95rem;
}

.search-result-taken {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.search-no-results,
.search-error {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  background: var(--bg-primary);
  border-radius: 8px;
}

.search-error {
  color: var(--error);
  background: rgba(239, 68, 68, 0.1);
}

.search-error small {
  display: block;
  margin-top: 8px;
  color: var(--text-secondary);
}

/* Domains Table */
.domains-table {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
}

.domains-table-header {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr 140px;
  padding: 12px 20px;
  background: var(--bg-tertiary);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
}

.domains-table-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr 140px;
  padding: 16px 20px;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.15s ease;
}

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

.domains-table-row:hover {
  background: var(--bg-hover);
}

.domain-name-main {
  font-weight: 600;
  color: var(--text-primary);
}

.auto-renew-badge {
  margin-left: 8px;
  font-size: 0.8rem;
}

.type-badge {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
}

.status-badge.status-active {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}

.status-badge.status-pending {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.status-badge.status-error {
  background: rgba(239, 68, 68, 0.15);
  color: var(--error);
}

.col-actions {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}

/* DNS Manager */
.dns-nameservers {
  background: var(--bg-tertiary);
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.dns-nameservers code {
  background: var(--bg-primary);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.85rem;
}

.dns-status-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

.dns-status-badge.status-active {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}

.dns-status-badge.status-pending {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.dns-table {
  width: 100%;
  border-collapse: collapse;
}

.dns-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
}

.dns-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.9rem;
}

.dns-table tr:last-child td {
  border-bottom: none;
}

.dns-type {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  font-family: var(--font-mono);
}

.dns-type-a { background: #dbeafe; color: #1e40af; }
.dns-type-aaaa { background: #e0e7ff; color: #3730a3; }
.dns-type-cname { background: #d1fae5; color: #065f46; }
.dns-type-mx { background: #fce7f3; color: #9d174d; }
.dns-type-txt { background: #fef3c7; color: #92400e; }
.dns-type-ns { background: #e5e7eb; color: #374151; }

.dns-name {
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.dns-content {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dns-add-form {
  display: grid;
  grid-template-columns: 100px 1fr 1.5fr 80px 80px auto;
  gap: 10px;
  align-items: end;
  padding: 16px;
  background: var(--bg-tertiary);
  border-radius: 8px;
  margin-top: 16px;
}

.dns-add-form .form-group {
  margin: 0;
}

.dns-add-form label {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
  display: block;
}

.dns-empty {
  padding: 32px;
  text-align: center;
  color: var(--text-muted);
}

.dns-error {
  padding: 16px;
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
  border-radius: 8px;
  text-align: center;
}

/* BYO Instructions Modal */
.nameserver-list {
  background: var(--bg-tertiary);
  border-radius: 8px;
  padding: 16px;
  margin: 16px 0;
}

.nameserver-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
}

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

.nameserver-item code {
  font-size: 1rem;
  font-weight: 600;
}

.instructions-list {
  list-style: decimal;
  padding-left: 20px;
  margin: 16px 0;
}

.instructions-list li {
  padding: 8px 0;
  color: var(--text-secondary);
}

/* Register Modal */
.register-domain-summary {
  background: var(--bg-tertiary);
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  text-align: center;
}

.register-domain-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.register-domain-price {
  font-size: 1.25rem;
  color: var(--success);
  font-weight: 600;
}

.register-domain-price small {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* Utilities */
.btn-xs {
  padding: 4px 8px;
  font-size: 0.75rem;
}

.loading-spinner-sm {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

/* Responsive */
@media (max-width: 768px) {
  .domain-search-form,
  .byo-form {
    flex-direction: column;
  }
  
  .domain-search-form .form-input,
  .byo-form .form-input {
    max-width: 100%;
  }
  
  .domains-table-header,
  .domains-table-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .domains-table-header {
    display: none;
  }
  
  .dns-add-form {
    grid-template-columns: 1fr;
  }
}
