@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #09090b;
  --bg-elevated: #111113;
  --bg-card: #161618;
  --bg-card-hover: #1c1c1f;
  --border: #27272a;
  --border-hover: #3f3f46;
  --text: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --accent: #a78bfa;
  --accent-soft: rgba(167, 139, 250, 0.12);
  --accent-hover: #c4b5fd;
  --office: #f97316;
  --office-soft: rgba(249, 115, 22, 0.12);
  --adobe: #ef4444;
  --adobe-soft: rgba(239, 68, 68, 0.12);
  --mediafire: #ea580c;
  --mega: #dc2626;
  --gdrive: #3b82f6;
  --success: #22c55e;
  --danger: #ef4444;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow: 0 0 0 1px rgba(255,255,255,0.03), 0 8px 30px rgba(0,0,0,0.4);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* HEADER */
.header {
  background: rgba(9, 9, 11, 0.85);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.logo-mark {
  width: 22px;
  height: 22px;
  background: linear-gradient(135deg, #a78bfa, #7c3aed);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-mark svg {
  width: 12px;
  height: 12px;
  fill: #fff;
}

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

.nav a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.nav a:hover {
  color: var(--text);
  background: rgba(255,255,255,0.04);
}

.nav a.active {
  color: var(--text);
  background: rgba(255,255,255,0.06);
}

/* HERO */
.hero {
  text-align: center;
  padding: 5rem 1.5rem 3.5rem;
  background: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(167, 139, 250, 0.15), transparent);
}

.hero-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 1.25rem;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.15;
  margin-bottom: 0.85rem;
}

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

/* CATEGORY CARDS */
.categories {
  max-width: 800px;
  margin: 0 auto 5rem;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.cat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  overflow: hidden;
}

.cat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  opacity: 0;
  transition: opacity 0.2s;
}

.cat-card.office::before { background: var(--office); }
.cat-card.adobe::before { background: var(--adobe); }

.cat-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.cat-card:hover::before { opacity: 1; }

.cat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cat-card.office .cat-icon {
  background: var(--office-soft);
  color: var(--office);
}

.cat-card.adobe .cat-icon {
  background: var(--adobe-soft);
  color: var(--adobe);
}

.cat-icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cat-card h2 {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.cat-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
  flex-grow: 1;
}

.cat-card .go {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.25rem;
}

.cat-card .go svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  transition: transform 0.15s;
}

.cat-card:hover .go svg {
  transform: translateX(3px);
}

/* PAGE HEADER */
.page-header {
  max-width: 1120px;
  margin: 0 auto;
  padding: 2.75rem 1.5rem 1.75rem;
}

.page-header h1 {
  font-size: 1.65rem;
  font-weight: 750;
  letter-spacing: -0.025em;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.page-header h1 .icon-box {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-header.office h1 .icon-box {
  background: var(--office-soft);
  color: var(--office);
}

.page-header.adobe h1 .icon-box {
  background: var(--adobe-soft);
  color: var(--adobe);
}

.page-header h1 .icon-box svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
}

.page-header p {
  color: var(--text-muted);
  font-size: 0.925rem;
  margin-top: 0.4rem;
}

.badge-count {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}

/* CARDS */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem 4.5rem;
}

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

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  display: flex;
  flex-direction: column;
}

.card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
  transform: translateY(-3px);
}

.card-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--bg-elevated);
  overflow: hidden;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.card:hover .card-img {
  transform: scale(1.03);
}

.card-img-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(160deg, #1a1a1e 0%, #121214 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.card-img-placeholder svg {
  width: 32px;
  height: 32px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.25;
  opacity: 0.4;
}

.card-version-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  font-size: 0.68rem;
  font-weight: 650;
  color: #fff;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 0.22rem 0.55rem;
  border-radius: 6px;
  letter-spacing: 0.02em;
  border: 1px solid rgba(255,255,255,0.08);
}

.card-body {
  padding: 1.15rem 1.2rem 1.25rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  gap: 0;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--text);
  margin-bottom: 0.45rem;
}

.card-desc {
  color: var(--text-muted);
  font-size: 0.825rem;
  line-height: 1.5;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
}

.card-meta .meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.card-password {
  color: var(--text-secondary);
}

.card-password strong {
  color: var(--accent);
  font-weight: 650;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 1.5rem;
  color: var(--text-muted);
}

.empty-state h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.empty-state p { font-size: 0.9rem; }

/* FOOTER */
.footer {
  border-top: 1px solid var(--border);
  padding: 1.75rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ADMIN */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 220px;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  padding: 1.25rem 0.75rem;
  position: fixed;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.sidebar .logo {
  padding: 0.35rem 0.65rem 1.5rem;
  font-size: 0.95rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex-grow: 1;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.75rem;
  border-radius: 7px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s;
}

.sidebar-nav a:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text);
}

.sidebar-nav a.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.sidebar-nav a svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
}

.admin-content {
  margin-left: 220px;
  flex: 1;
  padding: 1.75rem 2rem;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.admin-header h1 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 2rem;
  max-width: 680px;
}

.form-card h2 {
  font-size: 1.05rem;
  font-weight: 650;
  margin-bottom: 1.25rem;
  letter-spacing: -0.01em;
}

.form-section-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 1.35rem 0 0.85rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border);
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 550;
  margin-bottom: 0.3rem;
  color: var(--text-secondary);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.6rem 0.85rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--accent);
}

.form-group textarea {
  min-height: 72px;
  resize: vertical;
}

.form-group input[type="file"] {
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}

.preview-img {
  max-width: 160px;
  max-height: 100px;
  border-radius: 7px;
  margin-top: 0.5rem;
  object-fit: cover;
  display: none;
  border: 1px solid var(--border);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

th, td {
  padding: 0.8rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.015); }

.thumb {
  width: 44px;
  height: 32px;
  object-fit: cover;
  border-radius: 4px;
  background: var(--bg-elevated);
}

.actions { display: flex; gap: 0.4rem; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 1.05rem;
  border-radius: 7px;
  font-weight: 600;
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
}

.btn-primary {
  background: var(--accent);
  color: #0f0f12;
}

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

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

.btn-outline:hover {
  border-color: var(--border-hover);
  color: var(--text);
}

.btn-sm {
  padding: 0.3rem 0.6rem;
  font-size: 0.78rem;
  border-radius: 5px;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  background: var(--danger);
  color: #fff;
}

.btn-edit {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(167, 139, 250, 0.2);
}

.btn-edit:hover {
  background: var(--accent);
  color: #0f0f12;
}

/* LOGIN */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse 60% 40% at 50% 0%, rgba(167, 139, 250, 0.08), transparent);
}

.login-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow);
}

.login-box h1 {
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.3rem;
}

.login-box .subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 1.75rem;
}

.alert {
  padding: 0.7rem 0.9rem;
  border-radius: 7px;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  font-weight: 500;
}

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

.alert-success {
  background: rgba(34, 197, 94, 0.1);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

@media (max-width: 640px) {
  .categories { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .admin-content { margin-left: 0; padding: 1.25rem; }
  .form-row { grid-template-columns: 1fr; }
  .header-inner {
    height: auto;
    padding: 0.85rem 1.25rem;
    flex-direction: column;
    gap: 0.65rem;
  }
  .nav { flex-wrap: wrap; justify-content: center; }
}
/* ========== BOTON VER SERVIDORES ========== */
.btn-servers {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  border: none;
  background: linear-gradient(180deg, rgba(167,139,250,0.18) 0%, rgba(167,139,250,0.1) 100%);
  color: var(--accent-hover);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.25);
}

.btn-servers:hover:not(.disabled) {
  background: linear-gradient(180deg, rgba(167,139,250,0.28) 0%, rgba(167,139,250,0.16) 100%);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.45);
}

.btn-servers.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: rgba(255,255,255,0.03);
  color: var(--text-muted);
  box-shadow: inset 0 0 0 1px var(--border);
}

.btn-servers svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn-servers .server-count {
  font-size: 0.68rem;
  font-weight: 700;
  background: rgba(167, 139, 250, 0.25);
  color: var(--accent-hover);
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  min-width: 1.25rem;
  text-align: center;
}

/* ========== MODAL SERVIDORES ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

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

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  transform: translateY(12px) scale(0.98);
  transition: transform 0.2s ease;
}

.modal-overlay.open .modal-box {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.35rem 0.85rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.015em;
  line-height: 1.3;
}

.modal-header .modal-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  font-weight: 450;
}

.modal-close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.modal-close:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text);
  border-color: var(--border-hover);
}

.modal-close svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.modal-body {
  padding: 1.1rem 1.35rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.modal-server-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.1rem;
  border-radius: 9px;
  font-weight: 600;
  font-size: 0.9rem;
  color: #fff;
  transition: all 0.15s ease;
}

.modal-server-btn:hover {
  filter: brightness(1.12);
  transform: translateX(2px);
}

.modal-server-btn.mediafire { background: var(--mediafire); }
.modal-server-btn.mega { background: var(--mega); }
.modal-server-btn.gdrive { background: var(--gdrive); }

.modal-server-action {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 550;
  opacity: 0.9;
}

.modal-server-action svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.card-password {
  color: var(--text-secondary);
}

.card-password strong {
  color: var(--accent);
  font-weight: 650;
  letter-spacing: 0.02em;
}


.card-version-line {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.card-version-line strong {
  color: var(--accent);
  font-weight: 650;
  letter-spacing: 0.01em;
}
