/* Message count badge styles */
.badge.message-count {
  display: none; /* Hidden by default */
  transition: all 0.3s ease;
}

.badge.message-count.visible {
  display: inline-block; /* Shown when has messages */
  animation: fadeIn 0.3s ease;
}

/* Task progress styles */
.task-progress {
  font-weight: bold;
  margin-left: 5px;
  color: var(--success-color);
}

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

/* Custom styles for the application */
:root {
    --primary-color: #3498db;
    --primary-hover: #2980b9;
    --success-color: #2ecc71;
    --success-hover: #27ae60;
    --text-color: #2c3e50;
    --text-secondary: #7f8c8d;
    --border-color: #d1d7e0;  /* Darkened border color for better visibility */
    --card-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    --transition: all 0.25s ease;
    --nav-height: 70px;
    --container-padding: 2rem;
}

/* User Profile */
.profile-container {
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    padding: 2.5rem;
    margin: 2rem 0;
    border: 2px solid var(--border-color);  /* Increased border width */
    position: relative;
    overflow: hidden;
}

.profile-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(135deg, var(--primary-color), #2c3e50);
    z-index: 0;
    opacity: 0.1;
}

.profile-content {
    position: relative;
    z-index: 1;
}

.profile-avatar {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid #fff;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    margin: 0 auto 1.5rem;
    display: block;
    transition: var(--transition);
    background: #f8f9fa;
    position: relative;
    z-index: 1;
}

.profile-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.profile-username {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0 0 0.5rem;
    text-align: center;
    position: relative;
    padding-bottom: 0.75rem;
}

.profile-username::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), #2c3e50);
    border-radius: 3px;
}

.profile-bio {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #555;
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    position: relative;
}

.profile-bio::before {
    content: '\f10d';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    top: 10px;
    left: 15px;
    color: var(--primary-color);
    opacity: 0.3;
    font-size: 1.8rem;
    line-height: 1;
}

.profile-meta {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.8;
    margin: 1.5rem 0;
    padding: 1.25rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid var(--border-color);
}

.profile-meta p {
    margin: 0.5rem 0;
    display: flex;
    align-items: center;
}

.profile-meta i {
    width: 20px;
    margin-right: 10px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 1rem;
}

.profile-stats {
    display: flex;
    justify-content: space-around;
    margin: 2rem 0;
    padding: 1.25rem 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border-color);
}

.stat-item {
    text-align: center;
    padding: 0.5rem 1rem;
    transition: var(--transition);
    border-radius: 6px;
}

.stat-item:hover {
    background: rgba(52, 152, 219, 0.05);
    transform: translateY(-2px);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    display: block;
    margin-bottom: 0.25rem;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    opacity: 0.8;
}

.profile-actions {
    margin: 2rem 0 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-edit, .btn-message, .btn-outline-secondary {
    width: 100%;
    padding: 0.7rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
    border: 2px solid transparent;
}

.btn-edit {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    box-shadow: 0 2px 10px rgba(52, 152, 219, 0.3);
}

.btn-edit:hover {
    background: linear-gradient(135deg, var(--primary-hover), #2472a4);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(41, 128, 185, 0.4);
}

.btn-message {
    background: linear-gradient(135deg, var(--success-color), var(--success-hover));
    color: white;
    box-shadow: 0 2px 10px rgba(46, 204, 113, 0.3);
}

.btn-message:hover {
    background: linear-gradient(135deg, var(--success-hover), #219653);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(39, 174, 96, 0.4);
}

.btn-outline-secondary {
    background: transparent;
    color: #6c757d;
    border: 2px solid #dee2e6;
}

.btn-outline-secondary:hover {
    background: #f8f9fa;
    color: #495057;
    border-color: #ced4da;
    transform: translateY(-2px);
}

/* Posts Section */
.posts-header {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 3rem 0 1.75rem;
    position: relative;
    text-align: center;
    padding-bottom: 0.75rem;
}

.posts-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), #2c3e50);
    border-radius: 3px;
}

/* Post Cards */
.post-card {
    border: 2px solid var(--border-color);  /* Increased border width */
    border-radius: 12px;
    margin-bottom: 1.5rem;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    background: #fff;
    overflow: hidden;
}

.post-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.post-header {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    background-color: #f8f9fa;
    border-bottom: 1px solid var(--border-color);
}

.post-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-right: 1rem;
    transition: transform 0.2s ease;
}

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

.post-user-info {
    flex: 1;
}

.post-username {
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 0.15rem;
    line-height: 1.3;
    font-size: 1.05rem;
    text-decoration: none;
    transition: color 0.2s ease;
}

.post-username:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.post-time {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
}

.post-time i {
    margin-right: 4px;
    font-size: 0.7rem;
}

.post-body {
    padding: 1.25rem 1.5rem;
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-color);
    white-space: pre-line;
    word-break: break-word;
}

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

.translation-link {
    font-size: 0.85rem;
    color: var(--primary-color);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: all 0.2s ease;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.translation-link i {
    margin-right: 4px;
    font-size: 0.8em;
}

.translation-link:hover {
    color: var(--primary-hover);
    background-color: rgba(52, 152, 219, 0.1);
    text-decoration: none;
}

/* Pagination */
.pagination {
    justify-content: center;
    margin: 2.5rem 0;
}

.page-link {
    color: var(--primary-color);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    margin: 0 3px;
    border-radius: 6px !important;
    transition: var(--transition);
    font-weight: 500;
}

.page-link:hover {
    color: #1a5276;
    background-color: #e9ecef;
    border-color: var(--border-color);
    transform: translateY(-1px);
}

.page-item.active .page-link {
    background: linear-gradient(135deg, var(--primary-color), #2c3e50);
    border-color: var(--primary-color);
}

.page-item.disabled .page-link {
    color: #6c757d;
    pointer-events: none;
    cursor: not-allowed;
    background-color: #fff;
    border-color: var(--border-color);
}

/* Navigation Bar */
.navbar {
    height: var(--nav-height);
    background-color: #fff !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 0.5rem var(--container-padding);
    position: sticky;
    top: 0;
    z-index: 1030;
    border-bottom: 1px solid var(--border-color);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--text-color) !important;
    letter-spacing: -0.5px;
    padding: 0.5rem 0;
}

.nav-link {
    font-weight: 500;
    color: var(--text-color) !important;
    padding: 0.75rem 1rem !important;
    margin: 0 0.25rem;
    border-radius: 8px;
    transition: var(--transition);
}

.nav-link:hover, .nav-link:focus {
    color: var(--primary-color) !important;
    background-color: rgba(52, 152, 219, 0.1);
}

.navbar-form {
    margin: 0 1rem;
    flex-grow: 1;
    max-width: 400px;
}

.navbar-form .form-control {
    border-radius: 20px;
    padding: 0.5rem 1.25rem;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    width: 100%;
}

.navbar-form .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(52, 152, 219, 0.15);
}

/* Badge for unread messages */
#message_count {
    position: relative;
    top: -2px;
    font-weight: 500;
    padding: 0.35em 0.5em;
    font-size: 0.7em;
    vertical-align: middle;
    transition: var(--transition);
}

/* Post Form */
.form-container {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
}

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

.form-control, .form-select {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    transition: var(--transition);
    font-size: 1rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(52, 152, 219, 0.15);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    border: none;
    padding: 0.75rem 1.75rem;
    font-weight: 600;
    border-radius: 8px;
    transition: var(--transition);
    box-shadow: 0 2px 10px rgba(52, 152, 219, 0.2);
    font-size: 1rem;
}

.btn-primary:hover, .btn-primary:focus {
    background: linear-gradient(135deg, var(--primary-hover), #2472a4);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(41, 128, 185, 0.3);
    border: none;
}

/* Pagination */
.pagination {
    justify-content: center;
    margin: 3rem 0 2rem;
    flex-wrap: wrap;
}

.page-item:not(:first-child) .page-link {
    margin-left: 0.5rem;
}

.page-link {
    color: var(--primary-color);
    border: 1px solid var(--border-color);
    padding: 0.6rem 1.2rem;
    border-radius: 8px !important;
    font-weight: 500;
    transition: var(--transition);
    min-width: 100px;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0.25rem;
}

.page-link:hover {
    color: var(--primary-hover);
    background-color: rgba(52, 152, 219, 0.1);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.page-item.active .page-link {
    background: linear-gradient(135deg, var(--primary-color), #2c3e50);
    border-color: var(--primary-color);
    color: white;
}

.page-item.disabled .page-link {
    color: #adb5bd;
    background-color: #f8f9fa;
    border-color: var(--border-color);
    pointer-events: none;
    transform: none;
    box-shadow: none;
}

/* Authentication Pages */
.auth-container {
    background: #fff;
    border-radius: 12px;
    padding: 2.5rem;
    margin: 2rem 0;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    max-width: 100%;
}

.auth-form {
    max-width: 400px;
    margin: 0 auto;
}

.auth-form .form-control {
    height: 48px;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.auth-form .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.15);
}

.auth-form .btn {
    padding: 0.75rem;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 8px;
    transition: var(--transition);
}

.auth-form .btn-block {
    width: 100%;
}

.auth-form .form-text {
    font-size: 0.85rem;
    color: #6c757d;
}

.auth-form .form-check-label {
    font-size: 0.9rem;
}

/* Adjust main container for fixed navbar */
body {
    padding-top: var(--nav-height);
}

.container {
    padding: 0 var(--container-padding);
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background: #fff;
        border-radius: 8px;
        padding: 1rem;
        margin-top: 0.5rem;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    }
    
    .navbar-nav {
        margin: 0.5rem 0;
    }
    
    .nav-link {
        padding: 0.75rem 1rem !important;
        margin: 0.25rem 0;
    }
    
    .navbar-form {
        margin: 0.5rem 0 1rem;
        max-width: 100%;
    }
    
    .profile-container {
        padding: 1.5rem;
    }
    
    .profile-username {
        font-size: 1.8rem;
    }
}

@media (max-width: 767.98px) {
    .auth-container {
        padding: 1.75rem;
        margin: 1.5rem 0;
    }
}

@media (max-width: 575.98px) {
    :root {
        --container-padding: 1.25rem;
    }
    
    .profile-container {
        padding: 1.25rem;
        margin: 1rem 0;
    }
    
    .profile-avatar {
        width: 120px;
        height: 120px;
    }
    
    .profile-username {
        font-size: 1.6rem;
    }
    
    .page-link {
        min-width: auto;
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
    
    .pagination {
        margin: 2rem 0;
    }
}
