/* ============================================================
   FarSploit — app.css
   Custom styles on top of Tailwind
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --primary: #7706d4;
  --primary-light: #9333ea;
  --primary-glow: rgba(119, 6, 212, 0.25);
}

/* ── Base ───────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

::selection {
  background: var(--primary);
  color: #fff;
}

/* ── Navbar Enhancement ──────────────────────────────────────── */
#navbar {
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.navbar-blur {
  background: rgba(3, 7, 18, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: none;
  box-shadow: none;
  transition: all 0.4s ease;
}

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #0f0f0f;
}
::-webkit-scrollbar-thumb {
  background: #3b3b3b;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(75, 85, 99, 0.2);
  border-radius: 1rem;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(119, 6, 212, 0.15);
  border-color: rgba(119, 6, 212, 0.25);
}

/* ── Glow Button ────────────────────────────────────────────── */
.btn-primary {
  background: linear-gradient(135deg, #7706d4, #9333ea);
  color: #fff;
  border-radius: 0.75rem;
  padding: 0.625rem 1.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.25s ease;
  box-shadow: 0 4px 15px rgba(119, 6, 212, 0.35);
  border: none;
  cursor: pointer;
  text-decoration: none;
}
.btn-primary:hover {
  background: linear-gradient(135deg, #9333ea, #7706d4);
  box-shadow: 0 6px 25px rgba(119, 6, 212, 0.55);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(75, 85, 99, 0.3);
  color: #d1d5db;
  border-radius: 0.75rem;
  padding: 0.625rem 1.5rem;
  font-weight: 500;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  cursor: pointer;
  text-decoration: none;
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(75, 85, 99, 0.4);
  color: #fff;
}

/* ── Badge / Tag ────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(119, 6, 212, 0.15);
  color: #a855f7;
  border: 1px solid rgba(119, 6, 212, 0.3);
}

/* ── Form Inputs ────────────────────────────────────────────── */
.input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(75, 85, 99, 0.3);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  color: #f3f4f6;
  font-size: 0.875rem;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  outline: none;
  font-family: inherit;
}
.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(119, 6, 212, 0.2);
  background: rgba(255, 255, 255, 0.06) !important;
}
.input::placeholder {
  color: #6b7280;
}

/* Autofill Fix */
.input:-webkit-autofill,
.input:-webkit-autofill:hover,
.input:-webkit-autofill:focus {
  -webkit-text-fill-color: #f3f4f6;
  -webkit-box-shadow: 0 0 0px 1000px #0a0a0c inset;
  transition: background-color 5000s ease-in-out 0s;
}

.label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: #9ca3af;
  margin-bottom: 0.375rem;
  letter-spacing: 0.02em;
}

textarea.input {
  resize: vertical;
  min-height: 120px;
}

/* ── Code Block ─────────────────────────────────────────────── */
.code-block {
  background: #0d0d0d;
  border: 1px solid rgba(75, 85, 99, 0.2);
  border-radius: 1rem;
  overflow: hidden;
  position: relative;
}
.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(75, 85, 99, 0.15);
}
.code-block pre {
  padding: 1.25rem;
  overflow-x: auto;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  line-height: 1.7;
  color: #a5f3fc;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ── Tasks (Sequential) ────────────────────────────────── */
.task-card {
  border-radius: 1rem;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
}
.task-card.disabled {
  opacity: 0.3;
  filter: grayscale(1);
  pointer-events: none;
}
.task-card.active {
  background: rgba(119, 6, 212, 0.08);
  border-color: rgba(119, 6, 212, 0.4);
  box-shadow: 0 4px 20px -5px rgba(119, 6, 212, 0.3);
  opacity: 1 !important;
  filter: none !important;
}
.task-card.active .task-icon {
  border-color: rgba(119, 6, 212, 0.4);
  background: rgba(119, 6, 212, 0.15);
}
.task-card.completed {
  background: rgba(16, 185, 129, 0.03);
  border-color: rgba(16, 185, 129, 0.1);
}
.task-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ── Progress Bar ───────────────────────────────────────────── */
.progress-bar-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 9999px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #7706d4, #a855f7);
  border-radius: 9999px;
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Section Title ──────────────────────────────────────────── */
.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #f9fafb;
  display: flex;
  align-items: center;
  gap: 0.625rem;
}
.section-title::before {
  content: "";
  display: block;
  width: 4px;
  height: 1.4rem;
  background: linear-gradient(180deg, #7706d4, #9333ea);
  border-radius: 9999px;
}

/* ── Hero Gradient Orb ──────────────────────────────────────── */
.hero-orb {
  position: absolute;
  border-radius: 9999px;
  filter: blur(80px);
  pointer-events: none;
  animation: pulse 6s ease-in-out infinite;
}

/* ── Thumbnail Image ────────────────────────────────────────── */
.post-thumbnail {
  aspect-ratio: 16/9;
  object-fit: cover;
  width: 100%;
  border-radius: 0.75rem 0.75rem 0 0;
  transition: transform 0.4s ease;
}
.card:hover .post-thumbnail {
  transform: scale(1.04);
}

/* ── Admin Sidebar ──────────────────────────────────────────── */
.admin-sidebar {
  width: 240px;
  min-height: 100vh;
  background: rgba(255, 255, 255, 0.02);
  border-right: 1px solid rgba(75, 85, 99, 0.15);
  position: fixed;
  top: 0;
  left: 0;
  overflow-y: auto;
  z-index: 40;
  transition: transform 0.3s ease;
}
.admin-content {
  margin-left: 240px;
  min-height: 100vh;
}
.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  border-radius: 0.625rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #9ca3af;
  transition: all 0.2s ease;
  margin: 0 0.5rem;
  text-decoration: none;
}
.admin-nav-item:hover,
.admin-nav-item.active {
  background: rgba(119, 6, 212, 0.15);
  color: #c084fc;
}
.admin-nav-item.active {
  border-left: none;
}
.admin-stat-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(75, 85, 99, 0.2);
  border-radius: 1rem;
  padding: 1.25rem;
}

/* ── Table ──────────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th {
  background: rgba(255, 255, 255, 0.04);
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid rgba(75, 85, 99, 0.15);
}
.data-table td {
  padding: 1rem;
  border-bottom: 1px solid rgba(75, 85, 99, 0.1);
  font-size: 0.875rem;
  color: #d1d5db;
  vertical-align: middle;
}
.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}
.data-table tr:last-child td {
  border-bottom: none;
}

/* ── Pagination ─────────────────────────────────────────────── */
.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(75, 85, 99, 0.2);
  color: #9ca3af;
  text-decoration: none;
  transition: all 0.2s;
}
.page-btn:hover,
.page-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(119, 6, 212, 0.4);
}
.page-btn.disabled {
  opacity: 0.35;
  pointer-events: none;
}

/* ── Responsive Mobile Admin ────────────────────────────────── */
@media (max-width: 768px) {
  .admin-sidebar {
    transform: translateX(-100%);
    background: #0a0a0c !important;
    border-right: 1px solid rgba(75, 85, 99, 0.3) !important;
    box-shadow: 20px 0 50px rgba(0, 0, 0, 0.8) !important;
  }
  .admin-sidebar.open {
    transform: translateX(0);
  }
  .admin-content {
    margin-left: 0;
  }
}

/* ── Animations ─────────────────────────────────────────────── */
/* ── Modal (Custom Alert/Confirm) ────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}
.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}
.modal-content {
  width: 100%;
  max-width: 400px;
  background: #0f172a;
  border: 1px solid rgba(75, 85, 99, 0.3);
  border-radius: 1.25rem;
  padding: 1.75rem;
  transform: scale(0.95);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}
.modal-overlay.active .modal-content {
  transform: scale(1);
}

/* ── Custom Dropdown (Select) ─────────────────────────────── */
.custom-select-wrapper {
  position: relative;
  user-select: none;
}
.custom-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(75, 85, 99, 0.3);
  border-radius: 0.75rem;
  color: #f3f4f6;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.custom-select-trigger:hover {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.06);
}
.custom-select-wrapper.open .custom-select-trigger {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(119, 6, 212, 0.2);
}
.custom-select-options {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  background: #0f172a;
  border: 1px solid rgba(75, 85, 99, 0.3);
  border-radius: 0.75rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
}
.custom-select-wrapper.open .custom-select-options {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.custom-option {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: #9ca3af;
  cursor: pointer;
  transition: all 0.2s;
}
.custom-option:hover {
  background: rgba(119, 6, 212, 0.15);
  color: #fff;
}
.custom-option.selected {
  background: var(--primary);
  color: #fff;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes pulse {
  0%,
  100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}
