/* Reset and base styles */
:root {
    --primary-color: #007bff;
    --secondary-color: #f0f5ff;
    --dark-color: #343a40;
    --light-color: #f8f9fa;
    --gray-color: #6c757d;
    --gray-light-color: #e9ecef;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --border-radius: 0.375rem;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --transition: all 0.3s ease;
    --upvote-color: #FF4500;   
    --downvote-color: #7193FF; 
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: #f8f9fa;
    color: var(--dark-color);
}

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

/* Layout */
.container-fluid {
    padding: 0;
}

.row {
    margin: 0;
}

/* Sidebar styles */
.sidebar-container {
    height: 100vh;
    position: sticky;
    top: 0;
    border-right: 1px solid var(--gray-light-color);
    background-color: white;
    z-index: 1000;
}

.sidebar {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1rem 0;
}

.app-brand {
    padding: 0.5rem 0;
}

.app-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background-color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.app-name {
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--dark-color);
}

.app-subtitle {
    font-size: 0.75rem;
    color: var(--gray-color);
}

.sidebar .nav-link {
    padding: 0.75rem 1rem;
    margin: 0.25rem 0.75rem;
    border-radius: var(--border-radius);
    color: var(--dark-color);
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
}

.sidebar .nav-link:hover {
    background-color: var(--secondary-color);
}

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

.sidebar .nav-link i {
    font-size: 1.25rem;
    margin-right: 0.75rem;
}

.profile-section {
    padding: 1rem;
    margin: 1rem 0.75rem 0;
    border-top: 1px solid var(--gray-light-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-profile-link {
    display: flex;
    align-items: center;
    color: inherit;
}

.user-profile-link:hover {
    color: var(--primary-color);
}

.avatar-sm {
    width: 40px;
    height: 40px;
    object-fit: cover;
}

.user-info {
    margin-left: 0.75rem;
}

.username {
    font-weight: 600;
    font-size: 0.9rem;
}

.user-email {
    font-size: 0.75rem;
    color: var(--gray-color);
}

.settings-link {
    font-size: 1.25rem;
    color: var(--gray-color);
}

.settings-link:hover {
    color: var(--primary-color);
}

.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 100px);
    max-width: 100%;
    margin: 0 auto;
    background-color: var(--bs-body-bg);
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.chat-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--bs-border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.chat-input {
    padding: 15px;
    border-top: 1px solid var(--bs-border-color);
}

.message {
    margin-bottom: 15px;
    max-width: 80%;
}

.message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.username {
    font-weight: bold;
    color: var(--bs-primary);
}

.timestamp {
    font-size: 0.8rem;
    color: var(--bs-secondary);
}

.message-body {
    background-color: rgba(var(--bs-primary-rgb), 0.1);
    padding: 10px 15px;
    border-radius: 10px;
    word-break: break-word;
}

.system-message {
    text-align: center;
    margin: 15px 0;
    color: var(--bs-secondary);
    font-size: 0.9rem;
}

.system-message .message-body {
    background-color: rgba(var(--bs-info-rgb), 0.1);
    display: inline-block;
    padding: 5px 10px;
    border-radius: 10px;
    color: var(--bs-secondary);
}

.anonymous-identity {
    display: flex;
    align-items: center;
}

.logout-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    margin: 0 0.75rem;
    border-top: 1px solid var(--gray-light-color);
}

.logout-link {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    color: var(--danger-color);
    font-weight: 500;
}

.logout-link i {
    margin-right: 0.75rem;
}

/* Main content */
.main-content {
    padding: 2rem;
    background-color: #f0f2f5;
    min-height: 100vh;
}

/* Right sidebar */
.right-sidebar-container {
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
    background-color: white;
    border-left: 1px solid var(--gray-light-color);
}

.right-sidebar {
    height: 100%;
}

.search-container input {
    border-radius: var(--border-radius);
}

.group-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.group-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border-radius: var(--border-radius);
    background-color: var(--light-color);
    color: inherit;
    transition: var(--transition);
}

.group-item:hover {
    background-color: var(--secondary-color);
}

.group-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--primary-color);
    margin-right: 0.75rem;
    box-shadow: var(--box-shadow);
}

.group-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.group-members {
    font-size: 0.75rem;
    color: var(--gray-color);
}

/* Posts */
.post-create-card {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.post-input {
    border: none;
    resize: none;
    padding: 0.75rem 0;
    font-size: 1rem;
    width: 100%;
}

.post-input:focus {
    outline: none;
    box-shadow: none;
}

.post-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--gray-light-color);
    padding-top: 0.75rem;
}

.post-btn {
    background-color: var(--primary-color);
    color: white;
    border-radius: var(--border-radius);
    padding: 0.5rem 1rem;
    font-weight: 500;
    border: none;
}

.post-btn:disabled {
    opacity: 0.65;
}

.post-action-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-radius: var(--border-radius);
}

.post-action-btn:hover {
    background-color: var(--secondary-color);
}

.post-action-btn i {
    font-size: 1.25rem;
}

.post-card {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 1rem;
    margin-bottom: 1rem;
}

.post-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
}

.post-user-info {
    margin-left: 0.75rem;
}

.post-username {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.post-date {
    font-size: 0.75rem;
    color: var(--gray-color);
}

.post-content {
    margin-bottom: 0.75rem;
}

.post-image {
    margin-bottom: 0.75rem;
    border-radius: var(--border-radius);
    overflow: hidden;
}
/* Always-colored vote icons */
.btn-vote.upvote i {
    color: var(--upvote-color);
}

.btn-vote.downvote i {
    color: var(--downvote-color);
}

/* Always-colored vote arrows and counts */
.btn-vote.upvote i,
.btn-vote .upvote-count {
    color: var(--upvote-color);
}

.btn-vote.downvote i,
.btn-vote .downvote-count {
    color: var(--downvote-color);
}

.post-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.post-footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.vote-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.375rem 0.75rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--gray-light-color);
    background-color: white;
    color: var(--gray-color);
    transition: var(--transition);
}

.vote-btn:hover {
    background-color: var(--light-color);
}

.vote-btn.active-upvote {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.vote-btn.active-downvote {
    background-color: var(--danger-color);
    color: white;
    border-color: var(--danger-color);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.empty-state-icon {
    font-size: 3rem;
    color: var(--gray-color);
    margin-bottom: 1rem;
}

/* Improved Group Cards */
.group-card {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid #eaeaea;
}

.group-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.group-card-header {
    padding: 1.25rem 1.25rem 0.75rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.icon-wrapper {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background-color: var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
}

.icon-wrapper i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.group-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
    flex: 1;
}

.group-card-body {
    padding: 0 1.25rem;
    flex: 1;
}

.group-description {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 0.75rem;
    overflow: hidden;
    line-height: 1.5;
}

.group-card-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Group detail page */
.group-header {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 1.5rem;
}

.group-header-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: var(--primary-color);
}

/* Create group modal */
.icon-selector {
    padding: 0.5rem 0;
}

.icon-option {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--light-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--gray-color);
    cursor: pointer;
    transition: var(--transition);
}

.icon-option:hover {
    background-color: var(--secondary-color);
    color: var(--primary-color);
}

.icon-option.active {
    background-color: var(--primary-color);
    color: white;
}

/* Forms */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(36, 110, 253, 0.25);
}

.form-group {
    margin-bottom: 1rem;
}

.form-card {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 2rem;
}

/* Avatar */
.avatar-small {
    width: 30px;
    height: 30px;
    object-fit: cover;
}

/* Responsive */
@media (max-width: 991.98px) {
    .sidebar .nav-link span {
        display: none;
    }
    
    .sidebar .nav-link i {
        margin-right: 0;
        font-size: 1.5rem;
    }
    
    .sidebar .nav-link {
        justify-content: center;
    }
    
    .profile-section {
        flex-direction: column;
    }
    
    .user-info {
        display: none;
    }
    
    .settings-link {
        margin-top: 0.5rem;
    }
    
    .logout-link span {
        display: none;
    }
    
    .logout-link {
        justify-content: center;
    }
    
    .logout-link i {
        margin-right: 0;
    }
}

.btn-vote {
    background-color: transparent;
    border: none;
    font-weight: bold;
    padding: 0.25rem 0.5rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    border-radius: 4px;
}

.btn-vote i {
    font-size: 1.2rem;
    margin-right: 0.2rem;
}

.btn-vote:hover {
    background-color: #f3f3f3;
}

.upvote.active {
    color: #FF4500; 
}

.downvote.active {
    color: #7193FF; 
}

.upvote:hover i,
.upvote:hover span {
    color: #FF4500;
}

.downvote:hover i,
.downvote:hover span {
    color: #7193FF;
}

/* Vote count styling */
.upvote-count, .downvote-count {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Hover transitions */
.btn-vote i, .btn-vote span {
    transition: color 0.15s ease-in-out;
}

/* Profile picture styles */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    border: 1px solid #eaeaea;
}

.avatar.me-2 {
    flex-shrink: 0;
}

.avatar.small {
    width: 30px;
    height: 30px;
}

.profile-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    border: 3px solid white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Enforce consistent avatar sizes */
img.avatar, img.avatar-sm, img.avatar-small, img.profile-avatar {
    max-width: 100%;
    max-height: 100%;
    display: block;
} 

.user-profile-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%; 
    text-decoration: none;
  }
  
  .avatar-sm {
    width: 32px;
    height: 32px;
    object-fit: cover;
    flex-shrink: 0; 
  }
  
  .user-info {
    display: flex;
    flex-direction: column;
    flex: 1;             
    min-width: 0;        
    overflow: hidden;
  }
  
  .username,
  .user-email {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    font-size: 0.875rem;
    line-height: 1.2;
  }
  .colorchange {
    color: white;}

  @media (max-width: 768px) {
    .avatar-sm {
      width: 28px;
      height: 28px;
    }
  
    .username,
    .user-email {
      font-size: 0.8rem;
    }
  }

.change {
    border-bottom-left-radius: 0px;
    border-bottom-right-radius: 0px;
}

  .card-body {
    background-color: var(--bg-card);
    border-radius: 0.5rem;
  }
  
  .card-header:first-child {
    border-top-left-radius: 1rem;  
    border-top-right-radius: 1rem;
  }

.notification-badge {
    position: absolute;
    right: 8px;
    font-size: 0.7rem;
    padding: 0.25rem 0.45rem;
    border-radius: 50%;
}

:root {
    --primary-color: #007bff;
    --secondary-color: #f0f5ff;
    --dark-color: #343a40;
    --light-color: #f8f9fa;
    --gray-color: #6c757d;
    --gray-light-color: #e9ecef;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --border-radius: 0.375rem;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --transition: all 0.3s ease;
    --upvote-color: #FF4500;
    --downvote-color: #7193FF;
    
    /* Background and text colors */
    --bg-main: #f8f9fa;
    --bg-card: #ffffff;
    --bg-sidebar: #ffffff;
    --text-main: #343a40;
    --text-secondary: #6c757d;
    --border-color: #e9ecef;
}

   


body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

/* Update sidebar styles */
.sidebar-container {
    border-right: 1px solid var(--border-color);
    background-color: var(--bg-card);
}

.app-name {
    color: var(--text-main);
}

.app-subtitle {
    color: var(--text-secondary);
}

.sidebar .nav-link {
    color: var(--text-main);
}

.sidebar .nav-link:hover {
    background-color: var(--secondary-color);
}

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

/* Update profile section */
.profile-section {
    border-top: 1px solid var(--border-color);
}

.user-email {
    color: var(--text-secondary);
}

.settings-link {
    color: var(--gray-color);
}

.logout-section {
    border-top: 1px solid var(--border-color);
}

/* Main content */
.main-content {
    padding: 2rem;
    background-color: var(--bg-main);
    min-height: 100vh;
}

/* Right sidebar */
.right-sidebar-container {
    background-color: var(--bg-card);
    border-left: 1px solid var(--border-color);
}

/* Group items */
.group-item {
    background-color: var(--light-color);
}

.group-icon {
    background-color: var(--bg-card);
}

.group-members {
    color: var(--text-secondary);
}

/* Posts */
.post-create-card, 
.post-card, 
.empty-state,
.form-card,
.group-header,
.group-card {
    background-color: var(--bg-card);
    box-shadow: var(--box-shadow);
}

.post-actions {
    border-top: 1px solid var(--border-color);
}

.post-date {
    color: var(--text-secondary);
}

.vote-btn {
    border: 1px solid var(--border-color);
    background-color: var(--bg-card);
    color: var(--text-secondary);
}


.empty-state-icon {
    color: var(--text-secondary);
}

/* Group cards */
.group-card {
    border: 1px solid var(--border-color);
}

.icon-wrapper {
    background-color: var(--secondary-color);
}

.group-description {
    color: var(--text-secondary);
}

.group-card-footer {
    border-top: 1px solid var(--border-color);
}

.mention-link {
    color: #2563eb;
    font-weight: 600;
    text-decoration: none;
}

.mention-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* Landing page (guest home) */
.landing-page {
    position: relative;
    border-radius: 20px;
    padding: 2.5rem 2rem;
    overflow: hidden;
    background:
        radial-gradient(1000px 420px at -10% -20%, rgba(0, 123, 255, 0.14), transparent 60%),
        radial-gradient(700px 340px at 110% 120%, rgba(23, 162, 184, 0.12), transparent 55%),
        linear-gradient(135deg, #f8fbff 0%, #eef4ff 55%, #f6f9ff 100%);
    border: 1px solid #dbe8ff;
}

.landing-title {
    color: #1f2937;
    letter-spacing: -0.02em;
}

.landing-subtitle {
    color: #334155;
    max-width: 640px;
    line-height: 1.6;
}

.landing-cta-row .btn {
    min-width: 130px;
}

.landing-features-wrap {
    position: relative;
}

.landing-features-card {
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(188, 210, 243, 0.75);
    box-shadow: 0 18px 45px rgba(13, 56, 116, 0.08);
    backdrop-filter: blur(4px);
}

.landing-feature-list {
    gap: 1rem;
}

.landing-feature-item {
    background: #f7faff;
    border: 1px solid #e1ebff;
    box-shadow: none;
}

.landing-feature-item h5 {
    color: #1f2937;
}

.landing-feature-item p {
    color: #475569;
}

@media (max-width: 991.98px) {
    .landing-page {
        padding: 1.75rem 1rem;
    }
}

/* Custom form feedback */
.form-feedback-banner {
    border: 1px solid #f5c2c7;
    background: linear-gradient(135deg, #fff5f5 0%, #ffeef0 100%);
    color: #7f1d1d;
    border-radius: 12px;
    padding: 0.75rem 0.9rem;
    margin-bottom: 1rem;
    font-weight: 500;
    box-shadow: 0 8px 20px rgba(220, 53, 69, 0.12);
}

