/* Instagram Analytics Vault - Styles */

:root {
  --primary: #5B47FB;
  --primary-hover: #4936e8;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --text: #1F2937;
  --text-light: #6B7280;
  --background: #FFFFFF;
  --background-alt: #F9FAFB;
  --border: #E5E7EB;
  --shadow: rgba(0, 0, 0, 0.1);
  --radius: 8px;
}

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

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

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */
.header {
  background: var(--background);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 1rem;
  align-items: center;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
}

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

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

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

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

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

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

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

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

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

/* Hero */
.hero {
  text-align: center;
  padding: 4rem 0;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text);
}

.hero p {
  font-size: 1.125rem;
  color: var(--text-light);
  margin-bottom: 2rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* Features */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin: 3rem 0;
}

.feature {
  text-align: center;
  padding: 1.5rem;
}

.feature h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.feature p {
  font-size: 0.875rem;
  color: var(--text-light);
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  text-align: center;
  padding: 1.25rem;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
}

.stat-label {
  font-size: 0.8125rem;
  color: var(--text-light);
  margin-top: 0.25rem;
}

/* Account Cards */
.section {
  margin-bottom: 2rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.section-title {
  font-size: 1.125rem;
  font-weight: 600;
}

.accounts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1rem;
}

.account-card {
  display: flex;
  flex-direction: column;
}

.account-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.account-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #E040FB);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 1.125rem;
}

.account-info h3 {
  font-size: 0.9375rem;
  font-weight: 600;
}

.account-info p {
  font-size: 0.8125rem;
  color: var(--text-light);
}

.account-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}

.account-stat {
  text-align: center;
}

.account-stat-value {
  font-size: 1.125rem;
  font-weight: 600;
}

.account-stat-label {
  font-size: 0.6875rem;
  color: var(--text-light);
  text-transform: uppercase;
}

.account-actions {
  display: flex;
  gap: 0.5rem;
}

.account-actions .btn {
  flex: 1;
}

.last-sync {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 0.75rem;
  text-align: center;
}

/* Export Section */
.export-card {
  text-align: center;
  padding: 2rem;
}

.export-card h3 {
  margin-bottom: 0.5rem;
}

.export-card p {
  color: var(--text-light);
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
}

/* Spinner */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

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

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

/* Alert */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.alert-success { background: #D1FAE5; color: #065F46; }
.alert-warning { background: #FEF3C7; color: #92400E; }
.alert-danger { background: #FEE2E2; color: #991B1B; }

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

/* Responsive */
@media (max-width: 768px) {
  .hero h1 { font-size: 1.75rem; }
  .features { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .accounts-grid { grid-template-columns: 1fr; }
}

/* Utilities */
.hidden { display: none !important; }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
