/* ============================================
   FMS Otomasyon — Panel Hub
   Shared styles for hub, test, whatsapp pages
   ============================================ */

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

:root {
  --bg: #09090b;
  --bg-card: #0a0a0a;
  --bg-card-hover: rgba(255, 255, 255, 0.03);
  --text: #fafafa;
  --text-muted: #a1a1aa;
  --text-subtle: #71717a;
  --primary: #ffffff;
  --primary-glow: rgba(255, 255, 255, 0.15);
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.25);
  --radius: 0px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html, body {
  height: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Background grid */
.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 64px 64px;
  pointer-events: none;
  z-index: 0;
}

/* ---- Container ---- */
.hub-container {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 24px 24px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- Header ---- */
.hub-header {
  text-align: center;
  margin-bottom: 28px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.hub-header.visible {
  opacity: 1;
  transform: translateY(0);
}

.hub-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255,255,255,0.12), rgba(255,255,255,0.04));
  border: 1px solid var(--border);
  margin-bottom: 14px;
  color: var(--primary);
}

.hub-title {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 2px;
  color: var(--text);
}

.hub-subtitle {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text-subtle);
  margin-bottom: 0;
}

.hub-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 10px;
}

/* ---- Back Button ---- */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 20px;
  transition: color 0.2s;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease, color 0.2s;
}
.back-btn.visible {
  opacity: 1;
  transform: translateY(0);
}
.back-btn:hover {
  color: var(--text);
}

/* ---- Category List ---- */
.category-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ---- Category Item ---- */
.category-item {
  display: block;
  text-decoration: none;
  color: inherit;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.category-item.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Category Card ---- */
.category-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius);
  height: 84px;
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  cursor: pointer;
}

.category-item:hover .category-card,
.category-item:focus .category-card {
  height: 108px;
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  box-shadow: 0 0 40px var(--primary-glow);
}

.featured .category-card {
  height: 90px;
}
.category-item.featured:hover .category-card {
  height: 114px;
}

/* ---- Corner Brackets ---- */
.corner-tl, .corner-br {
  position: absolute;
  width: 24px;
  height: 24px;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.corner-tl { top: 10px; left: 10px; }
.corner-br { bottom: 10px; right: 10px; }

.corner-h, .corner-v {
  position: absolute;
  background: var(--primary);
}
.corner-tl .corner-h { top: 0; left: 0; width: 16px; height: 2px; }
.corner-tl .corner-v { top: 0; left: 0; width: 2px; height: 16px; }
.corner-br .corner-h { bottom: 0; right: 0; width: 16px; height: 2px; }
.corner-br .corner-v { bottom: 0; right: 0; width: 2px; height: 16px; }

.category-item:hover .corner-tl,
.category-item:hover .corner-br {
  opacity: 1;
}

/* ---- Content ---- */
.category-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 24px;
}

.category-info { flex: 1; }

.category-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border: 1px solid var(--border);
  margin-bottom: 6px;
}
.badge-primary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.2);
}
.badge-green {
  background: rgba(34, 197, 94, 0.1);
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.2);
}
.badge-blue {
  background: rgba(59, 130, 246, 0.1);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.2);
}
.badge-purple {
  background: rgba(168, 85, 247, 0.1);
  color: #c084fc;
  border-color: rgba(168, 85, 247, 0.2);
}
.badge-orange {
  background: rgba(249, 115, 22, 0.1);
  color: #fb923c;
  border-color: rgba(249, 115, 22, 0.2);
}
.badge-pink {
  background: rgba(236, 72, 153, 0.1);
  color: #f472b6;
  border-color: rgba(236, 72, 153, 0.2);
}

.category-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  transition: color 0.3s ease;
  letter-spacing: -0.01em;
}
.featured-title {
  font-size: 1.4rem;
}

.category-subtitle {
  margin-top: 3px;
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: color 0.3s ease;
  font-weight: 400;
}

.category-item:hover .category-title { color: var(--primary); }
.category-item:hover .category-subtitle { color: var(--text); }

/* ---- Category Icon (right side) ---- */
.category-icon {
  color: var(--primary);
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  flex-shrink: 0;
  margin-left: 20px;
}
.category-item:hover .category-icon {
  opacity: 1;
  transform: translateX(0);
}

/* ---- 3D Orbit Gallery ---- */
.orbit-gallery {
  position: relative;
  width: 100%;
  height: 340px;
  margin-top: 16px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.4);
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.orbit-gallery.visible {
  opacity: 1;
  transform: translateY(0);
}

.orbit-gallery canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.orbit-overlay {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}
.orbit-hint {
  font-size: 0.7rem;
  color: var(--text-subtle);
  background: rgba(0,0,0,0.6);
  padding: 4px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

/* ---- Footer ---- */
.hub-footer {
  text-align: center;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.hub-footer.visible {
  opacity: 1;
  transform: translateY(0);
}

.hub-logo {
  height: 28px;
  width: auto;
  object-fit: contain;
  margin-bottom: 10px;
  filter: grayscale(100%) brightness(1.5);
  opacity: 0.4;
  transition: opacity 0.3s, filter 0.3s;
}
.hub-logo:hover {
  opacity: 0.8;
  filter: grayscale(0%) brightness(1);
}

.hub-footer p {
  font-size: 0.75rem;
  color: var(--text-subtle);
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .hub-container {
    padding: 24px 16px 20px;
  }
  .hub-title, .hub-subtitle {
    font-size: 1.75rem;
  }
  .hub-header {
    margin-bottom: 20px;
  }
  .hub-icon {
    width: 44px;
    height: 44px;
    margin-bottom: 10px;
  }
  .category-card { height: 76px; }
  .category-item:hover .category-card { height: 96px; }
  .featured .category-card { height: 82px; }
  .category-item.featured:hover .category-card { height: 102px; }
  .category-content { padding: 0 16px; }
  .category-title { font-size: 1.05rem; }
  .featured-title { font-size: 1.2rem; }
  .category-subtitle { font-size: 0.75rem; }
  .category-icon svg { width: 22px; height: 22px; }
  .orbit-gallery { height: 260px; margin-top: 12px; }
}

@media (max-height: 800px) {
  .hub-container { padding-top: 20px; }
  .hub-header { margin-bottom: 16px; }
  .hub-icon { width: 40px; height: 40px; margin-bottom: 8px; }
  .hub-title, .hub-subtitle { font-size: 1.85rem; }
  .category-list { gap: 8px; }
  .category-card { height: 72px; }
  .category-item:hover .category-card { height: 92px; }
  .featured .category-card { height: 78px; }
  .orbit-gallery { height: 240px; margin-top: 10px; }
  .hub-footer { margin-top: 12px; padding-top: 10px; }
}
