/* AppCharts - Dark dashboard aesthetic */

:root {
  --bg: #0e0e10;
  --surface: #1a1a1f;
  --border: #2a2a32;
  --text: #e8e8ee;
  --muted: #6b6b7a;
  --accent: #7c6af7;
  --gold: #f0b942;
  --green: #3ecf8e;
  --red: #ef4444;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Layout */
.container {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header */
.header {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-icon {
  font-size: 1.75rem;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.logo-tagline {
  font-size: 0.65rem;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.reset-timer-footer {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}


/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: #6b5ad6;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
}

.btn-gold {
  background: var(--gold);
  color: #0e0e10;
}

.btn-gold:hover {
  background: #d9a53b;
}

.btn-small {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Category Tabs */
.category-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.tab {
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.875rem;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.tab:hover {
  color: var(--text);
  border-color: var(--muted);
}

.tab.active {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(124, 106, 247, 0.1);
}

/* Spotlight Card */
.spotlight {
  background: linear-gradient(135deg, rgba(240, 185, 66, 0.1) 0%, rgba(240, 185, 66, 0.05) 100%);
  border: 2px solid var(--gold);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.spotlight-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  color: var(--gold);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.spotlight-content {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.spotlight-icon {
  width: 80px;
  height: 80px;
  border-radius: 16px;
  object-fit: cover;
  flex-shrink: 0;
}

.spotlight-info {
  flex: 1;
  min-width: 0;
}

.spotlight-name {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.spotlight-tagline {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.spotlight-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Rankings List */
.rankings-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.app-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color 0.15s ease;
}

.app-row:hover {
  border-color: var(--muted);
}

.app-row.featured {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(124, 106, 247, 0.1) 0%, rgba(124, 106, 247, 0.05) 100%);
}

.app-row.boosted {
  border-left: 3px solid var(--green);
}

.app-rank {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--muted);
  width: 2rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
}

.app-row:nth-child(-n+3) .app-rank {
  color: var(--gold);
}

.app-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.app-info {
  flex: 1;
  min-width: 0;
}

.app-name-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.app-name {
  font-weight: 600;
  font-size: 1rem;
}

.app-tagline {
  color: var(--muted);
  font-size: 0.875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-platform {
  background: var(--border);
  color: var(--muted);
}

.badge-category {
  background: rgba(124, 106, 247, 0.2);
  color: var(--accent);
}

.badge-verified {
  background: rgba(62, 207, 142, 0.2);
  color: var(--green);
}

.badge-featured {
  background: rgba(124, 106, 247, 0.2);
  color: var(--accent);
}

.badge-boosted {
  background: rgba(62, 207, 142, 0.2);
  color: var(--green);
}

/* Links */
.app-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
  font-size: 0.8rem;
}

.app-links a {
  color: var(--muted);
}

.app-links a:hover {
  color: var(--text);
}

.dev-link--locked {
  color: var(--muted);
  opacity: 0.5;
  cursor: default;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* Vote Section */
.app-vote {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.vote-btn {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.vote-btn:hover:not(:disabled) {
  border-color: var(--green);
  color: var(--green);
}

.vote-btn.voted {
  background: var(--green);
  border-color: var(--green);
  color: white;
  cursor: default;
}

.vote-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.vote-count {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  font-size: 0.875rem;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  transition: border-color 0.15s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
}

.form-input::placeholder {
  color: var(--muted);
}

.form-hint {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.form-error {
  font-size: 0.75rem;
  color: var(--red);
  margin-top: 0.25rem;
}

select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236b6b7a' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
}

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

/* Sponsor Page */
.tier-cards {
  display: grid;
  gap: 1rem;
  margin-bottom: 2rem;
}

.tier-card {
  padding: 1.5rem;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.15s ease;
}

.tier-card:hover {
  border-color: var(--muted);
}

.tier-card.selected {
  border-color: var(--accent);
  background: rgba(124, 106, 247, 0.1);
}

.tier-card.spotlight {
  border-color: var(--gold);
}

.tier-card.spotlight.selected {
  background: rgba(240, 185, 66, 0.1);
}

.tier-name {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.tier-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.tier-card.spotlight .tier-price {
  color: var(--gold);
}

.tier-description {
  font-size: 0.875rem;
  color: var(--muted);
}

/* Duration selector */
.duration-selector {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.duration-btn {
  flex: 1;
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.duration-btn:hover {
  border-color: var(--muted);
}

.duration-btn.selected {
  border-color: var(--accent);
  background: rgba(124, 106, 247, 0.1);
  color: var(--accent);
}

/* Auth */
.auth-page {
  min-height: calc(100vh - 200px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}

.auth-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.auth-subtitle {
  color: var(--muted);
  margin-bottom: 2rem;
}

.google-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  background: white;
  color: #333;
  border-radius: 8px;
  font-weight: 500;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  transition: box-shadow 0.15s ease;
}

.google-btn:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.google-icon {
  width: 20px;
  height: 20px;
}

/* User menu */
.user-menu {
  display: flex;
  align-items: center;
}

.avatar-wrapper {
  position: relative;
}

.avatar-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  border-radius: 50%;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  transition: border-color 0.15s ease;
}

.avatar-btn:hover .user-avatar {
  border-color: var(--accent);
}

/* Dropdown */
.dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  min-width: 170px;
  z-index: 50;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.dropdown.open {
  display: block;
}

.dropdown-item {
  display: block;
  width: 100%;
  padding: 0.7rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  text-decoration: none;
  transition: background 0.1s ease;
  box-sizing: border-box;
}

.dropdown-item:hover {
  background: var(--border);
  text-decoration: none;
}

.dropdown-gold {
  background: var(--gold);
  color: #0e0e10;
  font-weight: 600;
}

.dropdown-gold:hover {
  background: #d9a53b;
  color: #0e0e10;
}

.dropdown-sep {
  height: 1px;
  background: var(--border);
}

.dropdown-signout {
  color: var(--muted);
  font-size: 0.8rem;
}

.dropdown-signout:hover {
  color: var(--red);
  background: rgba(239, 68, 68, 0.06);
}

/* Messages */
.message {
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.message-success {
  background: rgba(62, 207, 142, 0.1);
  border: 1px solid var(--green);
  color: var(--green);
}

.message-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--red);
  color: var(--red);
}

/* Submit Page */
.submit-steps {
  margin-bottom: 2rem;
}

.step {
  display: none;
}

.step.active {
  display: block;
}

.step-indicator {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
}

.step-dot.active {
  background: var(--accent);
}

.step-dot.completed {
  background: var(--green);
}

.lookup-result {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--green);
  border-radius: 8px;
  margin-top: 1rem;
}

.lookup-result img {
  width: 64px;
  height: 64px;
  border-radius: 12px;
}

.lookup-result-info h3 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.lookup-result-info p {
  font-size: 0.875rem;
  color: var(--muted);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--muted);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.empty-state h3 {
  font-size: 1.25rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}

/* Loading */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  max-width: 400px;
  width: 90%;
  text-align: center;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.modal-text {
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

/* Footer */
.footer {
  margin-top: 4rem;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--muted);
  font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 640px) {
  .header-inner {
    flex-wrap: wrap;
  }

  .app-row {
    flex-wrap: wrap;
  }

  .app-info {
    width: calc(100% - 7rem);
  }

  .app-vote {
    margin-left: auto;
  }

  .spotlight-content {
    flex-direction: column;
  }

  .spotlight-icon {
    width: 64px;
    height: 64px;
  }

  .tier-cards {
    grid-template-columns: 1fr;
  }
}
