/* ============================================
   VOYAGE — Community Page Styles
   ============================================ */

/* ===== Community Hero ===== */
.community-hero {
  padding: calc(var(--nav-height) + var(--xxxl)) 0 var(--xxxl);
  background: linear-gradient(135deg, #1A1A2E 0%, #252542 50%, #0F0F1E 100%);
  color: white;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.community-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(79, 195, 247, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 30%, rgba(38, 166, 154, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(255, 112, 67, 0.08) 0%, transparent 50%);
}

.community-hero .container {
  position: relative;
  z-index: 1;
}

.community-hero h1 {
  color: white;
  margin-bottom: var(--md);
}

.community-hero p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.125rem;
  max-width: 600px;
  margin: 0 auto var(--xxl);
}

/* ===== Search Bar ===== */
.community-search {
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  gap: var(--sm);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
  padding: var(--sm);
}

.community-search input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: white;
  font-size: 1rem;
  padding: var(--sm) var(--md);
}

.community-search input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.community-search button {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border-radius: var(--radius-full);
  padding: var(--sm) var(--lg);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--sm);
}

/* ===== Global Stats ===== */
.global-stats {
  padding: var(--xxl) 0;
  background: var(--bg-elevated);
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

[data-theme="dark"] .global-stats {
  border-color: rgba(255,255,255,0.06);
}

.global-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--xl);
  text-align: center;
}

@media (max-width: 768px) {
  .global-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

.global-stat-item .stat-counter {
  display: block;
}

.global-stat-item .stat-label {
  margin-top: var(--sm);
}

/* ===== Community Layout ===== */
.community-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--xxl);
  padding: var(--xxl) 0;
}

@media (max-width: 968px) {
  .community-layout { grid-template-columns: 1fr; }
}

/* ===== Sidebar Filters ===== */
.filters-sidebar {
  position: sticky;
  top: calc(var(--nav-height) + var(--lg));
  align-self: start;
}

.filter-group {
  margin-bottom: var(--xl);
}

.filter-group h4 {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: var(--md);
  padding-bottom: var(--sm);
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

[data-theme="dark"] .filter-group h4 {
  border-color: rgba(255,255,255,0.06);
}

.filter-option {
  display: flex;
  align-items: center;
  gap: var(--sm);
  padding: var(--sm) 0;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--text);
  transition: color var(--transition-fast);
}

.filter-option:hover {
  color: var(--primary);
}

.filter-option input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

.filter-option .filter-count {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: rgba(0,0,0,0.05);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

[data-theme="dark"] .filter-option .filter-count {
  background: rgba(255,255,255,0.05);
}

.transport-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ===== Members Grid ===== */
.members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--lg);
}

.member-card {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  padding: var(--xl);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.member-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.member-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  opacity: 0.1;
}

.member-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  margin-bottom: var(--md);
  position: relative;
  z-index: 1;
}

.member-card h4 {
  margin-bottom: var(--xs);
}

.member-card .member-username {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: var(--sm);
}

.member-card .member-bio {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: var(--md);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.member-transport-badges {
  display: flex;
  gap: var(--xs);
  flex-wrap: wrap;
  margin-bottom: var(--md);
}

.member-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sm);
  padding-top: var(--md);
  border-top: 1px solid rgba(0,0,0,0.06);
}

[data-theme="dark"] .member-stats {
  border-color: rgba(255,255,255,0.06);
}

.member-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.member-stat-value {
  font-family: var(--font-mono);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.member-stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===== Routes List ===== */
.routes-section {
  margin-top: var(--xxxl);
}

.routes-section h3 {
  margin-bottom: var(--lg);
}

.routes-list {
  display: flex;
  flex-direction: column;
  gap: var(--md);
}

.route-card {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: var(--lg);
  padding: var(--lg);
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
  align-items: center;
}

.route-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateX(4px);
}

@media (max-width: 640px) {
  .route-card { grid-template-columns: 1fr; }
}

.route-map-preview {
  width: 120px;
  height: 80px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #C8E6C9, #E3F2FD);
  position: relative;
  overflow: hidden;
}

.route-map-preview svg {
  width: 100%;
  height: 100%;
}

.route-info h4 {
  margin-bottom: var(--xs);
}

.route-meta {
  display: flex;
  gap: var(--md);
  color: var(--text-secondary);
  font-size: 0.875rem;
  flex-wrap: wrap;
}

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

.route-weather {
  display: flex;
  align-items: center;
  gap: var(--sm);
  text-align: right;
}

.route-weather-temp {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
}

/* ===== Events Feed ===== */
.events-section {
  margin-top: var(--xxxl);
}

.events-feed {
  display: flex;
  flex-direction: column;
  gap: var(--md);
}

.event-card {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: var(--md);
  padding: var(--lg);
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  align-items: center;
  border-left: 4px solid var(--primary);
}

.event-card.event-danger { border-color: var(--route-danger); }
.event-card.event-caution { border-color: var(--route-caution); }
.event-card.event-good { border-color: var(--route-good); }

.event-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: rgba(79, 195, 247, 0.1);
}

.event-info h4 {
  font-size: 1rem;
  margin-bottom: var(--xs);
}

.event-info p {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

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

/* ===== Tabs ===== */
.community-tabs {
  display: flex;
  gap: var(--sm);
  margin-bottom: var(--xl);
  border-bottom: 2px solid rgba(0,0,0,0.06);
}

[data-theme="dark"] .community-tabs {
  border-color: rgba(255,255,255,0.06);
}

.community-tab {
  padding: var(--md) var(--lg);
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.community-tab.active {
  color: var(--primary);
  border-color: var(--primary);
}

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

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ===== Profile Page ===== */
.profile-header {
  padding: calc(var(--nav-height) + var(--xxl)) 0 var(--xxl);
  background: linear-gradient(135deg, #1A1A2E, #252542);
  color: white;
}

.profile-header-content {
  display: grid;
  grid-template-columns: 160px 1fr auto;
  gap: var(--xxl);
  align-items: center;
}

@media (max-width: 768px) {
  .profile-header-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

.profile-avatar {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  font-weight: 800;
  color: white;
  border: 4px solid rgba(255, 255, 255, 0.2);
  box-shadow: var(--shadow-lg);
  margin: 0 auto;
}

.profile-name h1 {
  color: white;
  margin-bottom: var(--xs);
}

.profile-name .profile-username {
  color: rgba(255, 255, 255, 0.6);
  font-size: 1rem;
  margin-bottom: var(--md);
}

.profile-name .profile-bio {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
  max-width: 480px;
}

.profile-meta {
  display: flex;
  gap: var(--lg);
  margin-top: var(--md);
  flex-wrap: wrap;
}

.profile-meta span {
  display: flex;
  align-items: center;
  gap: var(--xs);
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.875rem;
}

.profile-actions {
  display: flex;
  flex-direction: column;
  gap: var(--sm);
}

/* Profile stats grid */
.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--lg);
  margin-bottom: var(--xxl);
}

@media (max-width: 768px) {
  .profile-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

.profile-stat-card {
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  padding: var(--xl) var(--lg);
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.profile-stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.profile-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto var(--md);
}

.profile-stat-value {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary-dark);
}

.profile-stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: var(--xs);
}

/* Activity charts */
.activity-chart {
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  padding: var(--xl);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--lg);
}

.activity-chart h3 {
  margin-bottom: var(--lg);
}

.chart-bars {
  display: flex;
  gap: 4px;
  height: 160px;
  align-items: flex-end;
  padding: var(--md) 0;
}

.chart-bar {
  flex: 1;
  background: linear-gradient(180deg, var(--primary), var(--primary-dark));
  border-radius: 4px 4px 0 0;
  min-height: 8px;
  position: relative;
  transition: all var(--transition-fast);
}

.chart-bar:hover {
  opacity: 0.8;
  transform: scaleY(1.02);
  transform-origin: bottom;
}

.chart-bar-label {
  position: absolute;
  bottom: -24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Transport distribution */
.transport-distribution {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--lg);
}

@media (max-width: 640px) {
  .transport-distribution { grid-template-columns: 1fr; }
}

/* Connected devices */
.device-card {
  display: flex;
  align-items: center;
  gap: var(--md);
  padding: var(--lg);
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--md);
}

.device-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: rgba(79, 195, 247, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.device-info h4 {
  font-size: 1rem;
  margin-bottom: 2px;
}

.device-info p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.device-status {
  margin-left: auto;
}

/* ===== Auth Modal ===== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  padding: var(--xxl);
  max-width: 440px;
  width: 90%;
  box-shadow: var(--shadow-xl);
  transform: scale(0.9);
  transition: transform var(--transition-normal);
}

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

.modal h2 {
  margin-bottom: var(--md);
  text-align: center;
}

.modal p {
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: var(--xl);
}

.modal-tabs {
  display: flex;
  gap: var(--sm);
  margin-bottom: var(--xl);
  border-bottom: 2px solid rgba(0,0,0,0.06);
}

[data-theme="dark"] .modal-tabs {
  border-color: rgba(255,255,255,0.06);
}

.modal-tab {
  flex: 1;
  padding: var(--md);
  text-align: center;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.modal-tab.active {
  color: var(--primary);
  border-color: var(--primary);
}

.form-group {
  margin-bottom: var(--lg);
}

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

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: var(--md) var(--lg);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  transition: all var(--transition-fast);
}

[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select,
[data-theme="dark"] .form-group textarea {
  border-color: rgba(255,255,255,0.1);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 195, 247, 0.15);
}

.form-group select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23757575' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--md);
}

@media (max-width: 480px) {
  .form-row { grid-template-columns: 1fr; }
}

.transport-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: var(--sm);
}

.transport-option {
  display: flex;
  align-items: center;
  gap: var(--sm);
  padding: var(--md);
  border: 2px solid rgba(0,0,0,0.08);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.875rem;
}

[data-theme="dark"] .transport-option {
  border-color: rgba(255,255,255,0.08);
}

.transport-option:hover {
  border-color: var(--primary);
}

.transport-option.selected {
  border-color: var(--primary);
  background: rgba(79, 195, 247, 0.05);
}

.transport-option input {
  accent-color: var(--primary);
}

.modal-close {
  position: absolute;
  top: var(--lg);
  right: var(--lg);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: rgba(0,0,0,0.05);
  color: var(--text);
}

/* ===== Responsive Nav ===== */
@media (max-width: 768px) {
  .navbar-links { display: none; }
  .navbar-actions .btn-ghost { display: none; }
}
