/* ============================================================
   🐾 Catnip CDN — Deluxe Admin Theme
   "Cute, professional, and unapologetically stylish."
   ============================================================ */

/* ------------------------------------------------------------
   🎨 Root Variables
   ------------------------------------------------------------ */
:root {
  --bg: #1a1a1d;
  --panel: rgba(35, 35, 40, 0.75);
  --accent: #ff7ab8;
  --accent2: #ff9edf;
  --text: #fff;
  --text-muted: #ccc;
  --radius: 14px;
  --blur: 12px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  --transition: 0.25s ease;
  --font: "Poppins", "Inter", sans-serif;
}

/* ------------------------------------------------------------
   🌌 Global
   ------------------------------------------------------------ */
body {
  background: radial-gradient(circle at 20% 20%, #2b2b2f, #151518);
  color: var(--text);
  font-family: var(--font);
  margin: 0;
  display: flex;
  height: 100vh;
  overflow: hidden;
  cursor: default;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: var(--transition);
}
a:hover {
  color: var(--accent2);
  cursor: pointer;
}

h1, h2, h3 {
  color: var(--accent);
  font-weight: 600;
}

/* ------------------------------------------------------------
   🧭 Layout
   ------------------------------------------------------------ */
.admin-layout {
  display: flex;
  width: 100%;
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: 250px;
  background: linear-gradient(180deg, rgba(255, 122, 184, 0.2) 0%, rgba(255, 158, 223, 0.05) 100%);
  backdrop-filter: blur(var(--blur));
  box-shadow: var(--shadow);
  border-right: 2px solid rgba(255, 255, 255, 0.1);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.3s ease;
}

.sidebar h2 {
  color: var(--accent2);
  text-shadow: 0 0 8px rgba(255, 122, 184, 0.4);
  font-size: 1.6rem;
  margin-bottom: 1.5rem;
}

.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar li {
  margin: 0.8rem 0;
}

.sidebar a {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius);
  transition: all 0.25s ease;
}
.sidebar a:hover,
.sidebar a.active {
  background: rgba(255, 122, 184, 0.15);
  color: var(--accent);
  transform: translateX(5px);
  cursor: pointer;
}

/* ---------- Logout Button ---------- */
.sidebar button {
  background: var(--accent);
  border: none;
  color: #fff;
  padding: 0.7rem 1.2rem;
  border-radius: var(--radius);
  font-weight: bold;
  cursor: pointer;
  transition: var(--transition);
}
.sidebar button:hover {
  background: var(--accent2);
  transform: scale(1.05);
}

/* ------------------------------------------------------------
   🪟 Main Panel
   ------------------------------------------------------------ */
.main {
  flex-grow: 1;
  background: rgba(20, 20, 22, 0.6);
  backdrop-filter: blur(var(--blur));
  border-radius: var(--radius);
  margin: 1.5rem;
  padding: 2rem;
  overflow-y: auto;
  box-shadow: var(--shadow);
  animation: fadeIn 0.5s ease;
}

.main h1 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
}

/* ------------------------------------------------------------
   📁 File Browser — Responsive Grid
   ------------------------------------------------------------ */
.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
  padding: 16px;
  justify-items: center;
  align-items: start;
}

/* ---------- File Card ---------- */
.file-card {
  position: relative;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 180px;
  overflow: hidden;
  box-sizing: border-box;
}
.file-card:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-3px);
}
.file-card.selected {
  border: 2px solid var(--accent2);
  box-shadow: 0 0 15px rgba(255, 158, 223, 0.5);
  animation: softPulse 2s infinite ease-in-out;
}

/* ---------- Checkbox ---------- */
.select-box {
  appearance: none;
  position: absolute;
  top: 8px;
  left: 8px;
  width: 20px;
  height: 20px;
  border: 2px solid var(--accent);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: all 0.2s ease;
}
.select-box:hover {
  box-shadow: 0 0 8px rgba(255, 122, 184, 0.4);
}
.select-box:checked {
  background: linear-gradient(145deg, var(--accent), var(--accent2));
  border-color: transparent;
  box-shadow: 0 0 10px var(--accent2);
}
.select-box:checked::after {
  content: "✔";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -56%);
  color: #1a1a1d;
  font-size: 13px;
  font-weight: 900;
}

/* ---------- Image Preview ---------- */
.file-card img.preview {
  width: 100%;
  max-height: 140px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 0.5rem;
}

/* ---------- Filename ---------- */
.file-card .meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
}
.file-card .meta:hover::after {
  content: attr(title);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 0.75rem;
  white-space: nowrap;
  pointer-events: none;
}

/* ---------- Action Buttons ---------- */
.file-card .actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}
.icon-btn {
  background: rgba(255, 122, 184, 0.15);
  border: 1px solid rgba(255, 122, 184, 0.5);
  border-radius: 10px;
  padding: 6px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  cursor: pointer;
}
.icon-btn:hover {
  background: var(--accent);
  transform: scale(1.08) rotate(-1deg);
  filter: brightness(1.1);
}
.icon-btn.danger:hover {
  background: #ff4f7b;
}

/* ------------------------------------------------------------
   🗑️ Toolbar + Delete Selected
   ------------------------------------------------------------ */
.file-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
}
.btn-delete-multi {
  background: rgba(255, 122, 184, 0.15);
  border: 1px solid rgba(255, 122, 184, 0.5);
  border-radius: 12px;
  color: var(--text);
  font-weight: 600;
  padding: 8px 18px;
  transition: var(--transition);
  box-shadow: 0 0 12px rgba(255, 122, 184, 0.3);
  cursor: pointer;
}
.btn-delete-multi:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.btn-delete-multi:hover:not(:disabled) {
  background: var(--accent);
  color: #fff;
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(255, 122, 184, 0.5);
}

/* ------------------------------------------------------------
   🧾 Inputs + Upload + Login Forms
   ------------------------------------------------------------ */
input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.6rem 0.8rem;
  margin-right: 0.5rem;
  font-size: 0.95rem;
}
input:focus {
  outline: 2px solid var(--accent);
}

/* ---------- Upload Form ---------- */
.upload-section h2 {
  color: var(--accent);
  font-weight: 700;
  font-size: 1.4rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.upload-section h2::before {
  content: "📤";
  font-size: 1.3rem;
}
.upload-section form {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1rem;
  border-radius: var(--radius);
  box-shadow: 0 0 10px rgba(255, 122, 184, 0.1);
}

/* Folder input */
.upload-section input[type="text"] {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  border-radius: var(--radius);
  padding: 0.6rem 0.9rem;
  width: 200px;
  transition: 0.25s ease;
}
.upload-section input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 8px var(--accent2);
  outline: none;
}

/* Custom File Input Wrapper */
.file-input-wrapper {
  position: relative;
  display: inline-block;
}

.file-input-wrapper input[type="file"] {
  opacity: 0;
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

/* Themed Fake File Button */
.file-input-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent);
  color: white;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
  box-shadow: 0 0 8px rgba(255, 122, 184, 0.3);
  cursor: pointer;
}
.file-input-label::before {
  content: "📁";
  font-size: 1rem;
}
.file-input-label:hover {
  background: var(--accent2);
  box-shadow: 0 0 12px rgba(255, 158, 223, 0.5);
  transform: translateY(-2px);
}

/* Filename Display */
.file-name {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-left: 0.6rem;
  font-style: italic;
}

/* Upload button */
.upload-section button {
  background: var(--accent);
  border: none;
  color: white;
  border-radius: var(--radius);
  padding: 0.6rem 1.2rem;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s ease;
  box-shadow: 0 0 10px rgba(255, 122, 184, 0.3);
}
.upload-section button:hover {
  background: var(--accent2);
  transform: translateY(-2px);
  box-shadow: 0 0 15px rgba(255, 158, 223, 0.5);
}

/* ---------- Login Page ---------- */
.login-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: radial-gradient(circle at 25% 25%, #2b2b2f, #151518);
  text-align: center;
}
.login-container h1 {
  font-size: 2.5rem;
  color: var(--accent);
  text-shadow: 0 0 15px rgba(255, 122, 184, 0.6);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}
.login-container h1::before,
.login-container h1::after {
  content: "🐾";
  font-size: 1.8rem;
}
.login-container form {
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: 0 0 15px rgba(255, 122, 184, 0.15);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}
.login-container input[type="text"],
.login-container input[type="password"] {
  width: 220px;
  text-align: center;
}
.login-container button {
  background: var(--accent);
  color: white;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  padding: 0.6rem 1.2rem;
  transition: 0.25s ease;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(255, 122, 184, 0.3);
}
.login-container button:hover {
  background: var(--accent2);
  transform: translateY(-2px);
  box-shadow: 0 0 18px rgba(255, 158, 223, 0.5);
}

/* ------------------------------------------------------------
   ⚠️ Error Pages
   ------------------------------------------------------------ */
.error-page {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  height: 100vh;
  background: radial-gradient(circle at 20% 20%, #2b2b2f, #151518);
  color: #fff;
  font-family: "Poppins", sans-serif;
  text-align: center;
}
.error-container {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(8px);
  border-radius: 16px;
  padding: 3rem 4rem;
  box-shadow: 0 0 20px rgba(255, 105, 180, 0.2);
  animation: floatIn 0.6s ease-out;
}
.error-container h1 {
  font-size: 5rem;
  font-weight: 700;
  color: #ff69b4;
  margin-bottom: 0.5rem;
  text-shadow: 0 0 15px rgba(255, 105, 180, 0.5);
}
.error-container p {
  font-size: 1.2rem;
  color: #d0d0d0;
  margin-bottom: 1.5rem;
}
.error-container button {
  background: var(--accent);
  color: white;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  padding: 0.7rem 1.2rem;
  transition: var(--transition);
  cursor: pointer;
  box-shadow: 0 0 12px rgba(255, 122, 184, 0.3);
}
.error-container button:hover {
  background: var(--accent2);
  transform: translateY(-2px);
  box-shadow: 0 0 18px rgba(255, 158, 223, 0.5);
}

/* Chips & badges */
.chip {
  display:inline-block; padding:4px 8px; border-radius:999px;
  background: rgba(255, 154, 208, 0.18); border:1px solid rgba(255,154,208,0.4);
  font-size:12px; margin-right:6px;
}
.badge {
  padding:4px 10px; border-radius:999px; font-size:12px; border:1px solid var(--accent);
}
.badge.idea { background: rgba(255,154,208,0.15); }
.badge.todo { background: rgba(255,208,154,0.15); }
.badge.in-progress { background: rgba(154,208,255,0.15); }
.badge.done { background: rgba(180,255,180,0.15); }
.badge.removed { background: rgba(200,200,200,0.15); border-color:#888; }

/* Cards */
.card { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.card + .card { margin-top: 16px; }
.card-head { display:flex; justify-content:space-between; align-items:center; gap:8px; }
.card-actions { display:flex; gap:8px; margin-top: 12px; }
.small { font-size: 12px; padding: 6px 10px; }

.tags { margin-top:8px; }
.reason { margin-top:8px; color:#ff9edf; opacity:0.9; }

.meta { display:flex; gap:12px; margin-top:8px; color: var(--text-muted); font-size: 12px; flex-wrap: wrap; }
.timeline { margin-top:10px; font-size: 12px; }
.timeline .event { opacity:0.9; }
.timeline .muted { color: var(--text-muted); }

/* Storm panel */
.storm { background: rgba(35,35,40,0.75); border:1px solid rgba(255,154,208,0.25); border-radius: var(--radius); padding: 12px; margin: 12px 0; }
.storm.hidden { display:none; }
.storm-row { display:flex; gap:8px; margin-bottom:8px; }

/* Modal */
.modal { border: none; border-radius: var(--radius); padding: 0; background: transparent; }
.modal::backdrop { background: rgba(0,0,0,0.6); }
.modal-card { background: var(--panel); border:1px solid rgba(255,154,208,0.25); border-radius: var(--radius); padding:16px; width: min(560px, 90vw); }
.modal-card h3 { margin-top:0; }

/* ------------------------------------------------------------
   ✨ Animations
   ------------------------------------------------------------ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes softPulse {
  0%, 100% { box-shadow: 0 0 12px rgba(255, 158, 223, 0.3); }
  50% { box-shadow: 0 0 20px rgba(255, 158, 223, 0.6); }
}
@keyframes floatIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ------------------------------------------------------------
   💖 Button Restoration — Neon Gradient Glow
   ------------------------------------------------------------ */
button,
.btn,
.upload-section button {
  background: linear-gradient(180deg, #ff7ab8 0%, #ff9edf 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 0.6rem 1.2rem;
  font-weight: 600;
  font-family: var(--font);
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow:
    0 0 8px rgba(255, 122, 184, 0.5),
    inset 0 0 6px rgba(255, 255, 255, 0.2);
}

button:hover,
.btn:hover,
.upload-section button:hover {
  background: linear-gradient(180deg, #ff9edf 0%, #ffb7e6 100%);
  box-shadow:
    0 0 14px rgba(255, 158, 223, 0.8),
    inset 0 0 8px rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

button:active,
.btn:active,
.upload-section button:active {
  transform: translateY(0);
  box-shadow:
    0 0 6px rgba(255, 122, 184, 0.6),
    inset 0 0 10px rgba(255, 255, 255, 0.25);
}

button:disabled,
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

/* ------------------------------------------------------------
   💎 Universal Inputs + Selects — Catnip Glow Fix
   ------------------------------------------------------------ */
input,
select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.6rem 0.8rem;
  font-size: 0.9rem;
  transition: 0.25s ease;
  appearance: none; /* remove browser default arrow */
  -webkit-appearance: none;
  -moz-appearance: none;
  box-shadow: inset 0 0 4px rgba(255, 255, 255, 0.05);
}

/* Pink accent glow on focus */
input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow:
    0 0 8px var(--accent2),
    inset 0 0 6px rgba(255, 255, 255, 0.15);
  outline: none;
}

/* Custom dropdown arrow (right-side pawprint!) */
select {
  background-image: url("data:image/svg+xml,%3Csvg fill='%23ff9edf' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 10l5 5 5-5H7z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 2rem;
  cursor: pointer;
}

/* Hover subtle glow */
select:hover,
input:hover {
  border-color: rgba(255, 154, 208, 0.3);
  box-shadow: 0 0 6px rgba(255, 158, 223, 0.2);
}

/* ------------------------------------------------------------
   📊 CDN Status Page Styling
   ------------------------------------------------------------ */
.status-card {
  background: var(--panel);
  border: 1px solid rgba(255, 154, 208, 0.25);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.8rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  animation: fadeIn 0.6s ease;
}

.status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1rem;
  color: var(--text);
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.status-row:last-child {
  border-bottom: none;
}

.status-row .label {
  font-weight: 600;
  color: var(--accent2);
}
.status-row .value {
  font-weight: 500;
  color: var(--text-muted);
  transition: 0.25s ease;
}
.status-row .value.ok {
  color: #9fff9f;
  text-shadow: 0 0 6px rgba(100, 255, 100, 0.4);
}
.status-row .value.bad {
  color: #ff7a7a;
  text-shadow: 0 0 6px rgba(255, 100, 100, 0.4);
}
.status-grid {
  display: grid;
  gap: 10px;
  margin-top: 1rem;
}

.status-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 154, 208, 0.2);
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: inset 0 0 8px rgba(255, 122, 184, 0.1);
  transition: all 0.3s ease;
}

.status-item:hover {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 8px rgba(255, 158, 223, 0.2);
}

.status-item span {
  font-weight: 600;
  color: var(--accent2);
}

.status-item strong {
  font-weight: 500;
  color: var(--text);
}

