/* ===== LifeOfMarkButler.com — Dark Cinematic Theme ===== */

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

:root {
  --accent: #3b82f6;
  --particle-color: #3b82f6;
  --bg-opacity: 0.65;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #0a0a0f;
  color: #ffffff;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== Full-screen Background ===== */

.bg-photo {
  position: fixed;
  top: -20px;
  left: -20px;
  width: calc(100% + 40px);
  height: calc(100% + 40px);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
  will-change: transform;
  transition: transform 0.1s ease-out;
}

.bg-default {
  background: linear-gradient(135deg, #0a0a1a 0%, #1a1a2e 30%, #16213e 60%, #0f3460 100%);
}

.bg-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, var(--bg-opacity));
  z-index: 1;
}

/* ===== Particle Canvas ===== */

#particleCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

/* ===== Cursor Trail ===== */

.cursor-dot {
  position: fixed;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  pointer-events: none;
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s;
  box-shadow: 0 0 6px var(--accent), 0 0 12px var(--accent);
}

/* ===== Main Content ===== */

.content {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 60px 20px;
}

/* ===== Profile Section ===== */

.profile-section {
  text-align: center;
  margin-bottom: 40px;
}

.profile-name {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: #ffffff;
  text-shadow:
    0 0 20px rgba(255, 255, 255, 0.15),
    0 0 40px var(--accent),
    0 0 80px color-mix(in srgb, var(--accent) 40%, transparent);
  opacity: 0;
  transform: translateY(30px) scale(0.95);
  animation: fadeUp 0.8s ease-out forwards;
}

.profile-tagline {
  font-size: clamp(1rem, 3vw, 1.3rem);
  font-weight: 300;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.8s ease-out 0.3s forwards;
}

/* ===== Links Section ===== */

.links-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 420px;
}

.link-button {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 24px;
  border-radius: 16px;
  text-decoration: none;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.25s ease;
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.6s ease-out forwards;
}

.link-button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent);
  box-shadow: 0 0 20px color-mix(in srgb, var(--accent) 30%, transparent),
              0 4px 30px rgba(0, 0, 0, 0.3);
  transform: translateY(-2px) scale(1.03);
}

.link-button:active {
  transform: scale(0.98);
}

.link-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity 0.25s;
}

.link-icon svg {
  width: 22px;
  height: 22px;
}

.link-button:hover .link-icon {
  opacity: 1;
}

.link-label {
  flex: 1;
  text-align: center;
}

/* ===== Bio Section ===== */

.bio-section {
  margin-top: 40px;
  width: 100%;
  max-width: 420px;
  opacity: 0;
  animation: fadeUp 0.8s ease-out 1.2s forwards;
}

.bio-toggle {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.9rem;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 8px 0;
  width: 100%;
  text-align: center;
  transition: color 0.2s;
}

.bio-toggle:hover {
  color: rgba(255, 255, 255, 0.8);
}

.bio-toggle::after {
  content: ' +';
}

.bio-toggle.open::after {
  content: ' −';
}

.bio-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
  padding: 0 20px;
}

.bio-content.open {
  max-height: 500px;
  padding: 16px 20px;
}

.bio-content p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
  line-height: 1.7;
  text-align: center;
}

/* ===== Animations ===== */

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ===== Mobile ===== */

@media (max-width: 600px) {
  .content {
    padding: 40px 16px;
  }

  .link-button {
    padding: 14px 20px;
    border-radius: 14px;
  }

  .profile-name {
    text-shadow:
      0 0 10px rgba(255, 255, 255, 0.1),
      0 0 20px var(--accent);
  }
}

/* ===== Reduced Motion ===== */

@media (prefers-reduced-motion: reduce) {
  .profile-name,
  .profile-tagline,
  .link-button,
  .bio-section {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .link-button:hover {
    transform: none;
  }
}


/* ===========================================================
   ADMIN STYLES
   =========================================================== */

.admin-body {
  background: #111119;
  min-height: 100vh;
}

/* Admin Login */
.admin-login {
  max-width: 360px;
  margin: 120px auto;
  padding: 40px;
  background: #1a1a24;
  border-radius: 16px;
  border: 1px solid #2a2a3a;
}

.admin-login h1 {
  font-size: 1.5rem;
  margin-bottom: 24px;
  text-align: center;
}

.admin-login input {
  width: 100%;
  padding: 12px 16px;
  background: #0f0f17;
  border: 1px solid #333;
  border-radius: 10px;
  color: #fff;
  font-size: 1rem;
  margin-bottom: 16px;
  outline: none;
  font-family: 'Inter', sans-serif;
}

.admin-login input:focus {
  border-color: var(--accent);
}

.admin-login button {
  width: 100%;
  padding: 12px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  transition: opacity 0.2s;
}

.admin-login button:hover {
  opacity: 0.9;
}

.error-msg {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 16px;
  text-align: center;
}

/* Admin Container */
.admin-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 30px 20px 80px;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid #2a2a3a;
}

.admin-header h1 {
  font-size: 1.8rem;
}

.admin-header-actions {
  display: flex;
  gap: 10px;
}

/* Admin Sections */
.admin-section {
  background: #1a1a24;
  border: 1px solid #2a2a3a;
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 24px;
}

.admin-section h2 {
  font-size: 1.2rem;
  margin-bottom: 20px;
  color: rgba(255, 255, 255, 0.9);
}

.admin-section h3 {
  font-size: 1rem;
  margin-bottom: 16px;
  color: rgba(255, 255, 255, 0.7);
}

/* Forms */
.admin-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 500;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

input[type="text"],
input[type="url"],
input[type="password"],
textarea,
select {
  width: 100%;
  padding: 10px 14px;
  background: #0f0f17;
  border: 1px solid #333;
  border-radius: 10px;
  color: #fff;
  font-size: 0.95rem;
  outline: none;
  font-family: 'Inter', sans-serif;
  transition: border-color 0.2s;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
}

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

select {
  cursor: pointer;
}

input[type="file"] {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

small {
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.8rem;
}

.muted {
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.9rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border: none;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  color: #fff;
}

.btn-save {
  background: var(--accent);
}

.btn-save:hover {
  opacity: 0.9;
}

.btn-preview {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-preview:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-logout {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.25);
}

.btn-cancel {
  background: rgba(255, 255, 255, 0.1);
}

.btn-cancel:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-sm {
  padding: 6px 14px;
  border: none;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
  color: #fff;
}

.btn-edit {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

.btn-edit:hover {
  background: rgba(59, 130, 246, 0.3);
}

.btn-delete {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.btn-delete:hover {
  background: rgba(239, 68, 68, 0.25);
}

.form-actions {
  display: flex;
  gap: 10px;
}

/* Color Input */
.color-input-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
}

.color-input-wrap input[type="color"] {
  width: 44px;
  height: 44px;
  padding: 2px;
  border: 1px solid #333;
  border-radius: 10px;
  background: #0f0f17;
  cursor: pointer;
}

.color-text {
  width: 100px !important;
  font-family: 'Inter', monospace !important;
}

/* Range Input */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: #2a2a3a;
  border-radius: 3px;
  outline: none;
  border: none;
  padding: 0;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

/* Checkbox */
.checkbox-label {
  flex-direction: row !important;
  align-items: center !important;
  gap: 10px !important;
  cursor: pointer;
  font-size: 0.95rem !important;
  color: rgba(255, 255, 255, 0.8) !important;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #333;
  border-radius: 24px;
  transition: 0.3s;
}

.toggle-slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--accent);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(18px);
}

/* Links List */
.admin-links-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.admin-link-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #0f0f17;
  border: 1px solid #2a2a3a;
  border-radius: 12px;
  transition: border-color 0.2s;
}

.admin-link-item:hover {
  border-color: #444;
}

.link-drag-handle {
  cursor: grab;
  color: rgba(255, 255, 255, 0.3);
  font-size: 1.1rem;
  user-select: none;
  padding: 0 4px;
}

.link-drag-handle:active {
  cursor: grabbing;
}

.link-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.link-item-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.6;
}

.link-item-icon svg {
  width: 18px;
  height: 18px;
}

.link-url-display {
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Current Photo */
.current-photo {
  margin-bottom: 16px;
}

.current-photo img {
  max-width: 200px;
  max-height: 150px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid #2a2a3a;
}

.current-photo p {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 6px;
}

/* Dragging state */
.admin-link-item.dragging {
  opacity: 0.5;
  border-color: var(--accent);
}

.admin-link-item.drag-over {
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.05);
}
