/**
 * Galactic Conquest - Reusable UI Components
 * Modular component styles for consistent UI
 */

/* ==========================================
   CARDS
   ========================================== */

.card {
  background: rgba(30, 39, 73, 0.5);
  border: 1px solid rgba(0, 217, 255, 0.2);
  border-radius: var(--radius-lg, 16px);
  padding: var(--spacing-lg, 2rem);
  transition: all var(--transition-base, 0.3s ease);
  backdrop-filter: blur(10px);
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 217, 255, 0.5);
  box-shadow: 0 0 20px rgba(0, 217, 255, 0.3);
}

.card-header {
  margin-bottom: var(--spacing-md, 1.5rem);
  padding-bottom: var(--spacing-md, 1.5rem);
  border-bottom: 1px solid rgba(0, 217, 255, 0.2);
}

.card-title {
  font-size: var(--font-size-xl, 1.5rem);
  font-weight: 700;
  margin: 0;
  background: linear-gradient(135deg, #00d9ff, #b74dff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.card-body {
  color: var(--color-text-secondary, #b0b0b0);
  line-height: 1.7;
}

.card-footer {
  margin-top: var(--spacing-md, 1.5rem);
  padding-top: var(--spacing-md, 1.5rem);
  border-top: 1px solid rgba(0, 217, 255, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-glass {
  background: rgba(10, 14, 39, 0.7);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.card-highlight {
  border: 2px solid #00d9ff;
  box-shadow: 0 0 30px rgba(0, 217, 255, 0.4);
}

/* ==========================================
   BADGES & LABELS
   ========================================== */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  font-size: var(--font-size-xs, 0.75rem);
  font-weight: 600;
  border-radius: var(--radius-full, 9999px);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-primary {
  background: linear-gradient(135deg, #00d9ff, #0099cc);
  color: #0a0e27;
}

.badge-success {
  background: #00ff88;
  color: #0a0e27;
}

.badge-warning {
  background: #ffaa00;
  color: #0a0e27;
}

.badge-error {
  background: #ff4466;
  color: white;
}

.badge-outline {
  background: transparent;
  border: 2px solid currentColor;
}

.badge-glow {
  box-shadow: 0 0 15px currentColor;
}

/* ==========================================
   ALERTS & NOTIFICATIONS
   ========================================== */

.alert {
  padding: var(--spacing-md, 1.5rem);
  border-radius: var(--radius-md, 8px);
  border-left: 4px solid;
  margin-bottom: var(--spacing-md, 1.5rem);
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-sm, 1rem);
}

.alert-icon {
  flex-shrink: 0;
  font-size: var(--font-size-xl, 1.5rem);
}

.alert-content {
  flex: 1;
}

.alert-title {
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.alert-message {
  font-size: var(--font-size-sm, 0.875rem);
}

.alert-success {
  background: rgba(0, 255, 136, 0.1);
  border-left-color: #00ff88;
  color: #00ff88;
}

.alert-error {
  background: rgba(255, 68, 102, 0.1);
  border-left-color: #ff4466;
  color: #ff4466;
}

.alert-warning {
  background: rgba(255, 170, 0, 0.1);
  border-left-color: #ffaa00;
  color: #ffaa00;
}

.alert-info {
  background: rgba(0, 217, 255, 0.1);
  border-left-color: #00d9ff;
  color: #00d9ff;
}

/* ==========================================
   PROGRESS BARS
   ========================================== */

.progress {
  width: 100%;
  height: 12px;
  background: rgba(30, 39, 73, 0.5);
  border-radius: var(--radius-full, 9999px);
  overflow: hidden;
  position: relative;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #00d9ff, #b74dff);
  border-radius: var(--radius-full, 9999px);
  transition: width 0.3s ease;
  position: relative;
  overflow: hidden;
}

.progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: shimmer 2s linear infinite;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: var(--font-size-sm, 0.875rem);
  color: var(--color-text-secondary, #b0b0b0);
}

/* ==========================================
   TOOLTIPS
   ========================================== */

.tooltip {
  position: relative;
  display: inline-block;
  cursor: help;
}

.tooltip-text {
  visibility: hidden;
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 14, 39, 0.95);
  color: var(--color-text-primary, #e8e8e8);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md, 8px);
  font-size: var(--font-size-sm, 0.875rem);
  white-space: nowrap;
  z-index: var(--z-tooltip, 1070);
  opacity: 0;
  transition: opacity 0.3s ease;
  border: 1px solid rgba(0, 217, 255, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.tooltip-text::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(10, 14, 39, 0.95);
}

.tooltip:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* ==========================================
   MODALS
   ========================================== */

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  z-index: var(--z-modal-backdrop, 1040);
  display: none;
  align-items: center;
  justify-content: center;
}

.modal-backdrop.active {
  display: flex;
}

.modal {
  background: var(--color-space-dark, #151b3d);
  border: 2px solid rgba(0, 217, 255, 0.3);
  border-radius: var(--radius-lg, 16px);
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 0 50px rgba(0, 217, 255, 0.3);
  animation: scaleIn 0.3s ease-out;
}

.modal-header {
  padding: var(--spacing-lg, 2rem);
  border-bottom: 1px solid rgba(0, 217, 255, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: var(--font-size-2xl, 2rem);
  font-weight: 700;
  background: linear-gradient(135deg, #00d9ff, #b74dff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  color: var(--color-text-secondary, #b0b0b0);
  font-size: var(--font-size-2xl, 2rem);
  cursor: pointer;
  transition: color 0.3s ease;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  color: #ff4466;
}

.modal-body {
  padding: var(--spacing-lg, 2rem);
}

.modal-footer {
  padding: var(--spacing-lg, 2rem);
  border-top: 1px solid rgba(0, 217, 255, 0.2);
  display: flex;
  justify-content: flex-end;
  gap: var(--spacing-sm, 1rem);
}

/* ==========================================
   TABS
   ========================================== */

.tabs {
  display: flex;
  border-bottom: 2px solid rgba(0, 217, 255, 0.2);
  margin-bottom: var(--spacing-lg, 2rem);
}

.tab {
  padding: var(--spacing-sm, 1rem) var(--spacing-md, 1.5rem);
  background: transparent;
  border: none;
  color: var(--color-text-secondary, #b0b0b0);
  font-size: var(--font-size-base, 1rem);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  font-family: var(--font-primary, sans-serif);
}

.tab::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: #00d9ff;
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.tab:hover {
  color: var(--color-text-primary, #e8e8e8);
}

.tab.active {
  color: #00d9ff;
}

.tab.active::after {
  transform: scaleX(1);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease-out;
}

/* ==========================================
   DROPDOWN MENU
   ========================================== */

.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-toggle {
  background: rgba(30, 39, 73, 0.5);
  border: 2px solid rgba(0, 217, 255, 0.2);
  color: var(--color-text-primary, #e8e8e8);
  padding: var(--spacing-sm, 1rem) var(--spacing-md, 1.5rem);
  border-radius: var(--radius-md, 8px);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  font-family: var(--font-primary, sans-serif);
}

.dropdown-toggle:hover {
  border-color: #00d9ff;
  background: rgba(30, 39, 73, 0.8);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0.5rem;
  background: rgba(10, 14, 39, 0.95);
  border: 1px solid rgba(0, 217, 255, 0.3);
  border-radius: var(--radius-md, 8px);
  min-width: 200px;
  padding: 0.5rem 0;
  z-index: var(--z-dropdown, 1000);
  display: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.dropdown.active .dropdown-menu {
  display: block;
  animation: fadeInDown 0.3s ease-out;
}

.dropdown-item {
  padding: 0.75rem 1.5rem;
  color: var(--color-text-primary, #e8e8e8);
  text-decoration: none;
  display: block;
  transition: all 0.3s ease;
  cursor: pointer;
}

.dropdown-item:hover {
  background: rgba(0, 217, 255, 0.1);
  color: #00d9ff;
}

.dropdown-divider {
  height: 1px;
  background: rgba(0, 217, 255, 0.2);
  margin: 0.5rem 0;
}

/* ==========================================
   TABLES
   ========================================== */

.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg, 16px);
  border: 1px solid rgba(0, 217, 255, 0.2);
}

.modern-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(30, 39, 73, 0.3);
}

.modern-table thead {
  background: rgba(0, 217, 255, 0.1);
}

.modern-table th {
  padding: var(--spacing-md, 1.5rem);
  text-align: left;
  font-weight: 700;
  color: #00d9ff;
  border-bottom: 2px solid rgba(0, 217, 255, 0.3);
  text-transform: uppercase;
  font-size: var(--font-size-sm, 0.875rem);
  letter-spacing: 1px;
}

.modern-table td {
  padding: var(--spacing-md, 1.5rem);
  border-bottom: 1px solid rgba(0, 217, 255, 0.1);
  color: var(--color-text-secondary, #b0b0b0);
}

.modern-table tbody tr {
  transition: background 0.3s ease;
}

.modern-table tbody tr:hover {
  background: rgba(0, 217, 255, 0.05);
}

.modern-table tbody tr:last-child td {
  border-bottom: none;
}

/* ==========================================
   PAGINATION
   ========================================== */

.pagination {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
  padding: var(--spacing-lg, 2rem) 0;
}

.page-link {
  padding: 0.5rem 1rem;
  background: rgba(30, 39, 73, 0.5);
  border: 1px solid rgba(0, 217, 255, 0.2);
  color: var(--color-text-primary, #e8e8e8);
  text-decoration: none;
  border-radius: var(--radius-sm, 4px);
  transition: all 0.3s ease;
  font-weight: 500;
}

.page-link:hover {
  background: rgba(0, 217, 255, 0.1);
  border-color: #00d9ff;
  color: #00d9ff;
}

.page-link.active {
  background: linear-gradient(135deg, #00d9ff, #0099cc);
  border-color: #00d9ff;
  color: #0a0e27;
  box-shadow: 0 0 15px rgba(0, 217, 255, 0.3);
}

.page-link.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ==========================================
   BREADCRUMBS
   ========================================== */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: var(--spacing-sm, 1rem) 0;
  font-size: var(--font-size-sm, 0.875rem);
}

.breadcrumb-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.breadcrumb-item a {
  color: var(--color-text-secondary, #b0b0b0);
  text-decoration: none;
  transition: color 0.3s ease;
}

.breadcrumb-item a:hover {
  color: #00d9ff;
}

.breadcrumb-item.active {
  color: var(--color-text-primary, #e8e8e8);
}

.breadcrumb-separator {
  color: var(--color-text-muted, #808080);
}

/* ==========================================
   ACCORDION
   ========================================== */

.accordion {
  border-radius: var(--radius-lg, 16px);
  overflow: hidden;
}

.accordion-item {
  border-bottom: 1px solid rgba(0, 217, 255, 0.2);
}

.accordion-item:last-child {
  border-bottom: none;
}

.accordion-header {
  padding: var(--spacing-md, 1.5rem);
  background: rgba(30, 39, 73, 0.3);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.3s ease;
  font-weight: 600;
  color: var(--color-text-primary, #e8e8e8);
}

.accordion-header:hover {
  background: rgba(30, 39, 73, 0.5);
}

.accordion-icon {
  transition: transform 0.3s ease;
}

.accordion-item.active .accordion-icon {
  transform: rotate(180deg);
}

.accordion-content {
  display: none;
  overflow: hidden;
}

.accordion-item.active .accordion-content {
  display: block;
  animation: fadeInDown 0.3s ease-out;
}

.accordion-body {
  padding: var(--spacing-md, 1.5rem);
  color: var(--color-text-secondary, #b0b0b0);
  line-height: 1.7;
}
