/* Base Structure */
.hidden {
  display: none !important;
}

.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header styling */
.main-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  min-height: 64px;
  height: auto;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px 16px;
}

.header-content {
  width: 100%;
  max-width: 800px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.logo-link {
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -1px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-accent {
  color: var(--color-accent);
  text-shadow: 0 0 10px var(--color-accent-glow);
}

/* Search bar resembling Twitter style */
.search-container {
  flex: 1;
  max-width: 380px;
  position: relative;
}

.search-input {
  width: 100%;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-full);
  padding: 10px 16px 10px 42px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition-fast);
}

.search-input:focus {
  border-color: var(--color-accent);
  background: var(--bg-surface);
  box-shadow: var(--glow-shadow);
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: 0.9rem;
}

/* Header buttons */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-map {
  background: linear-gradient(135deg, var(--bg-surface-elevated), var(--bg-surface-highlight));
  border: 1px solid var(--color-accent);
  color: var(--color-accent);
  padding: 8px 16px;
  border-radius: var(--border-radius-full);
  font-weight: 700;
  text-decoration: none;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition-fast);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-map:hover {
  background: var(--color-accent);
  color: var(--bg-deep);
  box-shadow: var(--glow-shadow);
  transform: translateY(-1px);
}

/* Main Layout Grid */
.layout-main {
  flex: 1;
  width: 100%;
  max-width: 800px;
  margin: 64px auto 72px auto; /* 64px top header, 72px bottom bar */
  padding: 16px;
}

.layout-main.standalone {
  max-width: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

/* Base Cards */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--card-shadow);
  transition: var(--transition-medium);
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

/* Bottom Tab Navigation Bar for Mobile */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--glass-border);
  z-index: 100;
  display: flex;
  justify-content: center;
}

.nav-links {
  width: 100%;
  max-width: 800px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0 8px;
}

.nav-item {
  text-decoration: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.7rem;
  gap: 4px;
  transition: var(--transition-fast);
  font-weight: 500;
  padding: 6px 12px;
}

.nav-item svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
  transition: var(--transition-fast);
}

.nav-item:hover, .nav-item.active {
  color: var(--color-accent);
}

.nav-item:hover svg, .nav-item.active svg {
  filter: drop-shadow(0 0 4px var(--color-accent-glow));
}

/* Buttons */
.btn-primary {
  background: var(--color-accent);
  color: var(--bg-deep);
  border: none;
  padding: 10px 20px;
  border-radius: var(--border-radius-full);
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

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

.btn-secondary {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
  padding: 10px 20px;
  border-radius: var(--border-radius-full);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition-fast);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-secondary:hover {
  background: var(--bg-surface-highlight);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-deep);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-surface-highlight);
  border-radius: var(--border-radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}

/* Twitter style forms / textareas */
textarea.input-compose {
  width: 100%;
  background: transparent;
  border: none;
  resize: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1.1rem;
  outline: none;
  min-height: 120px;
}

.input-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.input-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-field {
  width: 100%;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-sm);
  padding: 12px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition-fast);
}

.input-field:focus {
  border-color: var(--color-accent);
  box-shadow: var(--glow-shadow);
}

body.full-map-layout-active .main-header {
  display: none !important;
}

body.full-map-layout-active .layout-main {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  margin: 0 !important;
  padding: 0 !important;
  z-index: 5 !important;
  overflow: hidden !important;
}

body.full-map-layout-active .bottom-nav {
  z-index: 1001 !important;
  background: rgba(18, 20, 26, 0.95) !important;
}

/* Global Feed Cards */
.feed-card { animation: cardFadeIn 0.3s ease-out; }
@keyframes cardFadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.author-info { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.author-avatar-placeholder { width: 40px; height: 40px; border-radius: var(--border-radius-full); background: linear-gradient(135deg, var(--color-accent-hover), var(--bg-surface-highlight)); color: var(--bg-deep); display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 1.1rem; }
.author-names { display: flex; flex-direction: column; }
.author-display { font-weight: 700; font-size: 0.95rem; line-height: 1.2; }
.author-username { color: var(--text-muted); font-size: 0.8rem; }
.card-meta { display: flex; align-items: center; gap: 8px; }
.card-time { font-size: 0.75rem; color: var(--text-muted); }
.card-body { font-size: 1rem; line-height: 1.5; color: var(--text-primary); margin-bottom: 14px; white-space: pre-wrap; word-break: break-word; }
.card-title { font-size: 1.1rem; font-weight: 900; margin-bottom: 8px; color: var(--text-primary); }
.post-media-img { width: 100%; max-height: 400px; object-fit: cover; border-radius: var(--border-radius-md); margin-top: 10px; border: 1px solid var(--glass-border); }
.video-wrapper { position: relative; width: 100%; border-radius: var(--border-radius-md); overflow: hidden; border: 1px solid var(--glass-border); margin-top: 10px; display: flex; justify-content: center; align-items: center; max-height: 70vh; background: transparent; }
.video-player { width: 100%; height: auto; max-height: 70vh; object-fit: contain; display: block; border-radius: var(--border-radius-md); }
.card-actions { display: flex; align-items: center; gap: 24px; border-top: 1px solid var(--glass-border); padding-top: 12px; color: var(--text-secondary); }
.action-btn { background: transparent; border: none; color: var(--text-muted); font-family: inherit; font-size: 0.85rem; font-weight: 700; cursor: pointer; display: flex; align-items: center; gap: 6px; transition: var(--transition-fast); padding: 4px 8px; border-radius: var(--border-radius-sm); }
.action-btn svg { width: 18px; height: 18px; fill: currentColor; transition: var(--transition-fast); }
.action-btn:hover { color: var(--text-primary); background: var(--bg-surface-elevated); }
.action-btn.btn-like:hover { color: var(--color-pink); }
.action-btn.liked { color: var(--color-pink); }
.action-btn.liked svg { filter: drop-shadow(0 0 4px rgba(255, 100, 150, 0.4)); }
.views-count { font-size: 0.8rem; color: var(--text-muted); margin-left: auto; }

/* Mobile Navigation Adjustments */
.mobile-search-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 8px;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius-full);
  transition: var(--transition-fast);
}

.mobile-search-toggle:hover {
  background: var(--bg-surface-elevated);
}

@media (max-width: 768px) {
  .header-content {
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .search-container {
    display: none;
    width: 100%;
    max-width: 100%;
    flex-basis: 100%;
    order: 3; /* Move to bottom row */
  }

  .search-container.mobile-active {
    display: block;
    animation: slideDown 0.2s ease-out;
  }

  .mobile-search-toggle {
    display: flex !important;
  }
}

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