/**
 * NatureConnect Main Stylesheet
 * 
 * This file contains core styling for the NatureConnect social media platform including:
 * - Base element styling
 * - Layout and containers
 * - Navigation and header components
 * - Cards and interactive elements
 * - Forms and inputs
 * - Button styles
 */

/* Base styling */
body {
    font-family: 'Poppins', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f8f9fa;
    color: #333;
}

/* Header components */
header {
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 15px 0;
}

.container {
    width: 85%;
    margin: auto;
    overflow: hidden;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 40px;
    margin-right: 10px;
    transition: all 0.3s ease;
}

.logo h1 {
    font-size: 1.5rem;
    color: #3a7d44;
    margin: 0;
    transition: color 0.3s ease;
}

.logo-link {
    text-decoration: none;
    display: block;
}

.logo-link:hover {
    text-decoration: none;
}

.logo-link:hover .logo h1 {
    color: #2d6035;
}

.logo-link:hover .logo img {
    opacity: 0.9;
    transform: scale(1.02);
}

nav ul {
    display: flex;
    list-style-type: none;
    margin: 0;
    padding: 0;
    align-items: center;  /* Added to vertically center items */
}

nav ul li {
    margin-left: 20px;
    display: flex;  /* Added to properly contain the button */
    align-items: center;
}

nav ul li a {
    text-decoration: none;
    color: #555;
    font-weight: 500;
    transition: color 0.3s ease;
}

nav ul li a:hover {
    color: #3a7d44;
}

.btn {
    padding: 8px 15px;  /* Reduced padding */
    border-radius: 5px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;  /* Changed to inline-flex */
    align-items: center;
    justify-content: center;
    line-height: normal;  /* Added normal line height */
    height: auto;  /* Changed from fixed height to auto */
    width: auto;   /* Ensure buttons size to content */
    white-space: nowrap; /* Prevent text wrapping within buttons */
}

.btn-primary {
    background-color: #3a7d44;
    color: white !important;
    border: 0;
}

.btn-primary:hover {
    background-color: #2d6035;
}

.hero-section {
    padding: 80px 0;
    background: linear-gradient(to bottom, #e9f5db, #f8f9fa);
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hero-text {
    flex: 1;
    padding-right: 40px;
}

.hero-text h2 {
    font-size: 2.5rem;
    color: #2d6035;
    margin-bottom: 20px;
}

.hero-text p {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 30px;
    line-height: 1.6;
}

.hero-buttons {
    display: flex;
    gap: 15px;
}

/* Button secondary style */
.btn-secondary {
    background-color: transparent;
    color: #3a7d44;
    border: 2px solid #3a7d44;
}

.btn-secondary:hover {
    background-color: rgba(58, 125, 68, 0.1);
}

.hero-image {
    flex: 1;
    text-align: center;
}

.hero-image img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Features section */
.features-section {
    padding: 80px 0;
    background-color: #fff;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    color: #2d6035;
    margin-bottom: 50px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.feature-card {
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    transition: transform 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.feature-card:hover {
    transform: translateY(-10px);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.feature-card h3 {
    font-size: 1.3rem;
    color: #3a7d44;
    margin-bottom: 15px;
}

.feature-card p {
    color: #555;
    line-height: 1.6;
}

/* Form styles */
.form-section {
    padding: 60px 0;
    background: linear-gradient(to bottom, #e9f5db, #f8f9fa);
}

.form-container {
    max-width: 600px;
    margin: 1em auto;
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.form-control {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: 'Poppins', Arial, sans-serif;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #3a7d44;
    box-shadow: 0 0 0 3px rgba(58, 125, 68, 0.2);
}

.input-group {
    display: flex;
    width: 100%;
}

.input-group-text {
    padding: 10px 15px;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-right: none;
    border-radius: 5px 0 0 5px;
    color: #555;
}

.input-group .form-control {
    border-radius: 0 5px 5px 0;
}

.form-control.error {
    border-color: #dc3545;
}

.error-message {
    display: block;
    color: #dc3545;
    font-size: 0.85rem;
    margin-top: 5px;
    height: 20px;
}

.form-error {
    background-color: #f8d7da;
    color: #dc3545;
    padding: 10px 15px;
    border-radius: 5px;
    border: 1px solid #f5c6cb;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.form-actions {
    margin-top: 30px;
}

.form-actions .btn {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
}

.form-footer {
    margin-top: 20px;
    text-align: center;
    color: #555;
}

.form-footer a {
    color: #3a7d44;
    text-decoration: none;
}

.form-footer a:hover {
    text-decoration: underline;
}

/* Footer */
footer {
    background: #2d6035;
    color: #ffffff;
    text-align: center;
    padding: 30px 0;
}

.footer-links {
    margin-top: 15px;
}

.footer-links a {
    color: #e9f5db;
    margin: 0 10px;
    text-decoration: none;
}

.footer-links a:hover {
    text-decoration: underline;
}

/* Home Section */
.home-section {
    padding: 20px 0;
}

/* Post Create Card */
.post-create-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    padding: 0 20px;
    padding-bottom: 20px;
    margin-bottom: 30px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.post-create-card:hover {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

.post-create-card.home-post-create {
    border-radius: 12px;
    padding: 15px 20px;
}

.post-create-card.profile-post-create {
    margin-top: 10px;
}

.post-create-header h3 {
    color: #2d6035;
    font-size: 1.4rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.post-create-body .form-control {
    border: none;
    border-bottom: 1px solid #eaeaea;
    border-radius: 0;
    padding: 15px 0;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    resize: none;
    margin-bottom: 15px;
    width: 100%;
    box-sizing: border-box;
}

.post-create-body .form-control:focus {
    outline: none;
    border-color: #3a7d44;
    box-shadow: none;
}

.post-create-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
}

.media-icons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-icon {
    background: #f8f9fa;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.2rem;
}

.btn-icon:hover {
    background: #e9f5eb;
    transform: scale(1.05);
}

.btn-icon.active {
    background: #3a7d44;
    color: white;
    transform: scale(1.1);
    animation: pulse 0.3s;
}

/* News Feed */
.news-feed {
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    width: 100%;
}

.post-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.post-header {
    display: flex;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid #f0f0f0;
}
.post-user {
    display: flex;
    align-items: center;
    padding: 15px;
    padding-bottom: 10px;
    width: 100%;
    position: relative;  /* Position relative for absolute positioning of elements */
}
.user-info-container {
    display: flex;
    align-items: center;
    width: 100%;  /* Ensure it takes full width of parent */
    flex-grow: 1; /* Allow it to grow to fill available space */
}
.user-avatar {
    width: 50px;
    height: 50px;
    margin-right: 15px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
    position: relative; /* Add relative positioning to contain the indicator */
}

.user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.user-avatar:hover {
    transform: scale(1.05);
}

.user-info {
    max-width: calc(100% - 160px); /* Allow space for action buttons */
}

.user-info h4 {
    margin: 0;
    font-size: 1rem;
    color: #333;
    transition: color 0.2s ease;
}

.user-info h4:hover {
    color: #3a7d44;
}

.user-info .post-time {
    font-size: 0.8rem;
    color: #888;
    margin: 3px 0 0 0;
    line-height: 1.2;
}
.post-body {
    padding: 20px;
}
.post-body p {
    margin: 0 0 10px;
    font-size: 1rem;
    color: #333;
}
.post-image {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 15px 0;
    overflow: hidden;
    border-radius: 8px;
    max-height: 400px; /* Limit maximum height */
}

.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* This will maintain aspect ratio while filling the container */
    max-height: 400px;
}
.post-actions {
    display: flex;
    justify-content: space-around;
    padding: 10px;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    background-color: #fafafa;
}

/* Post action buttons */
.post-actions .btn-action {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    color: #555;
    display: flex;
    align-items: center;
    padding: 8px 15px;
    border-radius: 20px;
    transition: all 0.2s ease;
}

.post-actions .btn-action:hover {
    background-color: #f0f0f0;
}

.post-actions .btn-action .action-icon {
    margin-right: 8px;
    font-size: 1.2rem;
}

.like-btn:hover {
    color: #e74c3c;
}

/* Comment button styles removed */

/* Share button hover effect */
.share-btn:hover {
    color: #2ecc71;
}

.post-comments {
    padding: 10px 15px;
    background-color: #fff;
    border-top: 1px solid #eee;
}

.comment {
    display: flex;
    margin-bottom: 10px;
    padding-bottom: 5px;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    margin-right: 10px;
    border-radius: 50%;
    overflow: hidden;
}

.comment-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.comment-content {
    flex: 1;
}

.comment-content h5 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
}

.comment-content p {
    margin: 3px 0;
    font-size: 0.9rem;
    color: #333;
}

.comment-time {
    color: #777 !important;
    font-size: 0.8rem !important;
}

/* View All Comments Link */
.view-all-comments {
    margin: 8px 0;
}

.view-comments-link {
    font-size: 0.85rem;
    color: #777;
    text-decoration: none;
    transition: color 0.2s ease;
}

/* Comment Section Styling */
.styled-comments-list {
    margin-top: 10px;
    padding: 0;
}
.styled-comment {
    display: flex;
    align-items: flex-start;
    margin-bottom: 12px;
    background: #f8faf8;
    border-radius: 10px;
    padding: 10px 14px;
    box-shadow: 0 2px 8px rgba(44, 96, 53, 0.04);
    transition: box-shadow 0.2s;
}
.styled-comment:hover {
    box-shadow: 0 4px 16px rgba(44, 96, 53, 0.10);
}
.styled-comment .comment-avatar {
    margin-right: 12px;
}
.styled-comment .profile-img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e0e0e0;
}
.styled-comment .comment-content {
    flex: 1;
}
.styled-comment .comment-content h5 {
    margin: 0 0 2px 0;
    font-size: 1rem;
    color: #2d6035;
    font-weight: 600;
}
.styled-comment .comment-content p {
    margin: 0 0 4px 0;
    font-size: 0.98rem;
    color: #333;
}
.styled-comment .comment-time {
    font-size: 0.85rem;
    color: #7a8b7a;
}
.more-comments {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    gap: 10px;
}
.comment-avatars {
    display: flex;
    align-items: center;
    gap: 4px;
}
.comment-user-avatar .small-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #b6d7b6;
    object-fit: cover;
    box-shadow: 0 1px 4px rgba(44, 96, 53, 0.08);
}
.more-comments-text .view-comments-link {
    color: #2d6035;
    font-weight: 500;
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.97rem;
}
.styled-comment-form {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    background: #f4f8f4;
    border-radius: 8px;
    padding: 8px 12px;
    box-shadow: 0 1px 4px rgba(44, 96, 53, 0.04);
}
.styled-comment-form .new-comment-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1rem;
    padding: 6px 0;
    outline: none;
}
.styled-comment-form .btn-primary {
    padding: 6px 18px;
    font-size: 1rem;
    border-radius: 6px;
}

/* Additional Comment Styles for Avatar Stack */
.more-comments {
    display: flex;
    align-items: center;
    margin: 10px 0;
}

.comment-avatars {
    display: flex;
    margin-right: 10px;
}

.comment-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #fff;
    margin-right: -8px; /* Negative margin for stacking effect */
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.comment-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.more-comments-text {
    flex: 1;
}

.view-comments-link:hover {
    color: #3a7d44;
    text-decoration: underline;
}

/* Comment Form */
.comment-form {
    display: flex;
    margin-top: 10px;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}

.comment-input-wrapper {
    flex: 1;
    width: 100%;
}

.comment-form input {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 0.9rem;
    color: #333;
    font-family: 'Poppins', Arial, sans-serif;
    height: 38px; /* Set a specific height */
    box-sizing: border-box;
}

.comment-form input:focus {
    outline: none;
    border-color: #3a7d44;
}

.comment-form .btn {
    padding: 8px 16px;
    font-size: 0.9rem;
    height: 38px; /* Match the height of the input */
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #3a7d44;
    cursor: pointer; /* Add cursor pointer to clearly indicate it's clickable */
    transition: background-color 0.2s ease, transform 0.1s ease; /* Add smooth transition */
}

.comment-form .btn:hover {
    background-color: #2d6035; /* Darker green on hover */
    transform: translateY(-1px); /* Slight lift effect */
}

/* Latest Updates Section */
.section-header {
    width: 100%;
    margin-bottom: 20px;
    grid-column: 1 / -1; /* Make it span all columns */
    font-size: 1.5rem;
    color: #2d6035;
}

/* Profile styles */
.profile-section {
    padding: 40px 0;
}

.profile-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 30px;
}

/* Profile Sidebar */
.profile-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.profile-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
    padding: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 15px;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border: 3px solid #3a7d44;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-name {
    margin: 0 0 5px;
    font-size: 1.5rem;
    color: #333;
}

.profile-username {
    margin: 0;
    color: #777;
    font-size: 0.9rem;
}

.profile-stats {
    display: flex;
    justify-content: space-around;
    width: 100%;
    margin: 15px 0;
    padding: 15px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

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

.stat-number {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
}

.stat-label {
    font-size: 0.8rem;
    color: #777;
}

.profile-bio {
    text-align: center;
    margin-bottom: 20px;
    color: #555;
    line-height: 1.5;
}

.profile-actions {
    width: 100%;
}

.profile-actions .btn {
    width: 100%;
}

/* Profile Menu */
.profile-menu {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
    padding: 20px;
}

.profile-menu h3 {
    margin-top: 0;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    color: #3a7d44;
}

.menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-item {
    margin-bottom: 5px;
}

.menu-item a {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: #555;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.menu-item a:hover {
    background-color: #f5f5f5;
    color: #3a7d44;
}

.menu-item.active a {
    background-color: #e9f5db;
    color: #3a7d44;
    font-weight: 500;
}

.menu-icon {
    margin-right: 10px;
    font-size: 1.1rem;
}

.menu-item.logout a {
    color: #dc3545;
}

.menu-item.logout a:hover {
    background-color: rgba(220, 53, 69, 0.1);
}

/* Profile Content */
.profile-content {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
    padding: 25px;
}

.profile-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.tab-btn {
    background: none;
    border: none;
    padding: 15px 25px;
    font-size: 1rem;
    color: #777;
    cursor: pointer;
    position: relative;
    font-family: 'Poppins', Arial, sans-serif;
}

.tab-btn:hover {
    color: #3a7d44;
}

.tab-btn.active {
    color: #3a7d44;
    font-weight: 500;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #3a7d44;
    border-radius: 3px 3px 0 0;
}

.tab-content {
    padding: 10px 0;
}

.tab-content.hidden {
    display: none;
}

/* Activity List */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.activity-item {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 12px 15px;
    background-color: #f8f9fa;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    margin-bottom: 5px;
    position: relative;
}

.activity-item .activity-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.expanded-post {
    width: 100%;
    margin: 15px 0 0 0;
    padding: 10px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    box-sizing: border-box;
    animation: fadeIn 0.3s;
}

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

/* Comment activity item specific styles */
.comment-activity-item {
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 5px;
}

.comment-activity-item:hover {
    background-color: #e9f5db;
    transform: translateX(3px);
}

.comment-text {
    margin: 3px 0;
    font-size: 0.9rem;
    color: #666;
    max-height: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Post details container styling */
.post-details-container {
    width: 100%;
    margin: 10px 0 15px;
    padding: 10px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    box-sizing: border-box;
}

.activity-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #e9f5db;
    border-radius: 50%;
    margin-right: 15px;
    font-size: 1.2rem;
}

/* Image Modal Styles */
.image-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    overflow: hidden;
}

.image-modal.open {
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-modal img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    animation: zoom-in 0.3s ease;
}

@keyframes zoom-in {
    from {transform: scale(0.8); opacity: 0;}
    to {transform: scale(1); opacity: 1;}
}

/* Chat and Block button styles */
.profile-action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    width: 100%;
    flex-wrap: wrap;
}

.profile-actions .btn-primary {
    width: 100%;
    margin-bottom: 10px;
}

.btn-secondary {
    background-color: #3498db;
    color: white;
    border: none;
    flex: 1;
    min-width: 80px;
    padding: 10px 8px;
}

.btn-secondary:hover {
    background-color: #2980b9;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
    border: none;
    flex: 1;
    min-width: 80px;
    padding: 10px 8px;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-chat, .btn-block {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    white-space: normal;
    text-align: center;
}

.btn-chat .btn-icon, .btn-block .btn-icon {
    margin-right: 8px;
    font-size: 1.1rem;
}

/* Small icon buttons in post headers */
.user-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    position: absolute;
    right: 15px;
    top: 15px;
}

.btn-icon-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background-color: #f8f9fa;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
}

.btn-icon-sm:hover {
    background-color: #e9f5db;
    transform: translateY(-1px);
}

.btn-icon-sm.btn-chat:hover {
    background-color: rgba(52, 152, 219, 0.2);
    color: #3498db;
}

.btn-icon-sm.btn-block:hover {
    background-color: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.btn-icon-sm.btn-delete-post {
    transition: all 0.2s ease;
}

.btn-icon-sm.btn-delete-post:hover {
    background-color: rgba(231, 76, 60, 0.2);
    transform: translateY(-1px);
}

@keyframes zoom-in {
    from {transform: scale(0.8); opacity: 0;}
    to {transform: scale(1); opacity: 1;}
}

/* Database connection status */
.db-connection-status {
    position: absolute;
    top: 20px;
    right: 30px;
    display: flex;
    align-items: center;
    background-color: #f8f9fa;
    padding: 6px 12px;
    border-radius: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    font-size: 0.85rem;
}

.connection-label {
    margin-right: 8px;
    font-weight: 500;
    color: #555;
}

/* Admin stats dashboard */
.stats-dashboard {
    margin-bottom: 40px;
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stats-card {
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.stats-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #333;
}

.stats-period {
    font-size: 0.8rem;
    color: #666;
}

.stats-content {
    margin-bottom: 20px;
}

.stats-number {
    font-size: 2.2rem;
    font-weight: 700;
    color: #3a7d44;
    margin-bottom: 5px;
}

.stats-label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 10px;
}

.stats-trend {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    padding: 4px 8px;
    border-radius: 4px;
    width: fit-content;
}

.stats-trend.up {
    color: #28a745;
    background-color: rgba(40, 167, 69, 0.1);
}

.stats-trend.down {
    color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
}

.trend-icon {
    margin-right: 4px;
}

.trend-value {
    font-weight: 600;
    margin-right: 4px;
}

.stats-chart {
    margin-top: auto;
    height: 60px;
}

.chart-line {
    display: flex;
    align-items: flex-end;
    height: 100%;
    gap: 3px;
}

.chart-point {
    flex: 1;
    background-color: rgba(58, 125, 68, 0.3);
    border-radius: 3px 3px 0 0;
    position: relative;
    transition: all 0.3s ease;
}

.chart-point:hover {
    background-color: rgba(58, 125, 68, 0.5);
}

.chart-point.active {
    background-color: rgba(58, 125, 68, 0.8);
}

.admin-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 20px;
    margin-bottom: 30px;

}



.user-status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    position: absolute;
    bottom: 0;
    right: 0;
    border: 2px solid #fff;
    z-index: 3; /* Changed z-index as requested */
}

.user-status-indicator.online {
    background-color: #28a745;
}

.user-status-indicator.offline {
    background-color: #6c757d;
}



/* Profile images in various contexts */
.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Direct Messaging System Styles */
.dm-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

/* Toggle Button */
.dm-toggle-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #3a7d44;
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1001;
}

.dm-toggle-button:hover {
    transform: scale(1.05);
    background-color: #2d6035;
}

.dm-icon {
    font-size: 24px;
}

.dm-notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    background-color: #e74c3c;
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    transform: translate(25%, -25%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.dm-notification-badge.active {
    opacity: 1;
    visibility: visible;
}

/* DM Box */
.dm-box {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 320px;
    height: 70vh;
    max-height: 500px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    z-index: 1010; /* Increased z-index to be higher than .dm-container */
    transform: translateY(20px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.dm-box.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

/* DM Header */
.dm-header {
    padding: 15px;
    background-color: #3a7d44;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 10px 10px 0 0;
}

.dm-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
}

.dm-header-actions {
    display: flex;
    gap: 10px;
}

.dm-close, .dm-minimize {
    background: transparent;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.dm-close:hover, .dm-minimize:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* DM Search */
.dm-search {
    padding: 10px;
    position: relative;
    border-bottom: 1px solid #eee;
}

.dm-search .form-control {
    padding-left: 15px;
    padding-right: 15px;
    font-size: 14px;
    background-color: #f8f9fa;
}

.dm-search-results {
    position: absolute;
    top: 46px;
    left: 10px;
    right: 10px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    max-height: 200px;
    overflow-y: auto;
    z-index: 2;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.dm-search-results.active {
    opacity: 1;
    visibility: visible;
}

/* DM Contacts */
.dm-contacts {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.dm-contact-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    border-bottom: 1px solid #eee;
}

.dm-contact-item:hover {
    background-color: #f8f9fa;
}

.dm-contact-item .user-avatar {
    width: 40px;
    height: 40px;
    margin-right: 10px;
    flex-shrink: 0;
    position: relative; /* Add relative positioning for proper indicator placement */
}

.dm-contact-details {
    flex: 1;
    overflow: hidden;
}

.dm-contact-details h4 {
    margin: 0;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dm-contact-details p {
    margin: 3px 0 0;
    color: #777;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dm-message-time {
    font-size: 11px;
    color: #999;
    margin-top: 3px;
    display: block;
}

.dm-unread-badge {
    background-color: #3a7d44;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
}

/* DM Conversation */
.dm-conversation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #fff;
    display: flex;
    flex-direction: column;
    z-index: 3;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.dm-conversation.active {
    transform: translateX(0);
}

.dm-conversation-header {
    padding: 12px 15px;
    background-color: #3a7d44;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 4;
}

.dm-conversation-header .dm-contact-info {
    display: flex;
    align-items: center;
    flex: 1;
}

.dm-conversation-header .user-avatar {
    width: 36px;
    height: 36px;
    margin-right: 10px;
    position: relative; /* Ensure it has relative position for the indicator */
    z-index: 5;  /* Higher than the header's z-index */
}

.dm-conversation-header .dm-contact-details h4 {
    color: white;
    font-weight: 500;
    margin: 0;
    font-size: 14px;
}

.dm-contact-details h4 {
    color: #333;
    margin: 0;
    font-size: 14px;
}

.dm-contact-status-text {
    font-size: 12px;
    color: #eeeeee;
    margin: 2px 0 0;
}

.dm-back-btn {
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 16px;
    transition: all 0.2s ease;
}

.dm-back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* DM Messages */
.dm-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background-color: #f8f9fa;
    display: flex;
    flex-direction: column;
}

.dm-message {
    max-width: 80%;
    margin-bottom: 10px;
    display: flex;
}

.dm-message-sent {
    align-self: flex-end;
}

.dm-message-received {
    align-self: flex-start;
}

.dm-message-content {
    padding: 10px 15px;
    border-radius: 18px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    position: relative;
}

.dm-message-sent .dm-message-content {
    background-color: #3a7d44;
    color: white;
    border-bottom-right-radius: 4px;
}

.dm-message-received .dm-message-content {
    background-color: white;
    color: #333;
    border-bottom-left-radius: 4px;
}

.dm-message-content p {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
    word-break: break-word;
}

.dm-message-content .dm-message-time {
    font-size: 10px;
    margin-top: 3px;
    text-align: right;
    opacity: 0.8;
}

.dm-message-sent .dm-message-time {
    color: rgba(255, 255, 255, 0.8);
}

/* DM Message Form */
.dm-message-form {
    display: flex;
    padding: 10px;
    background-color: #fff;
    border-top: 1px solid #eee;
    align-items: center;
}

.dm-message-form .form-control {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 0.9rem;
    color: #333;
    font-family: 'Poppins', Arial, sans-serif;
    height: 38px;
    box-sizing: border-box;
    margin-right: 10px;
}

.dm-message-form .form-control:focus {
    outline: none;
    border-color: #3a7d44;
}

.dm-send-btn {
    padding: 8px 16px;
    font-size: 0.9rem;
    height: 38px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

/* Empty states */
.dm-empty-state {
    text-align: center;
    padding: 20px;
    color: #777;
    font-size: 0.9rem;
}

.dm-login-required {
    text-align: center;
    padding: 30px 20px;
}

.dm-login-required p {
    margin: 0;
    color: #555;
    font-size: 15px;
}

.dm-login-required a {
    color: #3a7d44;
    font-weight: 500;
    text-decoration: none;
}

.dm-login-required a:hover {
    text-decoration: underline;
}

/* Responsive styles */
@media (max-width: 576px) {
    .dm-box {
        width: 290px;
        right: 10px;
        bottom: 10px;
    }
    
    .dm-toggle-button {
        width: 50px;
        height: 50px;
        right: 10px;
        bottom: 10px;
    }
    
    .dm-message {
        max-width: 90%;
    }
}

/* Profile Action Buttons - New Style */
.profile-action-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
    width: 100%;
}

.profile-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 0;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    border: none;
    color: #fff;
}

.profile-action-btn .action-icon {
    margin-right: 10px;
    font-size: 1.2rem;
}

.profile-action-btn .action-text {
    letter-spacing: 1px;
}

.message-btn {
    background-color: #2980b9;
}

.message-btn:hover {
    background-color: #3498db;
}

.follow-btn {
    background-color: #27ae60;
}

.follow-btn:hover {
    background-color: #2ecc71;
}

.block-btn {
    background-color: #e74c3c;
}

.block-btn:hover {
    background-color: #f75f4d;
}

/* Profile hover box: hidden by default, shown on hover of profile icon link */
.profile-hover-box {
    display: none;
    position: absolute;
    top: 60px; /* Adjust as needed for your header height */
    right: 0;
    background: #fff;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    border-radius: 12px;
    min-width: 220px;
    z-index: 100;
    padding: 18px 20px 14px 20px;
    transition: opacity 0.2s;
}

.profile-nav-item {
    position: relative;
}

.profile-icon-link:hover .profile-hover-box,
.profile-icon-link:focus .profile-hover-box,
.profile-nav-item:hover .profile-hover-box {
    display: block;
}

@media (max-width: 767.98px) {
    .profile-hover-box {
        right: auto;
        left: 0;
        min-width: 180px;
        top: 50px;
        padding: 14px 10px 10px 10px;
    }
}

/* --- Profile icon in nav bar: fix size and stacking context --- */
.nav-profile-icon img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.nav-profile-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 102;
}

/* Ensure hover box is above other header content */
.profile-hover-box {
    z-index: 2000;
}

/* Restore location bubble style for post location display */
.post-location-display {
    padding: 5px 10px;
    background-color: #f0f2f5;
    border-radius: 15px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 10px;
    font-size: 0.9em;
    color: #555;
    transition: background 0.2s;
}

.post-location-display.clickable-location {
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.post-location-display.clickable-location:hover {
    background-color: #e4e6eb;
}

.post-location-display .location-icon {
    font-size: 1.1em;
}

/* Home Page Flex Layout */
.home-flex {
  display: flex;
  flex-direction: row;
  gap: 2rem;
  width: 100%;
  margin-top: 2rem;
}
.home-col {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-width: 0;
}
.home-col-left {
  max-width: 350px;
  flex: 0 0 350px;
}
.home-col-main {
  flex: 2 1 0;
}
@media (max-width: 900px) {
  .home-flex {
    flex-direction: column;
  }
  .home-col-left, .home-col-main {
    max-width: 100%;
    flex: 1 1 100%;
  }
}

/* Home Feed Flex Layout */
.home-feed-flex {
  display: flex;
  flex-direction: row;
  gap: 2rem;
  margin-top: 2rem;
}
.feed-col {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-width: 0;
  gap: 2rem;
}
.feed-col-left,
.feed-col-right {
  flex: 1 1 0;
}
.home-post-create {
  margin-bottom: 2rem;
}
@media (max-width: 900px) {
  .home-feed-flex {
    flex-direction: column;
  }
  .feed-col-left, .feed-col-right {
    max-width: 100%;
    flex: 1 1 100%;
  }
}