/* public/css/pt-ui.css */

/* --- Global Theme Variables --- */
:root {
  --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;
}

/* --- Base Body Styles (Fixes the White Background) --- */
body {
  margin: 0;
  background-color: var(--pt-bg);
  color: var(--pt-text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;

  /* REQUIRED for the background effects to sit behind content */
  position: relative;
  overflow-x: hidden;
}

/* --- Background Atmosphere (RESTORED) --- */
/* 1. The "Tiny Dots" Pattern */
body::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  /* Creates the 1px dots spaced 24px apart */
  background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,0.07) 1px, transparent 0);
  background-size: 32px 32px; /* Adjusted spacing to ~1/3 inch based on your request */
  pointer-events: none;
  z-index: -1;
  /* Fades the dots out at the bottom */
  mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
}

/* 2. The "Dim Top Light" (Glow) */
body::after {
  content: "";
  position: absolute;
  top: -100px; /* Sits slightly above viewport */
  left: 50%;
  transform: translateX(-50%); /* Centers it horizontally */
  width: 600px;
  height: 400px;
  /* Extremely subtle blue glow */
  background: radial-gradient(circle, rgba(59, 130, 246, 0.12) 0%, transparent 70%);
  z-index: -2;
  pointer-events: none;
}

/* --- Layout Containers --- */
.profile-container {
  max-width: 900px;
  margin: 40px auto;
  padding: 0 20px;
  width: 100%;
  flex: 1; /* Pushes footer down */
}

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

/* Auth card used for login modal AND standalone pages */
.pt-auth-card {
  background: var(--pt-card-bg);
  border-radius: 16px;
  border: 1px solid var(--pt-border);
  padding: 24px 28px;
  
  /* UPDATED: Reduced from 420px to 360px for a tighter, "mini" look */
  max-width: 400px; 
  
  width: 100%;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.7);
  box-sizing: border-box;
}

.pt-auth-title { font-size: 1.3rem; margin: 0; }
.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: 8px 10px; border-radius: 6px;
  border: 1px solid var(--pt-border); background: #050814;
  color: var(--pt-text); font-size: 0.9rem; box-sizing: border-box;
}
.pt-input:focus { outline: none; border-color: var(--pt-accent-1); }
.pt-input[readonly] { opacity: 0.6; cursor: not-allowed; }

.pt-btn-primary {
  border: none; padding: 9px 18px; border-radius: 999px;
  font-size: 0.95rem; font-weight: 500; cursor: pointer;
  background: linear-gradient(135deg, var(--pt-accent-1), var(--pt-accent-2));
  color: #fff;
}
.pt-btn-secondary {
  border-radius: 999px; border: 1px solid var(--pt-border);
  padding: 9px 18px; font-size: 0.9rem; cursor: pointer;
  background: transparent; color: var(--pt-muted);
}
.pt-btn-secondary:hover { background: rgba(255,255,255,0.05); color: #fff; }

/* --- Links & Messages --- */
.pt-auth-links { margin-top: 15px; font-size: 0.9rem; text-align: center; }
.pt-auth-link { color: #9cbeff; text-decoration: none; margin: 0 8px; } /* Added margin for spacing */
.pt-auth-link:hover { text-decoration: underline; }

.pt-auth-message { margin-top: 10px; font-size: 0.85rem; min-height: 18px; }
.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(5, 8, 20, 0.75); backdrop-filter: blur(4px); }
.pt-auth-modal-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

/* --- Admin / Profile Specifics (The missing pieces) --- */
.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 { /* Mapping old name to new style */
  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; }
@media (max-width: 1100px) { .pt-admin-grid { grid-template-columns: 1fr; } }

.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;
}

/* --- Table Styles --- */
.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); }

/* Footer */
.pt-footer {
  margin-top: auto; padding: 20px; text-align: center;
  color: var(--pt-muted); font-size: 0.8rem; opacity: 0.6;
}