@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/icon?family=Material+Icons+Round');

:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: #1a1f35;
  --bg-card-back: #0f1629;
  --accent: #6366f1;
  --accent-light: #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.3);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: rgba(99, 102, 241, 0.15);
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.3);
  --tag-resim: #f43f5e;
  --tag-video: #8b5cf6;
  --tag-komik: #f59e0b;
  --tag-tool: #06b6d4;
  --tag-gundelik: #10b981;
  --tag-genel: #6366f1;
  --radius: 16px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== HEADER ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
}
.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
}
.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent), #a855f7);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: white;
}
.logo-text {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.5px;
}
.logo-text span { color: var(--accent-light); }

.header-stats {
  display: flex;
  align-items: center;
  gap: 20px;
}
.stat-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-secondary);
}
.stat-badge .count {
  font-weight: 700;
  color: var(--accent-light);
}

/* ===== HERO ===== */
.hero {
  text-align: center;
  padding: 60px 24px 20px;
  position: relative;
}
.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 300px;
  background: radial-gradient(ellipse, var(--accent-glow), transparent 70%);
  pointer-events: none;
}
.hero h1 {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -1.5px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--text-primary), var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ===== FILTERS ===== */
.filters {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 20px 24px 30px;
  flex-wrap: wrap;
}
.filter-btn {
  padding: 8px 20px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: transparent;
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}
.filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent-light);
  background: rgba(99, 102, 241, 0.08);
}
.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  box-shadow: 0 4px 15px var(--accent-glow);
}
.filter-btn .material-icons-round { font-size: 16px; }

/* ===== GRID ===== */
.grid {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px 60px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

/* ===== CARD ===== */
.card-container {
  perspective: 1200px;
  height: 380px;
}
.card {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}
.card.flipped {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

/* FRONT */
.card-front {
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
}
.card-image {
  height: 180px;
  background: linear-gradient(135deg, #1e293b, #334155);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card-image .placeholder-icon {
  font-size: 48px;
  color: var(--text-muted);
  opacity: 0.4;
}
.card-tags {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.tag {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.tag-resim { background: rgba(244,63,94,0.2); color: #fb7185; }
.tag-video { background: rgba(139,92,246,0.2); color: #a78bfa; }
.tag-komik { background: rgba(245,158,11,0.2); color: #fbbf24; }
.tag-tool { background: rgba(6,182,212,0.2); color: #22d3ee; }
.tag-gündelik { background: rgba(16,185,129,0.2); color: #34d399; }
.tag-genel { background: rgba(99,102,241,0.2); color: #818cf8; }

.card-content {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.card-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}
.card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  flex: 1;
}
.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.card-date {
  font-size: 11px;
  color: var(--text-muted);
}
.flip-hint {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--accent-light);
  opacity: 0.7;
}
.flip-hint .material-icons-round { font-size: 14px; }

/* BACK */
.card-back {
  background: var(--bg-card-back);
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  padding: 24px;
}
.back-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.back-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-light);
}
.back-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}
.back-close:hover {
  background: rgba(244,63,94,0.15);
  color: #fb7185;
  border-color: rgba(244,63,94,0.3);
}
.prompt-text {
  flex: 1;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
  overflow-y: auto;
  font-family: 'Inter', monospace;
  word-break: break-word;
}
.copy-btn {
  margin-top: 16px;
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #a855f7);
  color: white;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}
.copy-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--accent-glow);
}
.copy-btn.copied {
  background: linear-gradient(135deg, var(--success), #059669);
  box-shadow: 0 8px 25px var(--success-glow);
}
.copy-btn .material-icons-round { font-size: 18px; }

/* ===== EMPTY STATE ===== */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
}
.empty-state .material-icons-round {
  font-size: 64px;
  color: var(--text-muted);
  opacity: 0.3;
  margin-bottom: 16px;
}
.empty-state h3 {
  font-size: 20px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.empty-state p {
  font-size: 14px;
  color: var(--text-muted);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.card-container {
  animation: fadeInUp 0.5s ease forwards;
  opacity: 0;
}
.card-container:nth-child(1) { animation-delay: 0.05s; }
.card-container:nth-child(2) { animation-delay: 0.1s; }
.card-container:nth-child(3) { animation-delay: 0.15s; }
.card-container:nth-child(4) { animation-delay: 0.2s; }
.card-container:nth-child(5) { animation-delay: 0.25s; }
.card-container:nth-child(6) { animation-delay: 0.3s; }
.card-container:nth-child(7) { animation-delay: 0.35s; }
.card-container:nth-child(8) { animation-delay: 0.4s; }
.card-container:nth-child(9) { animation-delay: 0.45s; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .hero h1 { font-size: 28px; }
  .hero p { font-size: 14px; }
  .grid {
    grid-template-columns: 1fr;
    padding: 0 16px 40px;
  }
  .card-container { height: 360px; }
  .header-stats .stat-badge:not(:first-child) { display: none; }
  .filters { padding: 16px 16px 20px; gap: 6px; }
  .filter-btn { padding: 6px 14px; font-size: 12px; }
  .hero { padding: 40px 16px 10px; }
}

@media (max-width: 480px) {
  .header-inner { height: 56px; }
  .logo-text { font-size: 16px; }
  .hero h1 { font-size: 24px; }
  .card-content { padding: 16px; }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }
