/* ============================================
   AviaSpot - Aviation Photography Community
   Design System & Styles
   ============================================ */

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

:root {
  /* Colors - Dark Aviation Theme */
  --bg-base: #0a0e17;
  --bg-surface: #121826;
  --bg-elevated: #1a2332;
  --bg-hover: #243044;
  --border: #2a3441;
  --border-light: #364152;

  --primary: #2196f3;
  --primary-hover: #1976d2;
  --primary-light: rgba(33, 150, 243, 0.12);
  --accent: #00bcd4;
  --accent-glow: rgba(0, 188, 212, 0.3);

  --text-primary: #e8eaed;
  --text-secondary: #9aa0a6;
  --text-muted: #5f6368;

  --success: #4caf50;
  --danger: #f44336;
  --warning: #ff9800;
  --info: #2196f3;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(33, 150, 243, 0.2);

  --nav-height: 64px;
  --max-width: 1400px;

  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent);
}

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--border-light);
}

/* --- Navbar --- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(10, 14, 23, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  transition: background var(--transition);
}

.nav-container {
  max-width: var(--max-width);
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  flex-shrink: 0;
}

.nav-logo:hover {
  color: var(--text-primary);
}

.logo-icon {
  color: var(--primary);
  filter: drop-shadow(0 0 6px var(--accent-glow));
}

.logo-accent {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 4px;
  flex: 1;
}

.nav-link {
  padding: 8px 16px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  position: relative;
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.nav-link.active {
  color: var(--primary);
  background: var(--primary-light);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--primary);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 1px;
  transition: var(--transition);
}

/* User dropdown */
.user-menu {
  position: relative;
}

.user-avatar-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  transition: all var(--transition);
}

.user-avatar-btn:hover {
  border-color: var(--primary);
  background: var(--bg-hover);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: white;
  flex-shrink: 0;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--transition);
}

.user-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-dropdown-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.user-dropdown-name {
  font-weight: 600;
  font-size: 15px;
}

.user-dropdown-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  color: var(--text-secondary);
  font-size: 14px;
  transition: all var(--transition);
  width: 100%;
  text-align: left;
}

.user-dropdown-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.user-dropdown-item.danger:hover {
  color: var(--danger);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  transition: all var(--transition);
  white-space: nowrap;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.btn-outline {
  background: transparent;
  border-color: var(--border-light);
  color: var(--text-primary);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 12px;
}

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

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: #d32f2f;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* --- Main Content --- */
.main-content {
  flex: 1;
  padding-top: var(--nav-height);
  min-height: calc(100vh - var(--nav-height));
}

.page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 24px;
  animation: fadeIn 0.3s ease;
}

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

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

.page-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: 15px;
  margin-top: 4px;
}

/* --- Hero Section (Home) --- */
.hero {
  position: relative;
  height: 480px;
  margin: -32px -24px 32px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #0a1929 0%, #0d283d 50%, #0a1929 100%);
  z-index: 0;
}

.hero-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    radial-gradient(circle at 20% 50%, rgba(33, 150, 243, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 50%, rgba(0, 188, 212, 0.1) 0%, transparent 50%);
}

.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='0.03' stroke-width='1'%3E%3Cpath d='M0 40h80M40 0v80'/%3E%3C/g%3E%3C/svg%3E");
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 0 24px;
  max-width: 800px;
}

.hero-title {
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #ffffff 0%, #82b1ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 32px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Plane SVG animation in hero */
.hero-plane {
  position: absolute;
  top: 20%;
  left: -100px;
  z-index: 1;
  opacity: 0.15;
  animation: fly 20s linear infinite;
}

@keyframes fly {
  from { transform: translateX(0) translateY(0); }
  50% { transform: translateX(60vw) translateY(30px); }
  to { transform: translateX(120vw) translateY(0); }
}

/* --- Quick Action Cards --- */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.quick-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.quick-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}

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

.quick-card:hover::before {
  transform: scaleX(1);
}

.quick-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: var(--primary);
}

.quick-card-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 6px;
}

.quick-card-desc {
  font-size: 14px;
  color: var(--text-secondary);
}

/* --- Photo Gallery --- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.photo-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
  cursor: pointer;
}

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

.photo-card-img {
  width: 100%;
  aspect-ratio: 3/2;
  object-fit: cover;
  background: var(--bg-elevated);
}

.photo-card-body {
  padding: 14px 16px;
}

.photo-card-aircraft {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.photo-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

.photo-card-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.photo-card-author {
  font-size: 12px;
  color: var(--primary);
  margin-top: 6px;
  font-weight: 500;
}

/* --- Forms --- */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-label .required {
  color: var(--danger);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  transition: all var(--transition);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
  font-family: inherit;
}

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

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

/* --- Upload Zone --- */
.upload-zone {
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-lg);
  padding: 48px;
  text-align: center;
  transition: all var(--transition);
  cursor: pointer;
  background: var(--bg-surface);
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.upload-zone-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.upload-zone-text {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.upload-zone-hint {
  font-size: 13px;
  color: var(--text-muted);
}

.upload-preview {
  margin-top: 20px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  position: relative;
}

.upload-preview img {
  width: 100%;
  max-height: 400px;
  object-fit: contain;
  background: var(--bg-base);
}

/* --- Cards / Panels --- */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.card-elevated {
  background: var(--bg-elevated);
  box-shadow: var(--shadow-sm);
}

/* --- Auth Pages --- */
.auth-container {
  max-width: 420px;
  margin: 60px auto;
}

.auth-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-lg);
}

.auth-title {
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
}

.auth-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 32px;
}

.auth-switch {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--text-secondary);
}

/* --- Forum --- */
.forum-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
}

.forum-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.forum-item {
  display: flex;
  gap: 16px;
  padding: 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all var(--transition);
  cursor: pointer;
}

.forum-item:hover {
  border-color: var(--border-light);
  background: var(--bg-elevated);
}

.forum-item-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.forum-item-content {
  flex: 1;
  min-width: 0;
}

.forum-item-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.forum-item-preview {
  font-size: 13px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 8px;
}

.forum-item-meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-muted);
}

.forum-item-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.forum-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.forum-category {
  padding: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.forum-category-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.forum-category-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color var(--transition);
}

.forum-category-item:hover {
  color: var(--primary);
}

.forum-category-item .count {
  font-size: 12px;
  background: var(--bg-elevated);
  padding: 2px 8px;
  border-radius: 10px;
  color: var(--text-muted);
}

/* Forum thread view */
.thread-view {
  max-width: 900px;
  margin: 0 auto;
}

.thread-header {
  margin-bottom: 24px;
}

.thread-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.thread-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.post {
  display: flex;
  gap: 16px;
  padding: 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.post-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.post-content {
  flex: 1;
}

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

.post-author {
  font-weight: 600;
  font-size: 14px;
}

.post-date {
  font-size: 12px;
  color: var(--text-muted);
}

.post-body {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-primary);
  white-space: pre-wrap;
}

.post-actions {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

.post-action {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: color var(--transition);
}

.post-action:hover {
  color: var(--primary);
}

.reply-box {
  margin-top: 24px;
}

/* --- Flight Log --- */
.flightlog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.flightlog-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
  cursor: pointer;
}

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

.flightlog-card-cover {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: var(--bg-elevated);
}

.flightlog-card-body {
  padding: 16px;
}

.flightlog-card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
}

.flightlog-card-excerpt {
  font-size: 13px;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
}

.flightlog-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

/* Flight log detail */
.flightlog-detail {
  max-width: 800px;
  margin: 0 auto;
}

.flightlog-detail-header {
  margin-bottom: 24px;
}

.flightlog-detail-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.flightlog-detail-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--text-muted);
}

.flightlog-detail-content {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-primary);
  white-space: pre-wrap;
  margin-bottom: 24px;
}

.flightlog-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.flightlog-photo {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform var(--transition);
}

.flightlog-photo:hover {
  transform: scale(1.03);
}

/* Photo multi-upload */
.photo-upload-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.photo-upload-slot {
  aspect-ratio: 1;
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.photo-upload-slot:hover {
  border-color: var(--primary);
}

.photo-upload-slot.filled {
  border-style: solid;
  border-color: var(--border);
}

.photo-upload-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-upload-slot .remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  opacity: 0;
  transition: opacity var(--transition);
}

.photo-upload-slot.filled:hover .remove-btn {
  opacity: 1;
}

.photo-count {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* --- Messages --- */
.messages-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 0;
  height: calc(100vh - var(--nav-height) - 64px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.conversation-list {
  border-right: 1px solid var(--border);
  overflow-y: auto;
}

.conversation-list-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

.conversation-item {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: background var(--transition);
  border-bottom: 1px solid var(--border);
}

.conversation-item:hover {
  background: var(--bg-hover);
}

.conversation-item.active {
  background: var(--primary-light);
}

.conversation-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.conversation-info {
  flex: 1;
  min-width: 0;
}

.conversation-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.conversation-preview {
  font-size: 12px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-panel {
  display: flex;
  flex-direction: column;
}

.chat-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-message {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 14px;
  line-height: 1.5;
}

.chat-message.sent {
  align-self: flex-end;
  background: var(--primary);
  color: white;
}

.chat-message.received {
  align-self: flex-start;
  background: var(--bg-elevated);
}

.chat-message-time {
  font-size: 10px;
  opacity: 0.6;
  margin-top: 4px;
}

.chat-input-area {
  padding: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 12px;
}

.chat-input {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
}

.chat-input:focus {
  outline: none;
  border-color: var(--primary);
}

.chat-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  gap: 12px;
}

/* --- Lightbox --- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.lightbox.show {
  display: flex;
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 32px;
  color: white;
  cursor: pointer;
  z-index: 10;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-img {
  max-width: 90%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius-md);
}

.lightbox-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  color: white;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

.lightbox-info-item {
  font-size: 14px;
}

.lightbox-info-item strong {
  color: var(--accent);
  margin-right: 6px;
}

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.show {
  display: flex;
}

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.25s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 20px;
}

.modal-close {
  float: right;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
}

/* --- Toast --- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: white;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.25s ease;
  max-width: 350px;
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.info { background: var(--info); }
.toast.warning { background: var(--warning); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 56px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.empty-state-title {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state-desc {
  font-size: 14px;
}

/* --- Stats bar --- */
.stats-bar {
  display: flex;
  gap: 32px;
  padding: 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 32px;
}

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

.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
}

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

/* --- Filter bar --- */
.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.filter-input {
  flex: 1;
  min-width: 200px;
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
}

.filter-input:focus {
  outline: none;
  border-color: var(--primary);
}

.filter-select {
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
}

/* --- Loading --- */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
}

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

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

/* --- Footer --- */
.footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 40px 24px 24px;
  margin-top: 64px;
}

.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 2fr;
  gap: 32px;
}

.footer-section h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.footer-section p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

.footer-section a {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  transition: color var(--transition);
}

.footer-section a:hover {
  color: var(--primary);
}

/* --- Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

.badge-primary {
  background: var(--primary-light);
  color: var(--primary);
}

.badge-accent {
  background: rgba(0, 188, 212, 0.15);
  color: var(--accent);
}

.badge-unread {
  background: var(--danger);
  color: white;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  justify-content: center;
  font-size: 10px;
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .forum-layout {
    grid-template-columns: 1fr;
  }
  
  .messages-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  
  .conversation-list {
    max-height: 300px;
  }
  
  .footer-container {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    padding: 16px;
    gap: 4px;
  }

  .nav-links.show {
    display: flex;
  }

  .nav-toggle {
    display: flex;
  }

  .hero-title {
    font-size: 32px;
  }

  .hero-subtitle {
    font-size: 15px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  #uploadLayout {
    grid-template-columns: 1fr !important;
  }

  .photo-upload-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .flightlog-grid {
    grid-template-columns: 1fr;
  }

  .stats-bar {
    flex-wrap: wrap;
    gap: 16px;
  }

  .page {
    padding: 20px 16px;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 26px;
  }

  .photo-upload-grid {
    grid-template-columns: 1fr 1fr;
  }

  .auth-card {
    padding: 24px;
  }
}
