/* ============================================
   AI2Image - Clean Modern Design
   ============================================ */

/* ========== CSS Variables ========== */
:root {
  --bg: #0a0a0a;
  --bg-elevated: #141414;
  --bg-card: #1a1a1a;
  --bg-hover: #222222;
  --text: #f0f0f0;
  --text-secondary: #a0a0a0;
  --text-muted: #555555;
  --border: #222222;
  --border-light: #333333;
  --accent: #e0e0e0;
  --accent-hover: #ffffff;
  --cat-ui: #4a90d9;
  --cat-poster: #9b59b6;
  --cat-illustration: #e74c3c;
  --cat-infographic: #27ae60;
  --cat-photography: #f39c12;
  --cat-others: #7f8c8d;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;
  --font-sans: 'Inter', -apple-system, sans-serif;
  --transition: 150ms ease;
}

[data-theme="light"] {
  --bg: #f5f5f5;
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #f0f0f0;
  --text: #1a1a1a;
  --text-secondary: #555555;
  --text-muted: #999999;
  --border: #e0e0e0;
  --border-light: #d0d0d0;
  --accent: #333333;
  --accent-hover: #000000;
}

/* ========== Reset ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font-sans); background: var(--bg); color: var(--text); line-height: 1.5; transition: background var(--transition), color var(--transition); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; background: none; border: none; }

/* ========== Scrollbar ========== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }

/* ========== Container ========== */
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* ========== Navigation ========== */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 100; background: rgba(10,10,10,0.9); backdrop-filter: blur(20px); border-bottom: 1px solid var(--border); transition: background var(--transition); }
[data-theme="light"] .nav { background: rgba(255,255,255,0.9); }
.nav-inner { max-width: 1280px; margin: 0 auto; padding: 0 24px; height: 60px; display: flex; align-items: center; justify-content: space-between; }
.nav-logo { font-family: var(--font-mono); font-size: 16px; font-weight: 700; color: var(--text); letter-spacing: -0.02em; }
.nav-logo span { color: var(--text-muted); font-weight: 400; }
.nav-links { display: flex; align-items: center; gap: 4px; list-style: none; }
.nav-links a { padding: 6px 14px; font-size: 13px; font-weight: 500; color: var(--text-secondary); border-radius: var(--radius-sm); transition: all var(--transition); }
.nav-links a:hover { color: var(--text); background: var(--bg-hover); }
.nav-links a.active { color: var(--text); background: var(--bg-card); }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.theme-btn { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); color: var(--text-muted); transition: all var(--transition); }
.theme-btn:hover { color: var(--text); background: var(--bg-hover); }
.nav-menu-btn { display: none; width: 36px; height: 36px; color: var(--text); }

@media (max-width: 768px) {
  .nav-links { display: none; position: absolute; top: 60px; left: 0; right: 0; background: var(--bg-elevated); border-bottom: 1px solid var(--border); padding: 8px; flex-direction: column; }
  .nav-links.active { display: flex; }
  .nav-menu-btn { display: flex; align-items: center; justify-content: center; }
}

/* ========== Hero ========== */
.hero { padding: 120px 0 60px; text-align: center; }
.hero-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 100px; font-size: 12px; color: var(--text-secondary); margin-bottom: 24px; }
.hero h1 { font-family: var(--font-mono); font-size: clamp(28px, 5vw, 48px); font-weight: 700; line-height: 1.1; margin-bottom: 16px; letter-spacing: -0.02em; }
.hero h1 .gradient { background: linear-gradient(135deg, #3b82f6, #06b6d4); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero p { font-size: 16px; color: var(--text-secondary); max-width: 500px; margin: 0 auto 32px; line-height: 1.6; }
.hero-notice { font-size: 13px; color: var(--text-muted); margin: -16px 0 24px; }
.hero-stats { display: flex; justify-content: center; gap: 40px; }
.hero-stat { text-align: center; }
.hero-stat-val { font-family: var(--font-mono); font-size: 28px; font-weight: 700; color: var(--text); }
.hero-stat-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 4px; }

/* ========== Search ========== */
.search-box { max-width: 600px; margin: 0 auto 40px; position: relative; }
.search-box input { width: 100%; padding: 14px 20px 14px 48px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-lg); font-size: 15px; color: var(--text); outline: none; transition: all var(--transition); }
.search-box input:focus { border-color: var(--border-light); box-shadow: 0 0 0 3px rgba(99,102,241,0.1); }
.search-box input::placeholder { color: var(--text-muted); }
.search-box svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--text-muted); }

/* ========== Section ========== */
.section { padding: 40px 0; }
.section-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 24px; }
.section-title { font-family: var(--font-mono); font-size: 18px; font-weight: 600; }
.section-subtitle { font-size: 13px; color: var(--text-muted); }

/* ========== Category Grid ========== */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.cat-card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 24px; transition: all var(--transition); cursor: pointer; display: flex; flex-direction: column; gap: 12px; }
.cat-card:hover { transform: translateY(-2px); border-color: var(--border-light); box-shadow: 0 8px 24px rgba(0,0,0,0.2); }
.cat-card-icon { width: 40px; height: 40px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 20px; background: var(--bg-card); }
.cat-card h3 { font-size: 15px; font-weight: 600; }
.cat-card p { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.cat-card .count { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); margin-top: auto; }

/* ========== Filter Tabs ========== */
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.filter-tab { padding: 6px 14px; border-radius: 100px; font-size: 12px; font-weight: 500; color: var(--text-secondary); background: transparent; border: 1px solid var(--border); transition: all var(--transition); }
.filter-tab:hover { color: var(--text); border-color: var(--border-light); }
.filter-tab.active { color: var(--bg); background: var(--text); border-color: var(--text); }

/* ========== Cases Grid ========== */
.cases-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 24px; }
.case-card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; transition: all var(--transition); cursor: pointer; display: flex; flex-direction: column; }
.case-card:hover { transform: translateY(-3px); border-color: var(--border-light); box-shadow: 0 12px 32px rgba(0,0,0,0.25); }

/* Card Header */
.case-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px 8px; }
.case-header-left { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-muted); }
.case-header-left .case-cat-label { font-weight: 500; }
.case-header-right { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); }
.case-badge { display: inline-flex; align-items: center; padding: 2px 8px; background: #f0c040; color: #1a1a1a; font-size: 10px; font-weight: 700; border-radius: 3px; letter-spacing: 0.05em; }

/* Card Title */
.case-title { font-size: 18px; font-weight: 700; line-height: 1.35; padding: 0 16px 12px; color: var(--text); }

/* Card Thumb */
.case-thumb { aspect-ratio: 4/3; background: var(--bg-card); overflow: hidden; position: relative; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.case-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.case-card:hover .case-thumb img { transform: scale(1.03); }

/* Video Play Icon */
.video-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.3); pointer-events: none; }
.video-play svg { width: 48px; height: 48px; color: #fff; filter: drop-shadow(0 2px 8px rgba(0,0,0,0.4)); opacity: 0.9; }

/* Placeholder Thumb */
.case-thumb-placeholder { display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-hover) 100%); }
.case-placeholder-text { font-size: 48px; font-weight: 700; color: var(--border-light); font-family: var(--font-mono); user-select: none; }

/* Card Description */
.case-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.6; padding: 12px 16px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Card Prompt Section */
.case-prompt-box { margin: 0 16px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-card); }
.case-prompt-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid var(--border); background: var(--bg-elevated); }
.case-prompt-head span { font-size: 11px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.08em; }
.case-prompt-copy { font-size: 11px; padding: 3px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-secondary); background: transparent; cursor: pointer; transition: all var(--transition); }
.case-prompt-copy:hover { color: var(--text); border-color: var(--border-light); }
.case-prompt-body { padding: 10px 12px; font-family: var(--font-mono); font-size: 12px; line-height: 1.6; color: var(--text-secondary); white-space: pre-wrap; word-break: break-word; max-height: 80px; overflow: hidden; }

/* Card Footer Meta */
.case-meta { display: flex; align-items: center; justify-content: space-between; padding: 0 16px 12px; margin-top: auto; }
.case-tag { font-size: 11px; font-weight: 500; padding: 3px 10px; border-radius: 100px; }
.case-tag.ui { background: rgba(74,144,217,0.15); color: var(--cat-ui); }
.case-tag.poster { background: rgba(155,89,182,0.15); color: var(--cat-poster); }
.case-tag.illustration { background: rgba(231,76,60,0.15); color: var(--cat-illustration); }
.case-tag.infographic { background: rgba(39,174,96,0.15); color: var(--cat-infographic); }
.case-tag.photography { background: rgba(243,156,18,0.15); color: var(--cat-photography); }
.case-tag.others { background: rgba(127,140,141,0.15); color: var(--cat-others); }
.case-source { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); }

/* ========== Modal ========== */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.8); backdrop-filter: blur(8px); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 24px; opacity: 0; visibility: hidden; transition: all 0.3s ease; }
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-lg); width: 100%; max-width: 900px; max-height: 90vh; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.5); transform: scale(0.95); transition: transform 0.3s ease; }
.modal-overlay.active .modal { transform: scale(1); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 14px; font-weight: 600; }
.modal-close { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); color: var(--text-muted); transition: all var(--transition); }
.modal-close:hover { color: var(--text); background: var(--bg-hover); }
.modal-body { overflow-y: auto; padding: 24px; }
.modal-grid { display: grid; grid-template-columns: 1fr 320px; gap: 24px; }
.modal-media { order: 2; }
.modal-media img, .modal-media video { width: 100%; border-radius: var(--radius-md); border: 1px solid var(--border); }
.modal-info { order: 1; }
.modal-meta { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.modal-info-title { font-size: 22px; font-weight: 700; margin-bottom: 12px; line-height: 1.3; }
.modal-info-desc { font-size: 14px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 20px; }
.modal-props { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 20px; }
.modal-prop { padding: 10px; background: var(--bg-card); border-radius: var(--radius-sm); }
.modal-prop-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 2px; }
.modal-prop-value { font-size: 12px; color: var(--text-secondary); font-family: var(--font-mono); }
.modal-prompt { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.modal-prompt-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.modal-prompt-head span { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-secondary); }
.modal-prompt-copy { font-size: 11px; padding: 4px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-secondary); transition: all var(--transition); }
.modal-prompt-copy:hover { color: var(--text); border-color: var(--border-light); }
.modal-prompt-copy.copied { color: var(--cat-infographic); border-color: var(--cat-infographic); }
.modal-prompt-body { padding: 16px; font-family: var(--font-mono); font-size: 12px; line-height: 1.7; color: var(--text-secondary); white-space: pre-wrap; max-height: 200px; overflow-y: auto; }
.modal-foot { display: flex; gap: 12px; padding: 16px 24px; border-top: 1px solid var(--border); }
.modal-btn { flex: 1; padding: 10px; font-size: 13px; font-weight: 600; text-align: center; border-radius: var(--radius-sm); transition: all var(--transition); }
.modal-btn-primary { background: var(--text); color: var(--bg); }
.modal-btn-primary:hover { background: var(--accent-hover); }
.modal-btn-secondary { background: var(--bg-card); color: var(--text-secondary); border: 1px solid var(--border); }
.modal-btn-secondary:hover { background: var(--bg-hover); color: var(--text); }

@media (max-width: 768px) {
  .modal-grid { grid-template-columns: 1fr; }
  .modal-media { order: 1; }
  .modal-info { order: 2; }
  .cases-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .cases-grid { grid-template-columns: 1fr; }
  .cat-grid { grid-template-columns: 1fr; }
}

/* ========== Pagination ========== */
.pagination { display: flex; justify-content: center; gap: 4px; margin-top: 40px; }
.pagination button { padding: 8px 14px; font-family: var(--font-mono); font-size: 12px; color: var(--text-secondary); background: transparent; border: 1px solid transparent; border-radius: var(--radius-sm); transition: all var(--transition); }
.pagination button:hover { color: var(--text); border-color: var(--border); }
.pagination button.active { color: var(--bg); background: var(--text); border-color: var(--text); }
.pagination button:disabled { color: var(--text-muted); cursor: not-allowed; }

/* ========== Empty ========== */
.empty { text-align: center; padding: 80px 24px; grid-column: 1 / -1; }
.empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty h3 { font-size: 16px; margin-bottom: 8px; }
.empty p { font-size: 13px; color: var(--text-muted); }

/* ========== Toast ========== */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(100px); background: var(--bg-elevated); color: var(--text); padding: 12px 24px; border-radius: 100px; font-size: 13px; font-weight: 500; z-index: 2000; opacity: 0; transition: all 0.3s ease; border: 1px solid var(--border); box-shadow: 0 8px 24px rgba(0,0,0,0.3); }
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ========== Footer ========== */
.footer { border-top: 1px solid var(--border); padding: 32px 24px; text-align: center; font-size: 12px; color: var(--text-muted); font-family: var(--font-mono); }
