/* ==========================================================================
   4407.jp FreeApp - Clean & Bright Light Theme
   ========================================================================== */

:root {
  --font-primary: 'Plus Jakarta Sans', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
  
  /* Bright Light Palette */
  --bg-dark: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-hover: #f1f5f9;
  --border-color: #e2e8f0;
  --border-color-hover: #cbd5e1;
  
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;

  /* Accent Colors */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --accent-emerald: #10b981;

  /* Radius & Shadows */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1);
  --shadow-card-hover: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  
  --transition-fast: 0.15s ease;
  --transition-smooth: 0.2s ease;
}

/* Global Reset & Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  color-scheme: light;
}

body {
  font-family: var(--font-primary);
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(248, 250, 252, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 16px 0;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.2rem;
  color: #0f172a;
  letter-spacing: -0.3px;
}

.logo-icon {
  font-size: 1.2rem;
}

.logo-dot {
  color: var(--primary);
}

.header-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 5px 12px;
  border-radius: var(--radius-full);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  background-color: var(--accent-emerald);
  border-radius: 50%;
}

/* Hero Section (Spacious & Light) */
.hero-section {
  padding: 72px 0 56px;
  text-align: center;
}

.hero-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-title {
  font-size: clamp(2.2rem, 4.5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.5px;
  margin-bottom: 20px;
  color: #0f172a;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--text-muted);
  max-width: 640px;
  margin-bottom: 40px;
  font-weight: 400;
  line-height: 1.7;
}

/* Search & Filters Controls */
.controls-wrapper {
  width: 100%;
  max-width: 680px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: center;
}

.search-box {
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 4px 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
  transition: var(--transition-fast);
}

.search-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.search-icon {
  font-size: 1rem;
  margin-right: 10px;
  opacity: 0.5;
  flex-shrink: 0;
}

.search-box input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: #0f172a;
  font-size: 0.98rem;
  font-family: inherit;
  padding: 13px 0;
  min-width: 0;
}

.search-box input::placeholder {
  color: var(--text-dim);
}

.clear-btn {
  background: #e2e8f0;
  border: none;
  color: var(--text-muted);
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  max-width: 22px;
  max-height: 22px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  line-height: 1;
  padding: 0;
  margin-left: 8px;
  flex-shrink: 0;
  transition: var(--transition-fast);
}

.clear-btn:hover {
  background: #cbd5e1;
  color: #0f172a;
}

.category-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.filter-chip {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 7px 16px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition-fast);
}

.filter-chip:hover {
  background: var(--bg-surface-hover);
  color: var(--text-main);
  border-color: var(--border-color-hover);
}

.filter-chip.active {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
  font-weight: 600;
}

/* Main Grid & Cards */
.main-content {
  padding-bottom: 80px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

.section-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
}

.view-stats {
  font-size: 0.82rem;
  color: var(--text-dim);
}

.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

/* App Card Styling */
.app-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
  transition: var(--transition-smooth);
}

.app-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-color-hover);
  box-shadow: var(--shadow-card-hover);
}

.card-banner {
  height: 90px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f1f5f9;
  border-bottom: 1px solid var(--border-color);
  text-decoration: none;
  color: inherit;
}

a.card-banner.card-banner-interactive {
  cursor: pointer;
}

.card-banner-interactive .card-icon {
  transition: transform var(--transition-fast);
}

.card-banner-interactive:hover .card-icon {
  transform: scale(1.1);
}

.card-icon {
  font-size: 2.4rem;
  width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.card-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.card-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-header-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.card-category {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 6px;
  color: #0f172a;
}

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

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: auto;
  margin-bottom: 18px;
}

.tag {
  font-size: 0.72rem;
  color: var(--text-muted);
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition-fast);
  border: none;
}

.btn-primary {
  background: #2563eb;
  color: #ffffff;
}

.btn-primary:hover {
  background: #1d4ed8;
}

.btn-secondary {
  background: #f1f5f9;
  color: var(--text-dim);
  border: 1px solid var(--border-color);
}

.btn-secondary:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.card-about {
  text-align: center;
  margin-top: 10px;
}

.about-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-dim);
  text-decoration: none;
  transition: var(--transition-fast);
  padding: 2px 4px;
}

.about-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* Usage & Guidelines Section */
.usage-section {
  margin-top: 5rem;
}

.usage-section .section-header {
  justify-content: center;
  text-align: center;
}

.usage-section .section-title {
  font-size: 2rem;
}

.usage-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.usage-card {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 1rem 2rem;
  box-shadow: none;
}

.usage-card h3 {
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 8px;
}

.usage-card p {
  font-size: 1.12rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.usage-card a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.usage-card a:hover {
  text-decoration: underline;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-top: 16px;
}

.empty-icon {
  font-size: 2.2rem;
  margin-bottom: 10px;
  opacity: 0.4;
}

.empty-state h3 {
  font-size: 1.05rem;
  margin-bottom: 6px;
  color: #0f172a;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 16px;
}

.empty-state .btn {
  width: auto;
  display: inline-flex;
}

/* Footer (Flexbox Vertically Centered) */
.site-footer {
  background: #f1f5f9;
  border-top: 1px solid var(--border-color);
  padding: 24px 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.footer-creator {
  font-size: 0.88rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}

.creator-link {
  color: #2563eb;
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  vertical-align: middle;
  transition: var(--transition-fast);
}

.creator-link:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.x-icon {
  width: 14px;
  height: 14px;
  display: inline-block;
  flex-shrink: 0;
  position: relative;
  top: 1px;
}

.footer-bottom {
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .hero-section {
    padding: 48px 0 36px;
  }

  .search-box {
    padding: 3px 12px;
  }

  .search-box input {
    font-size: 0.84rem;
    padding: 11px 0;
  }

  .clear-btn {
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    max-width: 20px;
    max-height: 20px;
    font-size: 0.7rem;
    margin-left: 6px;
  }

  .apps-grid {
    grid-template-columns: 1fr;
  }

  .usage-section {
    margin-top: 3.5rem;
  }

  .usage-card {
    padding: 1rem 0;
  }

  .usage-card h3 {
    font-size: 1.2rem;
  }

  .usage-card p {
    font-size: 1rem;
  }
}
