/* --- CSS Reset and Utility Classes --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Example of a custom element (not standard HTML) */
head1{
  /* Set default styles for the head element */
  background-color: #ff0101;
  padding: 1rem;
  text-align: center;
}

/* --- Base Styles --- */
body {
  font-family: Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #333;
  background-color: #f9f9f9;
}

/* --- Container Utility --- */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

/* --- Link Styles --- */
a {
  text-decoration: none;
  color: #007BFF;
}

a:hover {
  text-decoration: underline;
}

/* --- Button Styles --- */
button {
  font: inherit;
  padding: 0.5em 1em;
  border: none;
  border-radius: 4px;
  background-color: #007BFF;
  color: white;
  cursor: pointer;
}

button:hover {
  background-color: #0056b3;
}

/* --- Utility Classes --- */
.hidden {
  display: none;
}

.text-center {
  text-align: center;
}

.mt-1 {
  margin-top: 1rem;
}

.mb-1 {
  margin-bottom: 1rem;
}

/* --- CSS Variables for Theme --- */
:root {
  --primary-color: #4a90e2;
  --background-color: #f4f6f8;
  --window-bg: #fff;
  --border-radius: 12px;
  --box-shadow: 0 4px 24px rgba(0,0,0,0.10);
  --font-family: 'Segoe UI', Arial, sans-serif;
}

/* --- Override for Body with Theme Variables --- */
body {
  background: var(--background-color);
  font-family: var(--font-family);
  margin: 0;
  min-height: 100vh;
}

/* --- Site Header (Logo and Title) --- */
.header {
  text-align: center;
  margin-top: 32px;
}

.header img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin-bottom: 12px;
}

.header h1 {
  color: var(--primary-color);
  margin: 0 0 8px 0;
  font-size: 2.5rem;
  letter-spacing: 2px;
  text-align: top-right;
}

/* --- Dashboard Header (Top Navigation Bar) --- */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 2.5rem;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  position: sticky;
  top: 0;
  z-index: 100;
}

/* --- Logo and Title in Header --- */
.logo-title {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.dashboard-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.dashboard-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color, #4a90e2);
  letter-spacing: 1px;
}

/* --- User Menu (Top Right Dropdown) --- */
.user-menu {
  position: relative;
  display: flex;
  align-items: center;
}

.user-icon {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: box-shadow 0.2s;
  border-radius: 50px;
}

.user-icon:focus,
.user-icon:hover {
  box-shadow: 0 2px 8px rgba(74,144,226,0.15);
  outline: none;
}

.user-menu-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #eaf3fb;
  background: #fff;
  transition: border 0.2s;
}

.user-menu-caret {
  color: #4a90e2;
  font-size: 1.1rem;
  margin-left: 0.2rem;
  display: flex;
  align-items: center;
}

/* --- Dropdown Menu for User Actions --- */
.dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 110%;
  background: #fff;
  box-shadow: 0 4px 24px rgba(74,144,226,0.10);
  border-radius: 14px;
  min-width: 190px;
  overflow: hidden;
  z-index: 200;
  flex-direction: column;
  padding: 0.5rem 0;
  animation: fadeInMenu 0.18s;
}

/* --- Dropdown Animation --- */
@keyframes fadeInMenu {
  from { opacity: 0; transform: translateY(-8px);}
  to { opacity: 1; transform: translateY(0);}
}

.dropdown-menu.show {
  display: flex;
}

.dropdown-menu a {
  padding: 0.95rem 1.5rem;
  color: #333;
  text-decoration: none;
  transition: background 0.18s, color 0.18s;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  border: none;
  background: none;
}

.dropdown-menu a i {
  color: #4a90e2;
  font-size: 1.1rem;
  min-width: 18px;
  text-align: center;
}

.dropdown-menu a:hover {
  background: #eaf3fb;
  color: #4a90e2;
}

/* --- Dashboard Main Content Area --- */
.dashboard-main {
  max-width: 1300px;      /* Increased from 900px */
  margin: 2.5rem auto;
  padding: 3.5rem;        /* Increased from 2rem */
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}

.dashboard-feed {
  flex: 1;
  max-width: 540px;
  margin: 0 auto;
  padding: 1.2rem 0.5rem;
}

.dashboard-feed h2 {
  color: var(--primary-color, #4a90e2);
  margin-bottom: 1.5rem;
}

/* --- Feed Form Styles --- */
.feed-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
  position: relative;
}

.feed-form textarea {
    resize: vertical;
    min-height: 70px;
    max-height: 220px;
    padding: 1.1rem 1.2rem;
    border-radius: 12px;
    border: 1.5px solid #eaf3fb;
    font-size: 1.08rem;
    background: #f9fafb;
    color: #222;
    box-shadow: 0 2px 8px rgba(74,144,226,0.07);
    transition: border 0.2s, box-shadow 0.2s;
    outline: none;
    margin-bottom: 0.2rem;
}

.feed-form textarea:focus {
    border-color: #4a90e2;
    background: #fff;
    box-shadow: 0 4px 16px rgba(74,144,226,0.13);
}

.feed-form-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.2rem;
}

/* --- Image Upload Styles --- */
.feed-image-label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #eaf3fb;
  color: #4a90e2;
  font-size: 1.3rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  border: none;
}

.feed-image-label:hover {
  background: #4a90e2;
  color: #fff;
}

.feed-post-btn {
  background: #4a90e2;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.7rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.feed-post-btn:hover {
  background: #357abd;
}

/* --- Image Preview Styles --- */
.feed-image-preview {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: 0.5rem;
  background: #f4f6f8;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  max-width: 220px;
  position: relative;
}

.feed-image-preview img {
  max-width: 60px;
  max-height: 60px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid #d1d9e6;
}

#removeImageBtn {
  background: #e74c3c;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.5rem;
  transition: background 0.2s;
}

#removeImageBtn:hover {
  background: #c0392b;
}

/* --- Chat Container and Sidebar --- */
.chat-container {
  display: flex;
  background: #f9fafb;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  min-height: 420px;
}

.chat-sidebar {
  width: 220px;
  background: #fff;
  border-right: 1px solid #e5e7eb;
  padding: 1.5rem 1rem;
}

.chat-sidebar h3 {
  margin-bottom: 1rem;
  font-size: 1.1rem;
  color: #4a90e2;
  font-weight: 600;
}

/* --- Chat User List Styles --- */
.chat-users {
  list-style: none;
  padding: 0;
  margin: 0;
}

.chat-users li {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.chat-users li.active,
.chat-users li:hover {
  background: #f0f4fa;
}

.chat-users img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

/* --- Chat Feed Styles --- */
.chat-feed {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: #f9fafb;
  padding: 1.5rem 1.2rem 1rem 1.2rem;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.chat-message {
  display: flex;
  align-items: flex-end;
  gap: 0.7rem;
}

.chat-message.you {
  flex-direction: row;
}

.chat-message.me {
  flex-direction: row-reverse;
}

.chat-message img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.chat-message .chat-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: #4a90e2;
}

chat-message p {
  background: #e5e7eb;
  color: #222;
  padding: 0.7rem 1.1rem;
  border-radius: 16px;
  margin: 0.2rem 0 0.2rem 0;
  max-width: 320px;
  font-size: 1rem;
}

.chat-message.me p {
  background: #4a90e2;
  color: #fff;
}

.chat-time {
  font-size: 0.8rem;
  color: #888;
  margin-top: 0.1rem;
  display: block;
}

/* --- Chat Input Styles --- */
.chat-input {
  display: flex;
  gap: 0.7rem;
  background: #fff;
  border-radius: 8px;
  padding: 0.5rem 0.8rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}

.chat-input input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1rem;
  background: transparent;
  padding: 0.6rem 0;
}

.chat-input button {
  background: #4a90e2;
  border: none;
  color: #fff;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  font-size: 1.2rem;
  cursor: pointer;
  transition: background 0.2s;
}

.chat-input button:hover {
  background: #357ab8;
}

/* --- Friends Sidebar and List --- */
.friends-sidebar {
  width: 220px;
  background: #f4f6f8;
  border-radius: 12px;
  padding: 2rem 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  min-height: 420px;
}

.friends-sidebar h3 {
  font-size: 1.15rem;
  color: #4a90e2;
  margin-bottom: 1.2rem;
  font-weight: 700;
}

.friends-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.friends-list li {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
  color: #333;
  font-size: 1rem;
}

.friends-list li:hover {
  background: #eaf3fb;
  color: #4a90e2;
}

.friends-list .friend-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: #d1d9e6;
}

/* --- Friend Link and Dropdown --- */
.friend-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: inherit;
  text-decoration: none;
  width: 100%;
}

.friend-link:hover,
.friend-link:focus {
  color: inherit;
  background: #eaf3fb;
  border-radius: 8px;
}

.friend-dropdown {
  position: relative;
}

.friend-dropdown-btn {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  padding: 0.7rem 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  color: #333;
  transition: background 0.18s;
}

.friend-dropdown-btn:hover {
  background: #eaf3fb;
  color: #4a90e2;
}

.friend-dropdown-menu {
  display: none;
  position: absolute;
  left: 0;
  top: 100%;
  background: #fff;
  box-shadow: 0 4px 24px rgba(74,144,226,0.10);
  border-radius: 10px;
  min-width: 180px;
  z-index: 100;
  flex-direction: column;
  padding: 0.3rem 0;
  margin-top: 2px;
}

.friend-dropdown-menu.show {
  display: flex;
}

.friend-dropdown-menu a {
  padding: 0.8rem 1.2rem;
  color: #333;
  text-decoration: none;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  transition: background 0.18s, color 0.18s;
}

.friend-dropdown-menu a:hover {
  background: #eaf3fb;
  color: #4a90e2;
}

/* --- Profile Card and Bio Section --- */
.profile-card {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
  max-width: 420px;
  margin: 2.5rem auto;
  padding: 2.5rem 2rem 2rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.profile-avatar {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #eaf3fb;
  margin-bottom: 1.2rem;
  box-shadow: 0 2px 8px rgba(74,144,226,0.10);
}

.profile-card h2 {
  margin-bottom: 0.5rem;
  color: #4a90e2;
}

.profile-bio {
  background: #f4f6f8;
  border-radius: 10px;
  padding: 1rem 1.2rem;
  margin-bottom: 1.2rem;
  width: 100%;
  color: #333;
  font-size: 1.05rem;
  min-height: 48px;
}

.profile-action-btn {
  background: #4a90e2;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.5rem 1.2rem;
  margin-bottom: 1rem;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

.profile-action-btn[disabled] {
  background: #aaa;
  cursor: not-allowed;
}

.profile-section-title {
  color: #4a90e2;
  font-size: 1.15rem;
  font-weight: 700;
  margin: 2rem 0 1rem 0;
}

.profile-bio-section {
  margin-bottom: 1.5rem;
  text-align: center;
}

.profile-bio textarea {
  border-radius: 6px;
  border: 1px solid #d1d9e6;
  padding: 0.5rem;
  font-size: 1rem;
  width: 100%;
  resize: vertical;
}

.profile-bio p {
  color: #444;
  font-size: 1.08rem;
  margin-top: 0.7rem;
  white-space: pre-line;
}