/**
 * Store Page Styles
 */

.store {
  box-sizing: border-box;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem;
  min-width: 0;
}

/* Header */
.header {
  margin-bottom: 2rem;
}

.header h1 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary, #1a1a1a);
}

.subtitle {
  margin: 0.5rem 0 0;
  color: var(--text-secondary, #666);
  font-size: 0.9375rem;
}

/* Subscription Banner */
.subscriptionBanner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
  border-radius: 8px;
  font-size: 0.8125rem;
  background: var(--info-bg, #eff6ff);
  border: 1px solid var(--info-border, #bfdbfe);
  color: var(--info-color, #1e40af);
}

.bannerSeparator::before {
  content: '|';
  margin-right: 0.25rem;
  opacity: 0.4;
}

/* Mandate Select */
.mandateSelect {
  width: 100%;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: 8px;
  font-size: 0.8125rem;
  background: var(--surface-color, #ffffff);
  color: var(--text-primary, #1a1a1a);
  appearance: auto;
}

.mandateSelect:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.mandateHint {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  color: var(--text-secondary, #666);
  font-style: italic;
}

/* Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

/* Card */
.card {
  background: var(--surface-color, #ffffff);
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: 12px;
  padding: 1.5rem;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: var(--border-color, #ccc);
}

.cardActive {
  border-color: var(--primary-color, #2563eb);
  background: var(--primary-bg, rgba(37, 99, 235, 0.04));
}

.cardHeader {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.cardIcon {
  font-size: 1.75rem;
  color: var(--primary-color, #2563eb);
  flex-shrink: 0;
}

.cardTitle {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary, #1a1a1a);
  min-width: 0;
  overflow-wrap: anywhere;
}

.cardBody {
  flex: 1;
}

.cardDescription {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-secondary, #666);
  line-height: 1.5;
}

/* Status Badge */
.statusBadge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
}

.statusActive {
  background: var(--success-bg, #ecfdf5);
  color: var(--success-color, #059669);
}

.statusInactive {
  background: var(--surface-color, #f5f5f5);
  color: var(--text-secondary, #666);
}

.statusDot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* Instance List */
.instanceList {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.instanceRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.instanceInfo {
  min-width: 0;
  overflow: hidden;
}

.deactivateButtonSmall {
  flex-shrink: 0;
  padding: 0.25rem 0.625rem;
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  background: transparent;
  color: var(--text-secondary, #666);
}

.deactivateButtonSmall:hover:not(:disabled) {
  border-color: var(--error-color, #dc2626);
  color: var(--error-color, #dc2626);
  background: var(--error-bg, #fef2f2);
}

.deactivateButtonSmall:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Actions */
.cardActions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-color, #e0e0e0);
}

.activateButton {
  width: 100%;
  padding: 0.625rem 1rem;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--primary-color, #2563eb);
  color: #ffffff;
}

.activateButton:hover:not(:disabled) {
  background: var(--primary-hover, #1d4ed8);
}

.deactivateButton {
  width: 100%;
  padding: 0.625rem 1rem;
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  background: transparent;
  color: var(--text-secondary, #666);
}

.deactivateButton:hover:not(:disabled) {
  border-color: var(--error-color, #dc2626);
  color: var(--error-color, #dc2626);
  background: var(--error-bg, #fef2f2);
}

.activateButton:disabled,
.deactivateButton:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Loading */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
  color: var(--text-secondary, #666);
  font-size: 0.9375rem;
}

/* Error */
.error {
  background: var(--error-bg, #fef2f2);
  border: 1px solid var(--error-border, #fecaca);
  color: var(--error-color, #dc2626);
  padding: 1rem 1.25rem;
  border-radius: 8px;
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

/* Empty */
.empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-secondary, #666);
  font-size: 0.9375rem;
}

/* Dark Theme */
:global(.dark-theme) .header h1 {
  color: var(--text-primary-dark, #ffffff);
}

:global(.dark-theme) .subtitle {
  color: var(--text-secondary-dark, #aaa);
}

:global(.dark-theme) .card {
  background: var(--surface-dark, #1a1a1a);
  border-color: var(--border-dark, #333);
}

:global(.dark-theme) .card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border-color: var(--border-dark, #555);
}

:global(.dark-theme) .cardActive {
  border-color: var(--primary-color, #2563eb);
  background: rgba(37, 99, 235, 0.08);
}

:global(.dark-theme) .cardTitle {
  color: var(--text-primary-dark, #ffffff);
}

:global(.dark-theme) .cardDescription {
  color: var(--text-secondary-dark, #aaa);
}

:global(.dark-theme) .statusActive {
  background: rgba(5, 150, 105, 0.15);
  color: var(--success-color, #34d399);
}

:global(.dark-theme) .statusInactive {
  background: var(--surface-dark, #2a2a2a);
  color: var(--text-secondary-dark, #aaa);
}

:global(.dark-theme) .cardActions {
  border-top-color: var(--border-dark, #333);
}

:global(.dark-theme) .deactivateButton,
:global(.dark-theme) .deactivateButtonSmall {
  border-color: var(--border-dark, #444);
  color: var(--text-secondary-dark, #aaa);
}

:global(.dark-theme) .deactivateButton:hover:not(:disabled),
:global(.dark-theme) .deactivateButtonSmall:hover:not(:disabled) {
  border-color: var(--error-color-dark, #f87171);
  color: var(--error-color-dark, #f87171);
  background: rgba(248, 113, 113, 0.1);
}

:global(.dark-theme) .subscriptionBanner {
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.25);
  color: var(--primary-light, #93bbfc);
}

:global(.dark-theme) .mandateSelect {
  background: var(--surface-dark, #1a1a1a);
  border-color: var(--border-dark, #444);
  color: var(--text-primary-dark, #ffffff);
}

:global(.dark-theme) .mandateHint {
  color: var(--text-secondary-dark, #aaa);
}

:global(.dark-theme) .error {
  background: var(--error-bg-dark, #450a0a);
  border-color: var(--error-border-dark, #991b1b);
  color: var(--error-color-dark, #f87171);
}

:global(.dark-theme) .empty {
  color: var(--text-secondary-dark, #aaa);
}

:global(.dark-theme) .loading {
  color: var(--text-secondary-dark, #aaa);
}

@media (max-width: 600px) {
  .store {
    padding: 1rem 0.875rem;
  }

  .header h1 {
    font-size: 1.35rem;
  }

  .card {
    padding: 1.125rem;
  }
}
