/* css/home2.css */
/* MASTER HOME STYLESHEET
   ----------------------
   Consolidates:
   1. Core UI Primitives (formerly pt-ui.css)
   2. Home Page Layouts (Hero, Cards)
   3. Atmosphere Effects (Dots, Glow)
*/

/* ================= 1. CRITICAL RESET ================= */
/* Prevents padding from breaking layouts */
*, *::before, *::after {
  box-sizing: border-box;
}

/* ================= 2. VARIABLES ================= */
:root {
  /* --- Core Palette (Merged from pt-ui) --- */
  --pt-bg: #050814;
  --pt-card-bg: #0b1020;
  --pt-border: #28304a;
  --pt-text: #f5f7ff;
  --pt-muted: #a5b0d6;
  --pt-danger: #ff8080;
  --pt-success: #6fe3a1;
  --pt-accent-1: #4c8dff;
  --pt-accent-2: #9c6bff;

  /* --- Home Specific Palette --- */
  --bg-deep: #020617;
  --bg-surface: #0f172a;
  --bg-card-glass: rgba(30, 41, 59, 0.6);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --accent-blue: #3b82f6;   
  --accent-green: #10b981;  
  --accent-yellow: #eab308; 
  
  --border-subtle: rgba(255, 255, 255, 0.08);
}

/* ================= 3. BODY & ATMOSPHERE ================= */
body {
  margin: 0;
  padding: 0;
  background-color: var(--pt-bg);
  color: var(--pt-text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  /* create a stacking context so ::before/::after can sit above background */
  z-index: 0;
}

/* --- Atmosphere Effects (Dots & Glow) --- */

/* A. The "Tiny Dots" Starfield – softened for large screens */
body::before {
  content: "";
  position: fixed; 
  top: 0; 
  left: 0; 
  right: 0; 
  bottom: 0;
  background-image: radial-gradient(
    circle at 1px 1px,
    rgba(148, 163, 184, 0.18) 1px,
    transparent 0
  );
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
  mask-image: linear-gradient(to bottom, black 45%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 45%, transparent 100%);
}

/* B. The Center "Glow" – larger and more blurred to avoid harsh edges */
body::after {
  content: "";
  position: fixed;
  top: -180px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 560px;
  background:
    radial-gradient(
      circle,
      rgba(59, 130, 246, 0.22) 0%,
      rgba(59, 130, 246, 0.12) 25%,
      rgba(15, 23, 42, 0.0) 70%
    );
  filter: blur(28px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.9;
}

/* Lift header, hero + footer above the starfield/glow.
   Header background comes from header2.css (.pt-header). */
.pt-header,
.hero,
.pt-footer {
  position: relative;
  z-index: 1;
}

/* ================= 4. CORE UI PRIMITIVES (From pt-ui.css) ================= */
/* Layout Containers */
.profile-container {
  max-width: 900px;
  margin: 40px auto;
  padding: 0 20px;
  width: 100%;
  flex: 1; 
}

/* Auth Styles */
.pt-auth-full {
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top, #12182b 0, #050814 55%, #020313 100%);
}

.pt-auth-card {
  background: var(--pt-card-bg);
  border-radius: 16px;
  border: 1px solid var(--pt-border);
  padding: 24px 28px;
  max-width: 400px; 
  width: 100%;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.7);
}

.pt-auth-title { font-size: 1.3rem; margin: 0; color: var(--pt-text); }
.pt-auth-subtitle { font-size: 0.9rem; color: var(--pt-muted); margin: 4px 0 18px; }

/* Inputs & Buttons */
.pt-label { 
  display: block; 
  font-size: 0.85rem; 
  margin-bottom: 4px; 
  color: var(--pt-muted); 
}

.pt-input {
  width: 100%; 
  padding: 10px 12px; 
  border-radius: 6px;
  border: 1px solid var(--pt-border); 
  background: #0f172a;
  color: var(--pt-text); 
  font-size: 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.pt-input:focus { 
  outline: none; 
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}
.pt-input[readonly] { opacity: 0.6; cursor: not-allowed; }

.pt-btn-primary {
  border: none; 
  padding: 9px 18px; 
  border-radius: 6px;
  font-size: 0.95rem; 
  font-weight: 600; 
  cursor: pointer;
  background: var(--accent-blue);
  color: #fff;
  transition: background 0.2s;
}
.pt-btn-primary:hover { background: #2563eb; }

.pt-btn-secondary {
  border-radius: 6px; 
  border: 1px solid var(--pt-border);
  padding: 9px 18px; 
  font-size: 0.9rem; 
  cursor: pointer;
  background: transparent; 
  color: var(--pt-muted);
  transition: background 0.2s;
}
.pt-btn-secondary:hover { 
  background: rgba(255,255,255,0.05); 
  color: #fff; 
}

/* Links */
.pt-auth-links { 
  margin-top: 15px; 
  font-size: 0.9rem; 
  text-align: center; 
}
.pt-auth-link { 
  color: var(--accent-blue); 
  text-decoration: none; 
  margin: 0 8px; 
}
.pt-auth-link:hover { text-decoration: underline; }

/* Messages */
.pt-auth-message { 
  margin-top: 10px; 
  font-size: 0.85rem; 
  min-height: 18px; 
  text-align: center; 
}
.pt-auth-message.error { color: var(--pt-danger); }
.pt-auth-message.success { color: var(--pt-success); }

/* Modals */
.pt-auth-modal { 
  border: none; 
  padding: 0; 
  background: transparent; 
}
.pt-auth-modal::backdrop { 
  background: rgba(0, 0, 0, 0.7); 
  backdrop-filter: blur(4px); 
}
.pt-auth-modal-footer { 
  display: flex; 
  justify-content: flex-end; 
  gap: 8px; 
  margin-top: 20px; 
}

/* Admin Grid / Tags */
.pt-status-badge {
  padding: 2px 8px; 
  border-radius: 4px;
  font-size: 0.75rem; 
  font-weight: 600;
  text-transform: uppercase; 
  letter-spacing: 0.05em;
}
.pt-status-active { 
  background: rgba(111, 227, 161, 0.15); 
  color: #6fe3a1; 
}
.pt-status-inactive { 
  background: rgba(255, 128, 128, 0.15); 
  color: #ff8080; 
}

.pt-features-grid, 
.features-grid-readonly {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
  margin-top: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--pt-border);
  border-radius: 8px;
}
.pt-feature-item, 
.features-grid-readonly label {
  display: flex; 
  align-items: center; 
  gap: 8px;
  font-size: 0.85rem; 
  color: var(--pt-muted);
  cursor: pointer; 
  user-select: none;
}
.pt-feature-item input, 
.features-grid-readonly input { 
  accent-color: var(--pt-accent-1); 
  transform: scale(1.1); 
}

.pt-admin-grid { 
  display: grid; 
  grid-template-columns: 350px 1fr; 
  gap: 24px; 
}
.pt-org-tag {
  background: #1a2133; 
  border: 1px solid var(--pt-border);
  padding: 4px 10px; 
  border-radius: 20px;
  font-size: 0.8rem; 
  color: var(--pt-muted);
  display: inline-block;
}
.pt-table-wrapper {
  background: var(--pt-card-bg);
  border: 1px solid var(--pt-border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}
table.pt-table { 
  width: 100%; 
  border-collapse: collapse; 
  font-size: 0.9rem; 
}
table.pt-table th {
  background: rgba(255,255,255,0.03); 
  color: var(--pt-muted);
  text-align: left; 
  padding: 14px 16px; 
  font-weight: 500;
  border-bottom: 1px solid var(--pt-border);
}
table.pt-table td {
  padding: 14px 16px; 
  border-bottom: 1px solid var(--pt-border);
  color: var(--pt-text); 
  vertical-align: middle;
}
table.pt-table tr:hover td { 
  background: rgba(255,255,255,0.02); 
}

/* ================= 5. HOME PAGE SPECIFIC STYLES ================= */
/* Main Hero */
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  width: 100%; 
}

.hero-text {
  max-width: 600px;
  margin-bottom: 48px;
  animation: fadeIn 0.8s ease-out;
}

.hero-title {
  font-size: 36px;
  font-weight: 600;
  margin: 0 0 12px 0;
  background: linear-gradient(to right, #fff, #94a3b8);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.03em;
}

.hero-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

.card-unit {
  position: relative;
  perspective: 1000px;
}

/* Home Card Component */
.home-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  background: var(--bg-card-glass);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 32px 24px;
  height: 100%;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  overflow: hidden;
}

/* Hover Glow Overlay */
.home-card::before {
  content: "";
  position: absolute;
  top: 0; 
  left: 0; 
  right: 0; 
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Icon Wrapper */
.icon-wrapper {
  width: 64px;
  height: 64px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  margin-bottom: 20px;
  transition: transform 0.3s ease, background 0.3s ease;
  border: 1px solid rgba(255,255,255,0.05);
}

.hero-icon-svg {
  width: 32px;
  height: 32px;
  transition: stroke 0.3s ease;
}

.home-card h2 {
  margin: 0 0 12px 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.home-card p {
  margin: 0 0 24px 0;
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.6;
}

.cta {
  margin-top: auto;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-blue); 
  opacity: 0.9;
  transition: all 0.2s ease;
}

/* Card Themes */
/* Plugins (Blue) */
.store-svg path { stroke: #93c5fd; }
.card-unit:hover .store-card {
  border-color: var(--accent-blue);
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.1);
  transform: translateY(-5px);
}
.card-unit:hover .store-card .icon-wrapper {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.2);
}
.card-unit:hover .store-card .cta { 
  color: var(--accent-blue); 
  opacity: 1; 
}

/* Tools (Green) */
.tools-svg path { stroke: #6ee7b7; }
.card-unit:hover .tools-card {
  border-color: var(--accent-green);
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.1);
  transform: translateY(-5px);
}
.card-unit:hover .tools-card .icon-wrapper {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.2);
}
.card-unit:hover .tools-card .cta { 
  color: var(--accent-green); 
  opacity: 1; 
}

/* Knowledge (Yellow) */
.guides-svg path { stroke: #fde047; }
.card-unit:hover .guides-card {
  border-color: var(--accent-yellow);
  box-shadow: 0 0 30px rgba(234, 179, 8, 0.1);
  transform: translateY(-5px);
}
.card-unit:hover .guides-card .icon-wrapper {
  background: rgba(234, 179, 8, 0.1);
  border-color: rgba(234, 179, 8, 0.2);
}
.card-unit:hover .guides-card .cta { 
  color: var(--accent-yellow); 
  opacity: 1; 
}

/* Modal specific override for Home */
.pt-auth-modal-card {
  background: #1e293b;
  width: 400px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Footer */
.pt-footer {
  margin-top: auto; 
  padding: 24px; 
  text-align: center;
  background: rgba(2, 6, 23, 0.8);
  border-top: 1px solid var(--border-subtle);
  color: var(--text-muted); 
  font-size: 14px;
}
.pt-footer a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}
.pt-footer a:hover { color: var(--accent-blue); }

/* Animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 1100px) { 
  .pt-admin-grid { grid-template-columns: 1fr; } 
}

@media (max-width: 900px) {
  .cards-grid { 
    grid-template-columns: 1fr; 
    max-width: 400px; 
  }
  .hero-title { font-size: 28px; }
}
