/* RememberSpace - Shared App Styles */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Syne:wght@700;800&display=swap');

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

:root {
  --warm: #F5E6D3;
  --glow: #E8A87C;
  --deep: #1A1118;
  --surface: #231B22;
  --muted: #9B8A8E;
  --accent: #D4956B;
  --light: #FFF8F0;
  --error: #E85D5D;
  --success: #6BCE6B;
}

body {
  font-family: 'Outfit', sans-serif;
  background: var(--deep);
  color: var(--warm);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Stars background */
.stars {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
}
.star {
  position: absolute;
  width: 2px; height: 2px;
  background: var(--warm);
  border-radius: 50%;
  animation: twinkle 4s ease-in-out infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 0.8; }
}
.star:nth-child(odd) { animation-delay: -2s; }
.star:nth-child(3n) { animation-duration: 6s; width: 3px; height: 3px; }
.star:nth-child(5n) { animation-duration: 3s; }

/* Navigation */
.app-nav {
  position: fixed;
  top: 0; width: 100%;
  padding: 18px 32px;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(to bottom, var(--deep) 60%, transparent);
}

.logo {
  font-family: 'Syne', sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--glow);
  text-decoration: none;
}
.logo span { color: var(--warm); font-weight: 700; }

.nav-links {
  display: flex;
  gap: 24px;
  align-items: center;
}
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 400;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--warm); }
.nav-links a.active { color: var(--glow); }

/* Main content */
.app-content {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 100px 32px 60px;
}

.app-content.wide {
  max-width: 1100px;
}

/* Page header */
.page-header {
  margin-bottom: 40px;
}
.page-header h1 {
  font-family: 'Syne', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--light);
  margin-bottom: 8px;
}
.page-header p {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 300;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid rgba(232, 168, 124, 0.08);
  border-radius: 16px;
  padding: 32px;
  transition: border-color 0.3s, transform 0.2s;
}
.card:hover {
  border-color: rgba(232, 168, 124, 0.2);
}
.card.clickable:hover {
  transform: translateY(-2px);
  cursor: pointer;
}

/* Form elements */
.form-group {
  margin-bottom: 20px;
}
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--warm);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  background: rgba(245, 230, 211, 0.05);
  border: 1px solid rgba(232, 168, 124, 0.15);
  border-radius: 10px;
  color: var(--light);
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  transition: border-color 0.2s, background 0.2s;
  outline: none;
}
.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--glow);
  background: rgba(245, 230, 211, 0.08);
}
.form-group textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.6;
}
.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--muted);
  opacity: 0.6;
}
.form-group .hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 6px;
}

/* Color picker row */
.color-row {
  display: flex;
  gap: 16px;
}
.color-row .form-group {
  flex: 1;
}
.color-picker-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}
.color-picker-wrap input[type="color"] {
  width: 44px;
  height: 44px;
  border: 2px solid rgba(232, 168, 124, 0.15);
  border-radius: 10px;
  padding: 2px;
  cursor: pointer;
  background: transparent;
}
.color-picker-wrap .color-hex {
  font-family: monospace;
  font-size: 0.9rem;
  color: var(--muted);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border: none;
  border-radius: 10px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--glow), var(--accent));
  color: var(--deep);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(232, 168, 124, 0.3);
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn-secondary {
  background: rgba(245, 230, 211, 0.08);
  color: var(--warm);
  border: 1px solid rgba(232, 168, 124, 0.15);
}
.btn-secondary:hover {
  background: rgba(245, 230, 211, 0.12);
  border-color: rgba(232, 168, 124, 0.3);
}
.btn-danger {
  background: rgba(232, 93, 93, 0.15);
  color: var(--error);
  border: 1px solid rgba(232, 93, 93, 0.2);
}
.btn-danger:hover {
  background: rgba(232, 93, 93, 0.25);
}
.btn-sm {
  padding: 8px 18px;
  font-size: 0.85rem;
}

/* Auth form */
.auth-container {
  max-width: 420px;
  margin: 80px auto 0;
}
.auth-container h1 {
  font-family: 'Syne', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--light);
  text-align: center;
  margin-bottom: 8px;
}
.auth-container .auth-sub {
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 32px;
  font-weight: 300;
}
.auth-container .auth-footer {
  text-align: center;
  margin-top: 24px;
  color: var(--muted);
  font-size: 0.9rem;
}
.auth-container .auth-footer a {
  color: var(--glow);
  text-decoration: none;
}
.auth-container .auth-footer a:hover {
  text-decoration: underline;
}

/* Alert */
.alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.9rem;
  margin-bottom: 20px;
  display: none;
}
.alert.error {
  background: rgba(232, 93, 93, 0.12);
  border: 1px solid rgba(232, 93, 93, 0.25);
  color: var(--error);
  display: block;
}
.alert.success {
  background: rgba(107, 206, 107, 0.12);
  border: 1px solid rgba(107, 206, 107, 0.25);
  color: var(--success);
  display: block;
}

/* Profile grid */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* Profile card */
.profile-card {
  background: var(--surface);
  border: 1px solid rgba(232, 168, 124, 0.08);
  border-radius: 16px;
  padding: 28px;
  transition: all 0.3s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.profile-card:hover {
  border-color: rgba(232, 168, 124, 0.25);
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}
.profile-card-photo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 16px;
  border: 2px solid rgba(232, 168, 124, 0.2);
}
.profile-card-initials {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Syne', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 16px;
  border: 2px solid rgba(232, 168, 124, 0.2);
}
.profile-card h3 {
  font-family: 'Syne', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--light);
  margin-bottom: 6px;
}
.profile-card .dates {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 10px;
}
.profile-card .bio-preview {
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 300;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.profile-card .message-count {
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Photo upload area */
.photo-upload-area {
  border: 2px dashed rgba(232, 168, 124, 0.2);
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  margin-bottom: 20px;
}
.photo-upload-area:hover {
  border-color: var(--glow);
  background: rgba(232, 168, 124, 0.05);
}
.photo-upload-area img {
  max-width: 200px;
  max-height: 200px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 12px;
}
.photo-upload-area p {
  color: var(--muted);
  font-size: 0.9rem;
}
.photo-upload-area input[type="file"] {
  display: none;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}
.empty-state h3 {
  font-family: 'Syne', sans-serif;
  font-size: 1.3rem;
  color: var(--light);
  margin-bottom: 12px;
}
.empty-state p {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 300;
  margin-bottom: 24px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

/* Loading spinner */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(232, 168, 124, 0.2);
  border-top-color: var(--glow);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 40px auto;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Glow line divider */
.glow-line {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, var(--glow), transparent);
  margin: 32px 0;
}

/* Dashboard actions */
.dashboard-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

/* Responsive */
@media (max-width: 768px) {
  .app-nav { padding: 16px 20px; }
  .app-content { padding: 80px 20px 40px; }
  .nav-links { gap: 16px; }
  .nav-links a { font-size: 0.85rem; }
  .profile-grid { grid-template-columns: 1fr; }
  .color-row { flex-direction: column; gap: 0; }
  .dashboard-actions { flex-direction: column; gap: 16px; align-items: flex-start; }
}

@media (max-width: 480px) {
  .page-header h1 { font-size: 1.6rem; }
  .auth-container h1 { font-size: 1.6rem; }
}

/* Profile page specific */
.profile-hero {
  text-align: center;
  padding: 40px 0;
}
.profile-photo-large {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 24px;
  display: block;
  border: 3px solid rgba(232, 168, 124, 0.3);
  box-shadow: 0 0 40px rgba(232, 168, 124, 0.15);
}
.profile-initials-large {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Syne', sans-serif;
  font-size: 3rem;
  font-weight: 800;
  margin: 0 auto 24px;
  border: 3px solid rgba(232, 168, 124, 0.3);
  box-shadow: 0 0 40px rgba(232, 168, 124, 0.15);
}
.profile-name {
  font-family: 'Syne', sans-serif;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  color: var(--light);
  margin-bottom: 8px;
}
.profile-dates {
  font-size: 1.1rem;
  color: var(--muted);
  margin-bottom: 24px;
  font-weight: 300;
}
.profile-bio {
  font-size: 1.05rem;
  color: var(--warm);
  line-height: 1.7;
  max-width: 600px;
  margin: 0 auto;
  font-weight: 300;
  white-space: pre-line;
}

/* Guestbook */
.guestbook-section {
  margin-top: 60px;
}
.guestbook-section h2 {
  font-family: 'Syne', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--light);
  margin-bottom: 24px;
}
.guestbook-form {
  margin-bottom: 40px;
}
.guestbook-form .form-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}
.guestbook-form .form-row .form-group {
  flex: 1;
  margin-bottom: 0;
}
.guestbook-entries {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.guestbook-entry {
  background: var(--surface);
  border: 1px solid rgba(232, 168, 124, 0.06);
  border-radius: 12px;
  padding: 20px 24px;
}
.guestbook-entry .entry-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.guestbook-entry .entry-author {
  font-weight: 600;
  color: var(--glow);
  font-size: 0.95rem;
}
.guestbook-entry .entry-date {
  font-size: 0.8rem;
  color: var(--muted);
}
.guestbook-entry .entry-message {
  color: var(--warm);
  font-size: 0.95rem;
  line-height: 1.6;
  font-weight: 300;
  white-space: pre-line;
}

@media (max-width: 768px) {
  .guestbook-form .form-row { flex-direction: column; gap: 0; }
  .guestbook-form .form-row .form-group { margin-bottom: 16px; }
}

/* Footer */
.app-footer {
  text-align: center;
  padding: 40px 32px;
  border-top: 1px solid rgba(232, 168, 124, 0.06);
  margin-top: 60px;
}
.app-footer p {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 300;
}
.app-footer a {
  color: var(--glow);
  text-decoration: none;
}
