/* ========================================
   bianra.com - Modern Design System
   Inspired by yu-hang.me (Argon Theme Style)
   ======================================== */

/* CSS Variables - Light/Dark Theme */
:root {
  --primary: #fa7298;
  --primary-light: #ffb8c9;
  --primary-dark: #e85d82;
  --bg: #f8f9fa;
  --surface: rgba(255, 255, 255, 0.85);
  --surface-solid: #ffffff;
  --text: #2d3748;
  --text-secondary: #718096;
  --text-muted: #a0aec0;
  --border: rgba(0, 0, 0, 0.05);
  --radius: 16px;
  --radius-lg: 24px;
  --radius-sm: 12px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 12px 48px rgba(0, 0, 0, 0.15);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans SC", sans-serif;
  --font-serif: "Noto Serif SC", Georgia, serif;
}

/* Dark Theme */
[data-theme="dark"] {
  --primary: #ff8fab;
  --primary-light: #ffb8c9;
  --primary-dark: #e85d82;
  --bg: #0f1419;
  --surface: rgba(30, 35, 45, 0.85);
  --surface-solid: #1e232d;
  --text: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 12px 48px rgba(0, 0, 0, 0.5);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
  overflow-x: hidden;
}

/* ========================================
   Loading Animation
   ======================================== */
.page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 99999;
  transition: opacity 0.5s, visibility 0.5s;
}

.page-loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ========================================
   Reading Progress Bar
   ======================================== */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
  z-index: 10001;
  width: 0%;
  transition: width 0.1s;
}

/* ========================================
   Navigation
   ======================================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 70px;
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  transform: translateY(-100%);
  opacity: 0;
  transition: transform 0.4s, opacity 0.4s;
}

.navbar.visible {
  transform: translateY(0);
  opacity: 1;
}

.navbar-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 40px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 1px;
}

.navbar-brand span {
  color: var(--primary);
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

.nav-btn:hover {
  background: var(--surface-solid);
  color: var(--primary);
  transform: translateY(-2px);
}

/* Theme Toggle */
.theme-toggle {
  position: relative;
  overflow: hidden;
}

.theme-toggle .light-icon,
.theme-toggle .dark-icon {
  position: absolute;
  transition: transform 0.3s;
}

[data-theme="dark"] .theme-toggle .light-icon {
  transform: translateY(-30px);
}

[data-theme="dark"] .theme-toggle .dark-icon {
  transform: translateY(0);
}

.theme-toggle .dark-icon {
  transform: translateY(30px);
}

/* Mobile Menu Button */
.menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 5px;
}

.menu-btn span {
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: var(--transition);
}

/* ========================================
   Hero Section (Cover)
   ======================================== */
.hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Hero background placeholder while image loads */
.hero {
  background: linear-gradient(135deg, #2d1b69 0%, #1a1a3e 30%, #0f0f23 100%);
}

.hero-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  object-fit: cover;
  z-index: -2;
  transform: scale(1.05);
  will-change: filter;
  transition: filter 0.1s ease-out;
}

.hero-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: linear-gradient(
    180deg,
    rgba(0,0,0,0.2) 0%,
    rgba(0,0,0,0.1) 50%,
    var(--bg) 100%
  );
  z-index: -1;
}

.hero-content {
  text-align: center;
  color: white;
  z-index: 1;
  padding: 20px;
  transition: opacity 0.3s ease-out, transform 0.3s ease-out;
  will-change: opacity, transform;
}

.hero-title {
  font-family: 'Dancing Script', cursive;
  font-size: clamp(5rem, 20vw, 14rem);
  font-weight: 700;
  letter-spacing: 8px;
  margin-bottom: 24px;
  opacity: 0;
  animation: fadeInUp 1s ease-out 0.3s forwards, heroBreathe 8s ease-in-out 2s infinite;
  color: #ffffff;
  text-shadow: 
    0 2px 10px rgba(0,0,0,0.1),
    0 4px 20px rgba(0,0,0,0.2),
    0 8px 40px rgba(250,114,152,0.2);
  line-height: 1;
}

@keyframes heroBreathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

.hero-subtitle {
  font-size: 1rem;
  color: rgba(255,255,255,0.85);
  letter-spacing: 6px;
  text-transform: uppercase;
  opacity: 0;
  animation: fadeInUp 1s ease-out 0.5s forwards;
  font-weight: 300;
}

.scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  font-size: 2rem;
  animation: bounce 2s infinite;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.3s;
}

.scroll-indicator:hover {
  opacity: 1;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
  40% { transform: translateX(-50%) translateY(-10px); }
  60% { transform: translateX(-50%) translateY(-5px); }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========================================
   Main Layout
   ======================================== */
.main-container {
  position: relative;
  z-index: 5;
  background: var(--bg);
  min-height: 100vh;
}

.content-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  padding: 60px 40px;
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 60px;
}

/* ========================================
   Cards - Glassmorphism Style
   ======================================== */
.card {
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
              box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.3s ease,
              background 0.3s ease;
  opacity: 0;
  transform: translateY(20px);
}

.card.visible {
  opacity: 1;
  transform: translateY(0);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary-light);
}

.message-card {
  position: relative;
}

.message-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.message-time {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.message-content {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 16px;
  font-size: 0.95rem;
}

.message-actions {
  display: flex;
  gap: 16px;
  align-items: center;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 20px;
  transition: var(--transition);
}

.action-btn:hover {
  background: rgba(250,114,152,0.1);
  color: var(--primary);
}

.action-btn.liked {
  color: var(--primary);
  background: rgba(250,114,152,0.15);
}

@keyframes likeBounce {
  0% { transform: scale(1); }
  30% { transform: scale(1.3); }
  50% { transform: scale(0.9); }
  70% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.like-btn.just-liked {
  animation: likeBounce 0.4s ease-out;
}

/* Message card slide-in */
.message-card {
  animation: cardSlideIn 0.5s ease-out backwards;
}

.message-card:nth-child(1) { animation-delay: 0.05s; }
.message-card:nth-child(2) { animation-delay: 0.1s; }
.message-card:nth-child(3) { animation-delay: 0.15s; }
.message-card:nth-child(4) { animation-delay: 0.2s; }
.message-card:nth-child(5) { animation-delay: 0.25s; }
.message-card:nth-child(6) { animation-delay: 0.3s; }
.message-card:nth-child(7) { animation-delay: 0.35s; }
.message-card:nth-child(8) { animation-delay: 0.4s; }

@keyframes cardSlideIn {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
  animation: emptyFadeIn 0.8s ease-out;
}

@keyframes emptyFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 20px;
  opacity: 0.5;
}

.empty-state-text {
  font-size: 1.1rem;
}

/* ========================================
   Sidebar
   ======================================== */
.sidebar {
  position: sticky;
  top: 100px;
  height: fit-content;
}

.profile-card {
  text-align: center;
  padding: 40px 30px;
  margin-bottom: 24px;
}

.profile-avatar-lg {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 4px solid white;
  box-shadow: 0 4px 20px rgba(250,114,152,0.3);
  margin: 0 auto 20px;
  display: block;
}

.profile-name {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  margin-bottom: 8px;
  color: var(--text);
}

.profile-bio {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 24px;
}

.profile-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  display: block;
}

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

/* Announcement Card */
.announcement-card {
  padding: 28px;
}

.announcement-title {
  font-size: 1.1rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.announcement-content {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.8;
  white-space: pre-line;
}

/* ========================================
   Footer
   ======================================== */
.site-footer {
  position: relative;
  z-index: 5;
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  padding: 32px 0;
  margin-top: 60px;
}

.footer-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 40px;
  text-align: center;
}

.footer-container p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.8;
}

.footer-brand {
  color: var(--primary);
  font-weight: 600;
}

.footer-tagline {
  font-size: 0.85rem !important;
}

/* ========================================
   Floating Action Button
   ======================================== */
.fab {
  position: fixed;
  bottom: 40px;
  right: 40px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(250,114,152,0.4);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.8) translateY(20px);
}

.fab.visible {
  opacity: 1;
  visibility: visible;
  transform: scale(1) translateY(0);
}

.fab:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 30px rgba(250,114,152,0.5);
}

/* ========================================
   Modal
   ======================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s;
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-card {
  background: var(--surface-solid);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s;
  border: 1px solid var(--border);
}

.modal-overlay.active .modal-card {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

.modal-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--text);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--surface);
  color: var(--text);
}

/* Form Elements */
.form-group {
  margin-bottom: 24px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text);
  font-size: 0.95rem;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  transition: var(--transition);
  font-family: inherit;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(250,114,152,0.1);
}

.form-textarea {
  min-height: 150px;
  resize: vertical;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.btn {
  padding: 12px 28px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(250,114,152,0.4);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text-secondary);
}

.btn-secondary:hover {
  background: var(--border);
  color: var(--text);
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 1024px) {
  .content-wrapper {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 40px 20px;
  }
  
  .sidebar {
    position: static;
    order: -1;
  }
  
  .profile-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 24px;
    text-align: left;
  }
  
  .profile-avatar-lg {
    margin-bottom: 0;
  }
  
  .profile-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  
  .profile-stats {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .hero {
    height: 80vh;
    min-height: 400px;
  }
  
  .hero-title {
    font-size: 3.5rem;
    letter-spacing: 4px;
  }
  
  .navbar-container {
    padding: 0 20px;
  }
  
  .menu-btn {
    display: flex;
  }
  
  .card {
    padding: 20px;
  }
  
  .delete-btn {
    opacity: 1;
  }
  
  .fab {
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
  }
  
  .modal-card {
    padding: 24px;
  }
  
  .footer-container {
    padding: 0 20px;
  }
}

/* ========================================
   Animations
   ======================================== */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Stagger animation for cards */
.card:nth-child(1) { transition-delay: 0.05s; }
.card:nth-child(2) { transition-delay: 0.1s; }
.card:nth-child(3) { transition-delay: 0.15s; }
.card:nth-child(4) { transition-delay: 0.2s; }
.card:nth-child(5) { transition-delay: 0.25s; }
