/* ========================================
   MCStatus — Main Stylesheet
   ======================================== */

/* ---- CSS Variables ---- */
:root {
  --primary: #3b82f6;
  --secondary: #1e293b;
  --accent: #22c55e;

  /* Dark Mode (Default) */
  --bg: #060a13;
  --bg-secondary: #0a1020;
  --card: rgba(15, 23, 42, 0.6);
  --border: rgba(148, 163, 184, 0.08);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
}

html:not(.dark) {
  --bg: #f0f4ff;
  --bg-secondary: #e8eeff;
  --card: rgba(255, 255, 255, 0.8);
  --border: rgba(148, 163, 184, 0.15);
  --text-primary: #0f172a;
  --text-secondary: #64748b;
}

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

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

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- Custom Scrollbar ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

.custom-scrollbar::-webkit-scrollbar { width: 4px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ---- Pixel Grid Background ---- */
.pixel-grid {
  background-image:
    linear-gradient(rgba(148,163,184,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148,163,184,0.05) 1px, transparent 1px);
  background-size: 32px 32px;
}

/* ---- Navbar ---- */
.nav-scrolled {
  background: rgba(6, 10, 19, 0.85) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border-bottom: 1px solid var(--border) !important;
}

html:not(.dark) .nav-scrolled {
  background: rgba(240, 244, 255, 0.85) !important;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: 0.75rem;
  transition: all 0.2s ease;
  text-decoration: none;
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--card);
}

.nav-link.active {
  color: var(--accent);
  background: rgba(34, 197, 94, 0.08);
}

.mobile-nav-link {
  display: block;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: 0.75rem;
  transition: all 0.2s ease;
  text-decoration: none;
}

.mobile-nav-link:hover {
  color: var(--text-primary);
  background: rgba(148, 163, 184, 0.05);
}

.mobile-nav-link.active {
  color: var(--accent);
  background: rgba(34, 197, 94, 0.08);
}

/* ---- Dark Mode Icons ---- */
html.dark .dark-icon { display: inline-flex; }
html.dark .light-icon { display: none !important; }
html:not(.dark) .dark-icon { display: none !important; }
html:not(.dark) .light-icon { display: inline-flex; }

/* ---- Feature Cards ---- */
.feature-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.75rem;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.feature-card:hover {
  border-color: rgba(34, 197, 94, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.15);
}

/* ---- Quick Check Buttons ---- */
.quick-btn {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.375rem 0.875rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.quick-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(34, 197, 94, 0.05);
}

/* ---- Checker Loader ---- */
.checker-loader {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---- Floating Block Animation ---- */
.floating-block {
  animation: floatBlock 6s ease-in-out infinite;
}

@keyframes floatBlock {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(5deg); }
}

/* ---- Pulse Slow ---- */
.animate-pulse-slow {
  animation: pulseSlow 4s ease-in-out infinite;
}

@keyframes pulseSlow {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.05); }
}

/* ---- Fade Up Animation ---- */
.animate-fade-up {
  opacity: 0;
  transform: translateY(24px);
  animation: fadeUp 0.7s ease-out forwards;
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---- History Item ---- */
.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1.25rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.875rem;
  backdrop-filter: blur(10px);
  transition: all 0.2s ease;
  cursor: pointer;
  text-decoration: none;
}

.history-item:hover {
  border-color: rgba(34, 197, 94, 0.2);
  background: var(--bg-secondary);
}

/* ---- FAQ ---- */
.faq-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.875rem;
  overflow: hidden;
  backdrop-filter: blur(10px);
  transition: border-color 0.2s ease;
}

.faq-item.active {
  border-color: rgba(34, 197, 94, 0.2);
}

.faq-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1.125rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  gap: 1rem;
}

.faq-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding: 0 1.25rem;
}

/* ---- Toast ---- */
.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.875rem;
  backdrop-filter: blur(20px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-primary);
  min-width: 280px;
  max-width: 400px;
  animation: toastIn 0.3s ease-out;
}

.toast.removing {
  animation: toastOut 0.25s ease-in forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px) scale(0.95); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0) scale(1); }
  to { opacity: 0; transform: translateX(40px) scale(0.95); }
}

.toast-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.75rem;
}

.toast-success .toast-icon {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.toast-error .toast-icon {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.toast-info .toast-icon {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

/* ---- Select Styling ---- */
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

/* ---- Responsive Adjustments ---- */
@media (max-width: 640px) {
  .checker-loader {
    width: 40px;
    height: 40px;
  }
}