/* =====================================
   Global Styles & Theme
   ===================================== */

:root {
  --bg-body: #020617;
  --bg-gradient-top: #020617;
  --bg-gradient-mid: #030712;
  --bg-gradient-bot: #020617;

  --bg-card: #020617;
  --bg-card-soft: #020617;
  --bg-elevated: #020617;

  --border-subtle: rgba(148, 163, 184, 0.22);
  --border-strong: rgba(148, 163, 184, 0.45);

  --accent: #e60000;         /* red */
  --accent-soft: #b30000;
  --accent-dark: #b91c1c;

  --text-main: #f9fafb;
  --text-muted: #9ca3af;
  --text-soft: #6b7280;

  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;

  --shadow-soft: 0 20px 50px rgba(15, 23, 42, 0.7);
}

/* Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at top left, #0f172a 0, transparent 48%),
    radial-gradient(circle at bottom right, #111827 0, transparent 45%),
    linear-gradient(
      to bottom,
      var(--bg-gradient-top),
      var(--bg-gradient-mid),
      var(--bg-gradient-bot)
    );
}

/* Links */
a {
  color: #93c5fd;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* Utility */
.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 88px 20px 72px;
}

.text-muted {
  color: var(--text-muted);
}

/* Small text helper */
.small,
.small-note {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* =====================================
   Top Header / Brand Bar
   ===================================== */

.page-header {
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 20px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 120px;
  height: 120px;
}

@media (max-width: 640px) {
  .brand-logo {
    width: 48px;
    height: 48px;
  }
}

.brand-name {
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.04em;
}

/* Top-right nav */
.nav-top-links {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.95rem;
}

.nav-link {
  color: var(--text-main);
  opacity: 0.9;
}
.nav-link:hover {
  opacity: 1;
}

/* =====================================
   Buttons
   ===================================== */

.btn,
button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.3rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  background: #111827;
  color: var(--text-main);
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    transform 0.08s ease,
    box-shadow 0.12s ease;
  text-decoration: none;
}

button:hover,
.btn:hover,
.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.6);
}

button:active,
.btn:active,
.button:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
  border-color: rgba(248, 113, 113, 0.7);
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-soft), var(--accent));
}

.btn-secondary {
  background: transparent;
  border-color: rgba(148, 163, 184, 0.4);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: rgba(15, 23, 42, 0.8);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-main);
}

.btn-ghost:hover {
  background: rgba(31, 41, 55, 0.85);
  border-color: rgba(55, 65, 81, 0.8);
}

.btn-full {
  width: 100%;
}

.btn-danger {
  background: linear-gradient(135deg, #e60000, #cc0000);
  color: white;
  border: 1px solid rgba(255, 80, 80, 0.7);
}

.btn-danger:hover {
  background: linear-gradient(135deg, var(--accent-soft), var(--accent));
  
}

/* =====================================
   Global Forms & Messages
   ===================================== */

label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
  color: var(--text-muted);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="tel"],
textarea {
  width: 100%;
  padding: 10px;
  margin: 4px 0 10px;
  border-radius: 0.65rem;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.95);
  color: var(--text-main);
  font: inherit;
}

/* =====================================
   Font & Typography block spacing
   ===================================== */

.font-block label {
  margin-bottom: 6px;
  display: block;
}

.font-block .select-input,
.font-block input[type="text"] {
  margin-bottom: 14px !important;
}

.font-block .small-note {
  margin-top: -4px;
  margin-bottom: 18px;
  display: block;
}


input::placeholder,
textarea::placeholder {
  color: #6b7280;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: #e60000;
  box-shadow: 0 0 0 1px #e60000;
}

textarea {
  min-height: 90px;
  resize: vertical;
}

/* Inline table styles */
table {
  width: 100%;
  border-collapse: collapse;
  border-radius: 0.75rem;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.9);
}

table th,
table td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid rgba(30, 64, 175, 0.35);
  font-size: 0.9rem;
}

table th {
  text-align: left;
  background: #020617;
}

table tr:last-child td {
  border-bottom: none;
}

/* Messages */
.msg {
  margin: 0 0 0.8rem;
  padding: 0.7rem 0.85rem;
  border-radius: 0.75rem;
  font-size: 0.88rem;
}

.msg.info {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.7);
  color: #e5f0ff;
}

.msg.error {
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.8);
  color: #fee2e2;
}

.msg.success {
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.8);
  color: #dcfce7;
}

/* Top green banner e.g. ?deleted=1 */
.success-message {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(34, 197, 94, 0.15);
  color: #bbf7d0;
  border-bottom: 1px solid rgba(34, 197, 94, 0.5);
  text-align: center;
  font-size: 0.9rem;
}

/* Generic alerts */
.alert {
  margin: 0 0 0.8rem;
  padding: 0.7rem 0.85rem;
  border-radius: 0.75rem;
  font-size: 0.9rem;
}

.alert-success {
  background: rgba(22, 163, 74, 0.15);
  border: 1px solid rgba(22, 163, 74, 0.7);
}

.alert-error {
  background: rgba(220, 38, 38, 0.14);
  border: 1px solid rgba(220, 38, 38, 0.8);
}

/* Delete button (danger) */
.delete-btn {
  background: linear-gradient(135deg, #e60000, #cc0000);
  color: white;
  border: 1px solid rgba(255, 80, 80, 0.7);
}
.delete-btn:hover {
  background: linear-gradient(135deg, var(--accent-soft), var(--accent));
}

/* =====================================
   Landing Page – Hero Layout
   ===================================== */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 3.1fr) minmax(0, 2.4fr);
  gap: 36px;
  align-items: center;
  margin-top: 40px;
}

.hero-main {
  max-width: 640px;
}

.hero-title {
  font-size: 2.6rem;
  line-height: 1.1;
  margin: 0 0 0.7rem;
}

.hero-subtitle {
  margin: 0 0 1.1rem;
  font-size: 1rem;
  color: var(--text-muted);
}

.hero-bullets {
  list-style: none;
  padding: 0;
  margin: 0 0 1.4rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.hero-bullets li {
  margin-bottom: 0.4rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.hero-note {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.hero-preview {
  display: flex;
  justify-content: flex-end;
}

.hero-card {
  width: 100%;
  max-width: 340px;
  background: radial-gradient(circle at top left, #111827 0, #020617 48%);
  border-radius: 24px;
  padding: 18px 16px 20px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(148, 163, 184, 0.45);
}

.hero-card-header {
  display: flex;
  justify-content: center;
  margin-bottom: 0.8rem;
}

.hero-card-avatar {
  width: 72px;
  height: 72px;
  border-radius: 999px;
  background: radial-gradient(circle, #020617 0, #111827 70%);
  border: 2px solid rgba(248, 113, 113, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.hero-card-body {
  text-align: left;
}

.hero-card-name {
  margin: 0 0 0.15rem;
  font-size: 1.2rem;
}

.hero-card-headline {
  margin: 0 0 0.9rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.hero-card-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}

.hero-card-btn {
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  border: none;
  font-size: 0.9rem;
  font-weight: 500;
  background: rgba(15, 23, 42, 0.95);
  color: var(--text-main);
  text-align: center;
}

.hero-card-btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
  color: #fff;
}

.hero-card-text {
  font-size: 0.83rem;
  color: var(--text-muted);
}

.hero-footer {
  margin-top: 32px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* =====================================
   Auth Layout: Login / Register / Forgot
   ===================================== */

.auth-page {
  max-width: 420px;
  margin: 40px auto 80px;
  padding: 0 16px;
}

.auth-card {
  background: rgba(15, 23, 42, 0.96);
  border-radius: 18px;
  padding: 24px 24px 28px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.auth-title {
  margin: 0 0 0.35rem;
  font-size: 1.6rem;
}

.auth-subtitle {
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.auth-errors {
  margin-bottom: 1rem;
  padding: 0.75rem 0.85rem;
  border-radius: 0.75rem;
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.6);
  font-size: 0.9rem;
}

.auth-errors div + div {
  margin-top: 0.25rem;
}

.auth-links,
.auth-bottom {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.auth-links a,
.auth-bottom a {
  color: #93c5fd;
  text-decoration: none;
}

.auth-links a:hover,
.auth-bottom a:hover {
  text-decoration: underline;
}

.auth-fields {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* =====================================
   Dashboard / Edit Profile Layout
   ===================================== */

.wrap {
  max-width: 1024px;
  margin: 40px auto 72px;
  padding: 0 16px;
}

.top,
.bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Section titles used throughout */
.section-title {
  margin: 1.8rem 0 0.6rem;
  font-size: 1.05rem;
}

/* Generic layout rows (edit_profile) */
.row {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
}
.row > div {
  flex: 1;
}

/* URL box (public card link) */
.url-box {
  padding: 0.5rem 0.75rem;
  border-radius: 0.75rem;
  border: 1px dashed rgba(148, 163, 184, 0.7);
  font-size: 0.88rem;
  background: rgba(15, 23, 42, 0.9);
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
}

/* Meta list */
.meta {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 6px 12px;
  font-size: 0.9rem;
}
.meta-label {
  color: var(--text-muted);
}
.meta-value {
  color: var(--text-main);
}

/* Image preview (profile + header) */
.photo-preview {
  margin-top: 0.25rem;
  width: 100%;
  max-width: 220px;
  border-radius: 0.9rem;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.5);
}
.photo-preview img {
  display: block;
  width: 100%;
  height: auto;
}

/* Footer at bottom of card pages */
.footer {
  margin-top: 1.2rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
}
.footer a {
  color: #fca5a5;
}

/* =====================================
   Public Card (card.php)
   ===================================== */

.shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
}

.card {
  width: 100%;
  max-width: 420px;
  background: radial-gradient(circle at top, #111827 0, #020617 58%);
  border-radius: 26px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(148, 163, 184, 0.5);
  overflow: hidden;
}

/* Header image */
.header-wrap img {
  display: block;
  width: 100%;
  height: auto;
}

/* Profile bubble */
.profile-wrap {
  display: flex;
  justify-content: center;
  margin-top: -42px;
  margin-bottom: 8px;
}
.profile-wrap img {
  width: 96px;
  height: 96px;
  border-radius: 999px;
  border: 3px solid #020617;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.7);
}

/* Card body */
.content {
  padding: 12px 18px 16px;
}

.owner {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Contact buttons on public card */
.call-buttons,
.email-buttons,
.other-buttons,
.social-grid {
  margin-top: 10px;
}

.call-buttons button,
.email-buttons button,
.other-buttons a {
  width: 100%;
}

.public-card-buttons .button {
  width: 100%;
}

/* Social links */
.social-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.55);
  font-size: 0.9rem;
  color: var(--text-main);
}
.social-link:hover {
  background: rgba(15, 23, 42, 1);
  border-color: rgba(248, 113, 113, 0.7);
}

/* Public card note text */
.public-card-note {
  margin-top: 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Center-shell for “Card not found” etc. */
.center-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

/* =====================================
   Misc
   ===================================== */

/* Tags / badges */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.55);
  color: var(--text-muted);
}

/* Bottom links on auth pages */
.bottom {
  margin-top: 1rem;
}

/* =====================================
   Responsive
   ===================================== */

@media (max-width: 900px) {
  .page-header {
    padding: 16px 16px 0;
  }
  .page {
    padding: 72px 16px 56px;
  }
  .hero {
    grid-template-columns: minmax(0, 1fr);
  }
  .hero-preview {
    justify-content: flex-start;
  }
  .hero-card {
    max-width: 100%;
  }
}

@media (max-width: 640px) {
  .top,
  .bottom {
    flex-direction: column;
    align-items: flex-start;
  }
  .row {
    flex-direction: column;
  }
}
/* =====================================
   Dashboard
   ===================================== */

.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}

.dash-title {
  margin: 0 0 4px;
  font-size: 1.3rem;
}

.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.dash-card {
  background: rgba(15, 23, 42, 0.96);
  border-radius: 18px;
  padding: 18px 16px 20px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(148, 163, 184, 0.45);
}

.dash-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.dash-value {
  font-size: 0.98rem;
  font-weight: 500;
}

.dash-value a {
  color: #ff4b4b;
}

.dash-date {
  font-size: 1.6rem;
  font-weight: 600;
  color: #ff4b4b;
}

.dash-actions {
  margin-top: 8px;
}

.dash-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 640px) {
  .dash-header {
    flex-direction: column;
    align-items: flex-start;
}
/* Fix spacing below Font & Typography block */
.font-block {
  margin-bottom: 0; /* let the button control the gap */
}

.font-block .small-note {
  margin-bottom: 6px;
}

/* Add real gap between font block and Save button */
.font-block + .btn.btn-primary,
.font-block + .btn-primary {
  margin-top: 24px !important;  /* increase/decrease as you like */
}


/* Fix brand text turning blue */
.brand-link,
.brand-link:visited,
.brand-link:active {
  color: #ffffff !important;
  text-decoration: none !important;
}

.brand-name {
  color: #ffffff !important;
  font-weight: 600;
}

.brand-link:hover .brand-name {
  opacity: 0.85;
}
