:root {
  --primary-color: #3b82f6;
  --bg-color: #f3f4f6;
  --card-bg: #ffffff;
  --text-main: #1f2937;
  --text-muted: #6b7280;
  --border-radius: 12px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* Install Banner */
#install-banner {
  background-color: var(--primary-color);
  color: white;
  width: 100%;
  padding: 12px 16px;
  text-align: center;
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#btn-install {
  background: white;
  color: var(--primary-color);
  border: none;
  padding: 6px 12px;
  border-radius: 20px;
  font-weight: bold;
  cursor: pointer;
}

header {
  text-align: center;
  padding: 24px 16px 16px;
}

header h1 {
  font-size: 1.8rem;
  margin-bottom: 4px;
}

header p {
  color: var(--text-muted);
}

.brand-header {
  display: flex;
  align-items: center;
  justify-content: center; /* Change to flex-start if you prefer it left-aligned */
  gap: 0.5rem;             /* Space between the logo and the text */
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.brand-logo {
  width: 1.5rem;           /* Forces the 192px image to scale down */
  height: 1.5rem;
  object-fit: contain;
}

h1 {
  font-size: 1.4rem;       /* Reduced font size */
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
}

/* Main App Card */
.card {
  background: var(--card-bg);
  width: 90%;
  max-width: 500px;
  border-radius: var(--border-radius);
  padding: 20px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  margin: 0 auto 24px; /* Centers the card horizontally while keeping the 24px bottom margin */
}

#url-input {
  width: 100%;
  padding: 12px;
  font-size: 1rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  margin-bottom: 16px;
  outline: none;
}

#url-input:focus {
  border-color: var(--primary-color);
}

/* Parameter List */
#params-container h3 {
  font-size: 1rem;
  margin-bottom: 12px;
}

#params-list {
  list-style: none;
  margin-bottom: 16px;
}

#params-list li {
  padding: 10px 0;
  border-bottom: 1px solid #e5e7eb;
}

#params-list li:last-child {
  border-bottom: none;
}

#params-list label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  word-break: break-all;
}

input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--primary-color);
}

/* Buttons & Status */
#btn-share {
  width: 100%;
  padding: 14px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
}

#loading {
  text-align: center;
  color: var(--text-muted);
  font-weight: 500;
  margin: 16px 0;
}

.cf-turnstile {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

/* Ads & SEO Content */
.ad-slot {
  width: 90%;
  max-width: 500px;
  height: 90px;
  background-color: #e5e7eb;
  color: #9ca3af;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 16px 0;
  border-radius: var(--border-radius);
}

.educational-content {
  width: 90%;
  max-width: 600px;
  margin: 0 auto 32px;
}

.educational-content h2 {
  font-size: 1.2rem;
  margin: 24px 0 8px;
}

.educational-content p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

footer {
  text-align: center;
  padding: 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
  width: 100%;
  border-top: 1px solid #e5e7eb;
}

footer a {
  color: var(--primary-color);
  text-decoration: none;
}

/* Clean Link Preview Box */
#preview-container {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 16px;
  word-break: break-all;
}

#preview-container h3 {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

#preview-url {
  font-family: monospace, monospace;
  font-size: 0.9rem;
  color: #2563eb;
  word-break: break-all;
  line-height: 1.4;
}

/* Auth Status Bar */
#auth-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e5e7eb;
}

#user-badge {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  background: #e5e7eb;
  padding: 4px 8px;
  border-radius: 6px;
}

#user-badge.vip {
  background: #dbeafe;
  color: #1e40af;
}

.btn-secondary {
  background: none;
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
}

/* VIP Card */
#vip-card {
  margin-top: -12px;
}

#vip-card h3 {
  font-size: 1rem;
  margin-bottom: 4px;
}

#vip-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.promo-input-group {
  display: flex;
  gap: 8px;
}

#promo-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  text-transform: uppercase;
}

#btn-redeem {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}

#promo-msg {
  margin-top: 8px;
  font-weight: bold;
}

#app-version {
  font-size: 0.75rem;
  color: #9ca3af; /* Light grey */
  margin-top: 8px;
}