:root {
  --primary: #1a56db;
  --primary-dark: #1340a0;
  --accent: #00bcd4;
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #1e293b;
  --text-secondary: #64748b;
  --border: #e2e8f0;
}

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

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

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Nav */
nav {
  background: var(--primary);
  color: white;
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

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

nav .brand {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

nav .brand span { color: var(--accent); }

nav a {
  color: white;
  text-decoration: none;
  font-size: 14px;
  opacity: 0.9;
}

nav a:hover { opacity: 1; }

/* Hero */
.hero {
  text-align: center;
  padding: 80px 0 48px;
}

.hero h1 {
  font-size: 36px;
  font-weight: 800;
  margin-bottom: 12px;
}

.hero h1 span { color: var(--primary); }

.hero p {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* Apps Grid */
.section-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 24px;
}

.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  padding-bottom: 80px;
}

.app-card-link {
  text-decoration: none;
  color: inherit;
}

.app-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  transition: box-shadow 0.2s, transform 0.2s;
}

.app-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

.app-card .icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.card-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  margin-bottom: 12px;
  border-radius: 8px;
}

.app-card h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

.app-card .tagline {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.app-card .meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: #e0e7ff;
  color: var(--primary);
}

.badge.os { background: #dcfce7; color: #166534; }

/* Download button on card */
.btn-download-sm {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
}

/* About section */
.about {
  padding: 60px 0;
  border-top: 1px solid var(--border);
  margin-top: 20px;
}

.about h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 16px;
}

.about p {
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 600px;
}

/* Footer */
footer {
  text-align: center;
  padding: 32px 0;
  font-size: 13px;
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
}

/* Detail Page */
.detail-page {
  padding: 48px 0 80px;
  max-width: 700px;
  margin: 0 auto;
}

.detail-header {
  text-align: center;
  margin-bottom: 32px;
}

.detail-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.detail-logo {
  width: 96px;
  height: 96px;
  object-fit: contain;
  border-radius: 12px;
}

.detail-header h1 {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 8px;
}

.detail-tagline {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.detail-meta {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.detail-body {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
}

.detail-desc {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 32px;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.btn-download {
  display: inline-block;
  font-size: 16px;
  font-weight: 600;
  padding: 14px 36px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  transition: background 0.2s;
}

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

.detail-actions .btn-secondary {
  display: inline-block;
  font-size: 14px;
  font-weight: 500;
  padding: 12px 24px;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: background 0.2s;
}

.detail-actions .btn-secondary:hover { background: var(--bg); }

.back-link {
  display: inline-block;
  margin-top: 24px;
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
}

.back-link:hover { color: var(--primary); }

/* Admin */
.admin-login {
  max-width: 360px;
  margin: 80px auto;
  text-align: center;
}

.admin-login h2 { margin-bottom: 20px; }

input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  margin-bottom: 12px;
  outline: none;
}

input:focus { border-color: var(--primary); }

button {
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

button:hover { background: var(--primary-dark); }
button:disabled { opacity: 0.6; cursor: not-allowed; }

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

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

.btn-danger {
  background: #dc2626;
}

.btn-danger:hover { background: #b91c1c; }

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.admin-header h2 { margin: 0; }

.admin-form {
  max-width: 600px;
}

.admin-form label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
  margin-top: 16px;
}

.admin-form label:first-child { margin-top: 0; }

.admin-form textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  resize: vertical;
}

.admin-form textarea:focus { border-color: var(--primary); }

.admin-form .checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 15px;
  font-weight: 400;
}

.admin-form .checkbox-label input { width: auto; margin: 0; }

.admin-form .form-buttons {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

/* Admin app list */
.admin-apps {
  max-width: 800px;
  margin: 40px auto;
}

.admin-apps .app-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
}

.admin-apps .app-row .info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-apps .app-row .info .icon { font-size: 24px; }

.admin-apps .app-row .actions { display: flex; gap: 8px; }

.admin-error {
  color: #dc2626;
  font-size: 14px;
  margin-bottom: 12px;
}

.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}

.alert-success { background: #dcfce7; color: #166534; }
.alert-error { background: #fef2f2; color: #dc2626; }

.hidden { display: none; }
