:root {
  --bg-color: #121212;
  --card-bg: #1e1e1e;
  --text-primary: #ffffff;
  --text-secondary: #aaaaaa;
  --accent-color: #d4a373; /* Gold/Bronze tone from Grizzly */
  --accent-hover: #b08d55;
  --message-me: #3a3a3a; /* Dark gray for received messages */
  --message-other: #d4a373; /* Accent color for sent messages */
  --nav-height: 60px;
}

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

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 480px; /* Mobile width simulation for desktop */
  margin: 0 auto;
  width: 100%;
  height: 100vh; /* Full viewport height */
  background-color: var(--bg-color);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden; /* Prevent body scroll */
}

/* Scrollable Content Wrapper */
.content-scrollable {
  flex: 1;
  overflow-y: auto;
  padding-bottom: var(--nav-height);
  width: 100%;
}

/* Header */
header {
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--bg-color);
  z-index: 10;
}

.logo {
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: 2px;
  color: var(--accent-color);
}

/* Navigation */
.bottom-nav {
  height: var(--nav-height);
  background-color: var(--card-bg);
  display: flex;
  justify-content: space-around;
  align-items: center;
  position: absolute;
  bottom: 0;
  width: 100%;
  border-top: 1px solid #333;
}

.nav-item {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 1.5rem;
  padding: 10px;
}

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

/* Forms (Edit Profile, Login, etc) */
.signup-container {
  padding: 20px 20px 50px 20px;
}

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

.form-label {
  display: block;
  margin-bottom: 8px;
  color: #ccc;
}

.form-control {
  width: 100%;
  padding: 15px;
  background-color: #333;
  border: 1px solid #444;
  border-radius: 10px;
  color: white;
  font-size: 1rem;
  box-sizing: border-box;
}

.header-title {
  flex:1;
  font-size: 2rem;
  font-weight: bold;
  text-align: center;
  color: var(--accent-color);
}

.btn-primary {
  width: 100%;
  padding: 15px;
  background-color: var(--accent-color);
  border: none;
  border-radius: 10px;
  color: #121212;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  margin-top: 20px;
}

.back-btn {
  position: absolute;
  top: 20px;
  left: 20px;
  color: white;
  font-size: 1.5rem;
}

/* Edit Profile Specifics */
.preview-image-container {
  margin-bottom: 10px;
}

.main-preview-image {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-color);
}

.existing-images-container {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.existing-image-wrapper {
  position: relative;
  display: inline-block;
}

.existing-image {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #444;
}

.delete-image-btn {
  position: absolute;
  top: -5px;
  right: -5px;
  background: red;
  color: white;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.new-image-preview {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.preview-thumb {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 10px;
}

/* Home / Grid */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  padding-bottom: 80px;
}

.profile-card-home {
  height: auto;
  aspect-ratio: 3/4;
  position: relative;
  border-radius: 15px;
  overflow: hidden;
  background-color: #222;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.profile-image-home {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
}

.profile-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
  padding: 15px;
  color: white;
}
.profile-name {
  font-size: 1.1rem;
  font-weight: bold;
  margin-bottom: 5px;
}
.profile-details {
  font-size: 0.8rem;
  color: #ddd;
  margin-bottom: 5px;
}

.status-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  color: white;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Online Status Styles */
.status-badge.online {
    background: rgba(76, 209, 55, 0.1);
    color: #4cd137;
}

.status-badge.offline {
    background: rgba(136, 136, 136, 0.1);
    color: #888;
}

.status-dot {
  width: 6px;
  height: 6px;
  background: white;
  border-radius: 50%;
}

/* Online Status Styles */
.status-dot.online {
    background: #4cd137;
}

.status-dot.offline {
    background: #888;
}

.distance-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.7rem;
}

/* Modal */
.filter-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  justify-content: center;
  align-items: flex-end;
}

.filter-content {
  background-color: #1e1e1e;
  width: 100%;
  max-width: 480px;
  border-radius: 20px 20px 0 0;
  padding: 20px;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

.range-inputs {
  display: flex;
  gap: 10px;
}

.filter-input {
  flex: 1;
  background: #333;
  border: none;
  padding: 10px;
  border-radius: 8px;
  color: white;
}

.btn-apply {
  width: 100%;
  background: var(--accent-color);
  color: #121212;
  padding: 15px;
  border: none;
  border-radius: 10px;
  font-weight: bold;
  font-size: 1rem;
}

/* Chat Related */
.chat-input-area {
  display: flex;
  align-items: center;
  padding: 10px;
  background-color: var(--card-bg);
  border-top: 1px solid #333;
  width: 100%;
  gap: 10px;
}

.chat-input {
  flex: 1;
  padding: 10px;
  border-radius: 20px;
  border: none;
  background-color: #333;
  color: #fff;
  outline: none;
}

.send-btn,
.upload-btn {
  background: none;
  border: none;
  color: var(--accent-color);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.chat-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 20px;
}

.chat-item {
  display: flex;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid #333;
  text-decoration: none;
  color: inherit;
}

.avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: #444;
  margin-right: 15px;
  background-size: cover;
  background-position: center;
}

.chat-info {
  flex: 1;
}

.chat-name {
  font-weight: bold;
  margin-bottom: 5px;
  display: flex;
  justify-content: space-between;
}

.chat-time {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: normal;
}

.chat-preview {
  color: var(--text-secondary);
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 250px;
}

.unread-badge {
  background-color: var(--accent-color);
  color: #fff;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 0.7rem;
  margin-left: 10px;
}

/* Profile Page */
.profile-page {
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.profile-avatar-large {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background-color: #444;
  margin-bottom: 20px;
  background-image: url("https://via.placeholder.com/150");
  background-size: cover;
  position: relative;
}

.edit-icon {
  position: absolute;
  bottom: 0;
  right: 0;
  background-color: #333;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 2px solid var(--bg-color);
}

.stats-card {
  width: 100%;
  background-color: var(--card-bg);
  border-radius: 15px;
  padding: 20px;
  margin-top: 20px;
  display: flex;
  justify-content: space-around;
}

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

.stat-value {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--accent-color);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.menu-list {
  width: 100%;
  margin-top: 30px;
}

.menu-item {
  padding: 15px;
  border-bottom: 1px solid #333;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.menu-item:last-child {
  border-bottom: none;
}

/* Chat Room Specifics */
.chat-room-header {
  padding: 15px 20px;
  background-color: var(--card-bg);
  display: flex;
  align-items: center;
  border-bottom: 1px solid #333;
}

/* Fix for back button in header */
.chat-room-header .back-btn {
  position: static;
  margin-right: 15px;
  font-size: 1.2rem;
  color: var(--text-primary);
}

.chat-room-header-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  flex: 1; /* Allow it to take available space */
}

.header-avatar {
  width: 40px;
  height: 40px;
  margin-right: 10px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
}

.menu-btn {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
}

.menu-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 30px;
  background: #1e1e1e;
  border-radius: 8px;
  padding: 10px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
  z-index: 20; /* Ensure it's above other content */
}

.menu-dropdown-item {
  display: block;
  color: #fff;
  text-decoration: none;
  padding: 8px 12px;
}

.messages-area {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding-bottom: 80px;
}

/* New Message Wrapper for proper alignment */
.message-wrapper {
  display: flex;
  flex-direction: column;
  max-width: 80%;
  margin-bottom: 5px;
}

.message-wrapper.me {
  align-self: flex-end;
  align-items: flex-end;
}

.message-wrapper.other {
  align-self: flex-start;
  align-items: flex-start;
}

.message-bubble {
  padding: 12px 16px;
  border-radius: 20px;
  font-size: 0.95rem;
  line-height: 1.4;
  word-wrap: break-word;
}

.message-bubble.me {
  background-color: var(--message-me);
  color: white;
  border-bottom-right-radius: 4px;
}

.message-bubble.other {
  background-color: var(--message-other);
  color: #121212;
  border-bottom-left-radius: 4px;
}

.message-time {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-top: 5px;
  padding: 0 5px;
}

/* User Detail Slider */
.profile-header {
  position: relative;
  width: 100%;
  height: 400px; /* Adjust height as needed */
  overflow: hidden;
}

.profile-header .back-button {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 10;
  color: white;
  font-size: 1.5rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.slider-container {
  width: 100%;
  height: 100%;
  position: relative;
}

.profile-image-full {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.3);
  color: white;
  border: none;
  font-size: 2rem;
  padding: 10px;
  cursor: pointer;
  z-index: 5;
  border-radius: 5px;
}

.slider-btn-prev {
  left: 10px;
}

.slider-btn-next {
  right: 10px;
}

/* Image Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  padding-top: 100px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.9);
  justify-content: center;
  align-items: center;
}

.modal-content {
  margin: auto;
  display: block;
  max-width: 90%;
  max-height: 90%;
  border-radius: 5px;
}

.close-modal {
  position: absolute;
  top: 15px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
}

/* Additional Menu Icons */
.menu-icon {
  margin-right: 10px;
  width: 20px;
  text-align: center;
  color: var(--accent-color);
}

.menu-arrow {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.menu-header {
  padding: 0 15px 10px 15px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: bold;
  letter-spacing: 1px;
}

.menu-item-logout {
  color: #ff4d4d;
}

.menu-item-logout .menu-icon {
  color: #ff4d4d;
}

.online-status-text {
  color: #4cd137;
  font-size: 0.9rem;
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Login/Signup Specifics */
.login-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  padding: 20px;
}

.logo-large {
  font-size: 3rem;
  font-weight: 800;
  color: var(--accent-color);
  text-align: center;
  margin-bottom: 40px;
  letter-spacing: 5px;
}

.error-message {
  color: #ff4d4d;
  background-color: rgba(255, 77, 77, 0.1);
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 20px;
  text-align: center;
  font-size: 0.9rem;
}

.links {
  margin-top: 20px;
  text-align: center;
}

.links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
}

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

/* User Detail Specifics */
.profile-info-container {
  padding: 20px;
}

.profile-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.profile-name-large {
  font-size: 1.8rem;
  font-weight: 800;
  color: white;
  margin: 0;
}

.tag {
  background-color: #333;
  color: #ccc;
  padding: 5px 10px;
  border-radius: 15px;
  font-size: 0.8rem;
  display: inline-block;
  margin-right: 5px;
  margin-bottom: 5px;
}

.tag-online {
  background-color: rgba(76, 209, 55, 0.2);
  color: #4cd137;
  display: flex;
  align-items: center;
  gap: 5px;
}

.tag-offline {
    background: rgba(136, 136, 136, 0.1);
    color: #888;
    display: flex;
    align-items: center;
    gap: 5px;
}

.online-dot {
  font-size: 0.5rem;
}

.location-text {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.info-section {
  margin-bottom: 20px;
}

.info-label {
  font-size: 0.9rem;
  font-weight: bold;
  color: var(--accent-color);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.info-value {
  font-size: 1rem;
  color: #e0e0e0;
  line-height: 1.5;
}

.about-text {
  color: #ccc;
}

.tag-container {
  display: flex;
  flex-wrap: wrap;
}

.action-buttons {
  display: flex;
  gap: 15px;
  margin-top: 30px;
  margin-bottom: 20px;
}

.btn-action {
  flex: 1;
  padding: 15px;
  border-radius: 30px;
  border: none;
  font-weight: bold;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  transition: transform 0.1s;
}

.btn-action:active {
  transform: scale(0.98);
}

.btn-pass {
  background-color: #333;
  color: #ff4d4d;
}

.btn-chat {
  background-color: var(--accent-color);
  color: #121212;
}

.image-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  padding-top: 0;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: rgba(0, 0, 0, 0.95);
  justify-content: center;
  align-items: center;
}

/* Loading Indicator */
.loading-indicator {
  display: none;
  text-align: center;
  padding: 20px;
}

.loading-spinner {
  font-size: 2rem;
  color: var(--accent-color);
}

.sentinel {
  height: 20px;
}
