/* Design System */
:root {
  --color-bg: #fafaf9;
  --color-surface: #ffffff;
  --color-elevated: #f5f5f4;
  --color-text: #1c1917;
  --color-text-secondary: #57534e;
  --color-text-muted: #a8a29e;
  --color-border: #e7e5e4;
  --color-accent: #0c4a6e;
  --color-accent-light: #0284c7;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;
  --max-width: 1200px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Navigation */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 250, 249, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.25rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.msg-expired {
    opacity: 0.3;
    filter: grayscale(100%);
}

.msg-vanishing {
    animation: fadeOut 0.5s ease forwards;
}

/* Default/Desktop styles (your existing CSS) */
.container {
    width: 1200px;
    /* your current styles */
}

/* Mobile-First Responsive Design */
.mobile-menu-btn {
    display: none;  /* hidden on desktop */
}
@media (max-width: 768px) {

    .mobile-menu-btn {
        display: flex;   /* show on mobile only */
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        background: rgba(26, 26, 34, 0.8);
        border: 1.5px solid rgba(124, 107, 255, 0.3);
        border-radius: 12px;
        margin-right: 12px;
        color: var(--text2);
        font-size: 18px;
        font-weight: 600;
        cursor: pointer;
        position: relative;
        overflow: hidden;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        backdrop-filter: blur(12px);
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    }

    .navbar {
        height: 56px;
        padding: 0 12px;
    }

    .nav-container {
        padding: 0;
    }

    .logo {
        font-size: 1rem;
    }

    .nav-links {
        gap: 15px;
    }

    .nav-links a {
        font-size: 0.8rem;
    }
}
    
    /* Overlay when sidebar is open */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 56px;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.6);
        z-index: 999;
        backdrop-filter: blur(4px);
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    /* Chat Main - Full width */
    @media (max-width: 768px) {

        .chat-app {
            position: relative;
        }

        .sidebar {
            position: fixed;
            top: 50px; /* below navbar */
            left: 0;
            width: 85%;
            max-width: 320px;
            height: calc(100vh - 50px);
            background: var(--surface);
            z-index: 2000;

            transform: translateX(-100%);
            transition: transform 0.3s ease;
        }

        .sidebar.active {
            transform: translateX(0);
        }

        .chat-main {
            width: 100%;
            flex: 1;
        }
    }

    
    .chat-main {
        width: 100%;
    }
    
    /* Chat Header */
    .chat-header {
        height: 56px;
        padding: 0 12px;
    }
    
    .header-avatar {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .header-name {
        font-size: 13px;
    }
    
    .header-status {
        font-size: 10px;
    }
    
    /* Messages Area */
    .messages-area {
        padding: 12px;
        gap: 8px;
    }
    
    .msg-bubble {
        max-width: 85%;
        padding: 10px 14px;
        font-size: 14px;
        border-radius: 16px;
    }
    
    .msg-sender-label {
        font-size: 10px;
    }
    
    .msg-meta {
        font-size: 9px;
    }
    
    /* Input Area - Fixed at bottom */
    .input-area {
        padding: 10px 12px;
        padding-bottom: max(10px, env(safe-area-inset-bottom));
        gap: 8px;
    }
    
    .input-field {
        padding: 12px 16px;
        font-size: 16px; /* Prevents iOS zoom on focus */
        border-radius: 20px;
    }
    
    .btn-send {
        width: 48px;
        height: 48px;
        border-radius: 50%;
    }
    
    /* Contact items - Larger touch targets */
    .contact-item {
        padding: 14px 12px;
        margin-bottom: 6px;
    }
    
    .c-avatar {
        width: 44px;
        height: 44px;
    }
    
    .c-name {
        font-size: 14px;
    }
    
    .c-preview {
        font-size: 12px;
    }
    
    .btn-mini {
        padding: 8px 14px;
        font-size: 11px;
    }
    
    /* Empty state */
    .empty-icon {
        font-size: 48px;
    }
    
    .empty-text {
        font-size: 13px;
        padding: 0 20px;
        text-align: center;
    }
}

/* Small phones */
@media (max-width: 380px) {
    .msg-bubble {
        max-width: 90%;
        font-size: 13px;
    }
    
    .c-info {
        max-width: 120px;
    }
}

/* Landscape mode fixes */
@media (max-height: 500px) and (orientation: landscape) {
    .navbar {
        height: 48px;
    }
    
    .sidebar {
        top: 48px;
        height: calc(100vh - 48px);
    }
    
    .input-area {
        padding: 8px 12px;
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: scale(0.9);
        max-height: 0;
        margin: 0;
        padding: 0;
    }
}
.logo {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: -0.02em;
}

.logo-icon {
  color: var(--color-accent);
  font-size: 1.25rem;
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  align-items: center;
}

.nav-links a {
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
  padding: 0.5rem 0;
}

.nav-links a:hover {
  color: var(--color-text);
}

.nav-links a.active {
  color: var(--color-text);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-accent);
  border-radius: 2px;
}

/* Hero Section */
.hero {
  padding: 6rem 2rem 5rem;
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
}

.tagline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent);
  margin-bottom: 1.5rem;
}

.tagline::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--color-accent);
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 600;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--color-text-secondary);
  max-width: 600px;
  margin: 0 auto;
  font-weight: 400;
  line-height: 1.6;
}

/* Container */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem 6rem;
}

/* Posts Header */
.posts-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.posts-header h2 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text);
}

.filter-tabs {
  display: flex;
  gap: 0.25rem;
  background: var(--color-elevated);
  padding: 0.25rem;
  border-radius: var(--radius-md);
}

.tab {
  padding: 0.5rem 1rem;
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.tab:hover {
  color: var(--color-text);
}

.tab.active {
  color: var(--color-text);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

/* Posts Grid */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 2rem;
}

.post-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 2rem;
  border: 1px solid var(--color-border);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.post-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-accent-light), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.post-card:hover::before {
  opacity: 0.5;
}

.post-meta-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.category {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent);
  background: rgba(12, 74, 110, 0.08);
  padding: 0.375rem 0.875rem;
  border-radius: 100px;
}

.read-time {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

/* Post Content */
.post-card h2 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 1rem;
  color: var(--color-text);
  letter-spacing: -0.01em;
}

.post-card h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 1.5rem 0 0.75rem;
  color: var(--color-text);
}

.post-card h4 {
  font-size: 1rem;
  font-weight: 600;
  margin: 1.25rem 0 0.5rem;
  color: var(--color-text-secondary);
}

.post-card p {
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
  line-height: 1.7;
  margin-bottom: 1rem;
}

.post-card strong {
  color: var(--color-text);
  font-weight: 600;
}

.post-card ul {
  margin: 1rem 0;
  padding-left: 1.25rem;
  color: var(--color-text-secondary);
}

.post-card li {
  margin-bottom: 0.5rem;
  font-size: 0.9375rem;
  position: relative;
}

.post-card li::marker {
  color: var(--color-accent-light);
}

.post-footer {
  margin-top: auto;
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--color-border);
}

.date {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

.read-link {
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  transition: var(--transition);
}

.read-link:hover {
  color: var(--color-accent-light);
  gap: 0.625rem;
}

.arrow {
  transition: transform 0.2s ease;
}

.read-link:hover .arrow {
  transform: translateX(4px);
}

/* Load More */
.load-more {
  text-align: center;
  margin-top: 4rem;
}

.btn-secondary {
  padding: 0.875rem 2rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-sans);
}

.btn-secondary:hover {
  background: var(--color-bg);
  border-color: var(--color-text-muted);
  transform: translateY(-1px);
}

/* Footer */
.footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 4rem 2rem 2rem;
}

.footer-content {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 3rem;
}

.footer-brand h3 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.footer-brand p {
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
  max-width: 300px;
  line-height: 1.6;
}

.footer-links {
  display: flex;
  gap: 2rem;
}

.footer-links a {
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--color-text);
}

.footer-bottom {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
  text-align: center;
}

.footer-bottom p {
  color: var(--color-text-muted);
  font-size: 0.875rem;
}
/* chat page*/

.vanishing {
  opacity: 0;
  transition: opacity 0.8s ease;
}

.chat-icon {
    font-size: 22px;
    text-decoration: none;
    margin-left: 15px;
}

.chat-icon:hover {
    opacity: 0.7;
}

/* Write Page */
.write-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.write-header {
  margin-bottom: 3rem;
  text-align: center;
}

.write-header h1 {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.write-form {
  background: var(--color-surface);
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.form-group {
  margin-bottom: 2rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.625rem;
  letter-spacing: -0.01em;
}

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

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-accent-light);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.1);
  background: var(--color-surface);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--color-text-muted);
}

.form-group textarea {
  min-height: 400px;
  resize: vertical;
  font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
  font-size: 0.9375rem;
  line-height: 1.7;
}

.form-hint {
  display: block;
  margin-top: 0.75rem;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  font-weight: 500;
}

.form-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.btn-primary {
  padding: 1rem 2rem;
  background: var(--color-accent);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-sans);
}

.btn-primary:hover {
  background: var(--color-accent-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-ghost {
  padding: 1rem 1.5rem;
  background: transparent;
  color: var(--color-text-secondary);
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  font-family: var(--font-sans);
}

.btn-ghost:hover {
  color: var(--color-text);
  background: var(--color-elevated);
}

/* Responsive Design */
@media (max-width: 768px) {
  .nav-container {
    padding: 1rem;
  }
  
  .nav-links {
    gap: 1.5rem;
  }
  
  .hero {
    padding: 4rem 1rem 3rem;
  }
  
  .hero h1 {
    font-size: 2.25rem;
  }
  
  .container {
    padding: 0 1rem 4rem;
  }
  
  .posts-header {
    flex-direction: column;
    gap: 1.25rem;
    align-items: flex-start;
  }
  
  .posts-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .post-card {
    padding: 1.5rem;
  }
  
  .footer-content {
    flex-direction: column;
    gap: 2rem;
  }
  
  .write-container {
    padding: 2rem 1rem;
  }
  
  .write-form {
    padding: 1.5rem;
  }
  
  .form-actions {
    flex-direction: column;
    width: 100%;
  }
  
  .btn-primary,
  .btn-ghost {
    width: 100%;
    text-align: center;
  }
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 6rem 2rem;
  color: var(--color-text-secondary);
}

.empty-state h3 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--color-text);
}

.empty-state p {
  margin-bottom: 1.5rem;
}

/* Delete Post Button - subtle warning */
.btn-delete {
  background-color: var(--color-elevated); /* matches surface tone */
  color: #b91c1c; /* soft red text */
  border: 1px solid #fca5a5; /* light red border */
  padding: 0.5rem 1rem;
  cursor: pointer;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.875rem;
  transition: var(--transition);
  font-family: var(--font-sans);
}

.btn-delete:hover {
  background-color: #fee2e2; /* very light red */
  border-color: #f87171; /* slightly darker border */
  color: #991b1b; /* darker red on hover */
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}



