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

:root {
  --primary-hsl: 220, 90%, 56%;
  --primary: hsl(var(--primary-hsl));
  --primary-hover: hsl(220, 90%, 46%);
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  
  --bg-light: #f5f7fa;
  --bg-dark: #0b0f19;
  
  --card-light: rgba(255, 255, 255, 0.85);
  --card-dark: rgba(17, 24, 39, 0.8);
  
  --text-light: #1f2937;
  --text-dark: #f3f4f6;
  
  --text-muted-light: #6b7280;
  --text-muted-dark: #9ca3af;
  
  --border-light: rgba(229, 231, 235, 0.8);
  --border-dark: rgba(31, 41, 55, 0.6);
  
  --bg: var(--bg-light);
  --card-bg: var(--card-light);
  --text: var(--text-light);
  --text-muted: var(--text-muted-light);
  --border: var(--border-light);
  --glow: rgba(59, 130, 246, 0.15);
  
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.1);
  
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font-sans: 'Inter', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
}

[data-theme="dark"] {
  --bg: var(--bg-dark);
  --card-bg: var(--card-dark);
  --text: var(--text-dark);
  --text-muted: var(--text-muted-dark);
  --border: var(--border-dark);
  --glow: rgba(59, 130, 246, 0.3);
}

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

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  transition: var(--transition);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Glassmorphism Header */
header {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: var(--transition);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-section a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.logo-icon {
  background: linear-gradient(135deg, var(--primary), #3b82f6);
  color: white;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px var(--glow);
}

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

.nav-item {
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: var(--transition);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
}

.nav-item:hover {
  background-color: rgba(59, 130, 246, 0.08);
  color: var(--primary);
}

.theme-toggle-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.5rem;
  border-radius: 50%;
  cursor: pointer;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.theme-toggle-btn:hover {
  background-color: rgba(59, 130, 246, 0.08);
  border-color: var(--primary);
}

/* Main Layout */
main {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem;
}

/* Card Styling */
.card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 2rem;
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  border-color: rgba(59, 130, 246, 0.25);
}

/* Grid for Portal tools */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.tool-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: var(--text);
}

.tool-icon {
  font-size: 1.6rem;
  margin-bottom: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: rgba(59, 130, 246, 0.05);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  border: 1px solid rgba(59, 130, 246, 0.08);
}

.tool-card:hover .tool-icon {
  transform: translateY(-4px) scale(1.05);
  background: rgba(168, 85, 247, 0.08);
  border-color: rgba(168, 85, 247, 0.15);
  box-shadow: 0 4px 15px rgba(168, 85, 247, 0.1);
}

.tool-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.tool-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  flex-grow: 1;
  margin-bottom: 1.5rem;
}

.tool-badge {
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 600;
  background-color: rgba(59, 130, 246, 0.1);
  color: var(--primary);
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
}

/* Title & typography */
h1 {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 0.5rem;
}

.subtitle {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-top: -0.5rem;
  margin-bottom: 2.5rem;
  max-width: 800px;
  line-height: 1.6;
}

/* AdSense Placeholder */
.adsense-container {
  background: rgba(156, 163, 175, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  margin: 1.5rem 0;
  min-height: 80px;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  opacity: 0.85;
}

/* SEO Content Section */
.seo-section {
  margin-top: 4rem;
  border-top: 1px solid var(--border);
  padding-top: 2rem;
}

.seo-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.seo-content {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.seo-content p {
  margin-bottom: 1rem;
}

/* Footer */
footer {
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: auto;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--primary);
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .header-container {
    padding: 1rem;
  }
  .nav-menu {
    gap: 1rem;
  }
  .nav-item {
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
  }
  main {
    padding: 1rem;
  }
  h1 {
    font-size: 1.75rem;
  }
}

/* Recent Checked Sites responsive grid */
.recent-checks-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  font-size: 0.85rem;
  line-height: 1.5;
  width: 100%;
}

.recent-check-card {
  background: rgba(156, 163, 175, 0.03);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  min-width: 0;
}

@media (max-width: 900px) {
  .recent-checks-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .recent-checks-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Interactive Glassmorphic Filter Board --- */
.filter-board {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 1.75rem;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(168, 85, 247, 0.16);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px -12px rgba(168, 85, 247, 0.12), var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  box-sizing: border-box;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

[data-theme="dark"] .filter-board {
  background: rgba(11, 15, 25, 0.55);
  border-color: rgba(168, 85, 247, 0.22);
  box-shadow: 0 20px 50px -12px rgba(168, 85, 247, 0.25), 0 8px 30px rgba(0, 0, 0, 0.3);
}

/* Futuristic ambient background glow inside panel */
.filter-board::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -20%;
  width: 60%;
  height: 100%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.04), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.filter-search-wrapper {
  position: relative;
  width: 100%;
  z-index: 1;
}

.filter-search-input {
  width: 100%;
  padding: 0.95rem 1.5rem 0.95rem 3.25rem;
  font-size: 1rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.5);
  border: 1.5px solid var(--border);
  border-radius: 50px;
  outline: none;
  font-family: inherit;
  box-sizing: border-box;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
  transition: var(--transition);
}

[data-theme="dark"] .filter-search-input {
  background: rgba(17, 24, 39, 0.45);
}

.filter-search-input:focus {
  border-color: #a855f7;
  background: var(--card-bg);
  box-shadow: 0 0 25px rgba(168, 85, 247, 0.22), inset 0 2px 4px rgba(0, 0, 0, 0.01);
}

.filter-search-icon {
  position: absolute;
  left: 1.35rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary);
  font-size: 1.2rem;
  pointer-events: none;
  opacity: 0.85;
}

.filter-search-clear {
  position: absolute;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(156, 163, 175, 0.1);
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  transition: var(--transition);
}

.filter-search-clear:hover {
  color: white;
  background: var(--danger);
  transform: translateY(-50%) rotate(90deg);
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  width: 100%;
  z-index: 1;
}

.filter-tab-btn {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(168, 85, 247, 0.1);
  border-radius: 30px;
  padding: 0.6rem 1.25rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: inherit;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
  transition: var(--transition);
}

[data-theme="dark"] .filter-tab-btn {
  background: rgba(17, 24, 39, 0.6);
  border-color: rgba(168, 85, 247, 0.15);
}

.filter-tab-btn:hover {
  background: var(--card-bg);
  border-color: #a855f7;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -6px rgba(168, 85, 247, 0.2);
}

.filter-tab-btn.active {
  background: linear-gradient(135deg, var(--primary), #a855f7);
  border-color: transparent;
  color: white;
  box-shadow: 0 8px 25px rgba(168, 85, 247, 0.35);
  transform: translateY(-1px);
}

.filter-count-badge {
  font-size: 0.72rem;
  font-family: 'Outfit', 'Inter', sans-serif;
  background: rgba(168, 85, 247, 0.08);
  color: var(--primary);
  border-radius: 20px;
  padding: 0.15rem 0.55rem;
  font-weight: 700;
  border: 1px solid rgba(168, 85, 247, 0.12);
  transition: var(--transition);
}

[data-theme="dark"] .filter-count-badge {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
}

.filter-tab-btn:hover .filter-count-badge {
  background: rgba(168, 85, 247, 0.15);
}

.filter-tab-btn.active .filter-count-badge {
  background: rgba(255, 255, 255, 0.25);
  color: white;
  border-color: rgba(255, 255, 255, 0.15);
}

/* Tool card animations */
.tool-card {
  transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1), transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s ease;
}

.tool-card.fade-out {
  opacity: 0;
  transform: scale(0.9) translateY(12px);
  pointer-events: none;
}

/* No results state styling */
.no-results-container {
  grid-column: 1 / -1;
  text-align: center;
  padding: 5rem 2rem;
  background: var(--card-bg);
  border: 1px dashed rgba(168, 85, 247, 0.25);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  box-sizing: border-box;
  animation: fadeInFilter 0.4s ease;
}

@keyframes fadeInFilter {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
  .filter-board {
    padding: 1.25rem;
    gap: 1.25rem;
    margin: 1rem auto;
  }
  .filter-tabs {
    gap: 0.6rem;
  }
  .filter-tab-btn {
    padding: 0.55rem 1rem;
    font-size: 0.82rem;
    flex: 1 1 calc(50% - 0.6rem);
    justify-content: center;
  }
}

