/* Global Styles */
:root {
    --primary-blue: #007bff;
    --light-gray: #f8f8f8;
    --dark-blue: #0056b3;
    --accent-light-blue: #007bff;
    --text-dark: #2f2d2d;
    --text-light: #fff;
    --border-light: #e0e0e0;
    --background-pattern-color: #f0f0f0;
    --gradient-primary: linear-gradient(to right, var(--primary-blue), var(--dark-blue));
    --gradient-secondary: linear-gradient(to right, var(--light-gray), var(--border-light));
    --gradient-sidebar: linear-gradient(to bottom, var(--accent-light-blue), #99e8ff);
}

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

body {
    font-family: 'Segoe UI', 'Poppins', sans-serif;
    background: var(--light-gray);
    color: var(--text-dark);
    line-height: 1.6;
    background-image: url('images/patan-pattern.png');
    background-size: contain;
    background-repeat: repeat;
    background-blend-mode: multiply;
    background-color: var(--light-gray);
}

/* Navbar */
.navbar {
    background-color: var(--primary-blue);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 50px;
    width: 50px;
    border-radius: 40px;
}

.logo-img {
    height: 75px;
    width: auto;
    background: var(--primary-blue);
    border-radius: 40px;
    padding: 4px 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.site-title-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-left: 2px;
}

.site-title {
    margin: 0;
    font-size: 35px;
    font-weight: 1000;
    color: var(--text-light);
    font-family: 'Yatra One', 'Noto Sans Devanagari', sans-serif;
    letter-spacing: 1px;
}

.site-slogan {
    font-size: 0.75rem;
    font-style: italic;
    color: #e3eafc;
    margin-top: 0.1px;
    letter-spacing: 0.25px;
}

/* Auth Buttons on Index */
.auth-buttons {
    margin-top: 30px;
}

.auth-buttons .btn {
    padding: 10px 20px;
    text-decoration: none;
    background-color: var(--primary-blue);
    color: var(--text-light);
    border-radius: 5px;
    margin: 10px;
    transition: background-color 0.3s ease;
    font-family: 'Noto Sans Devanagari', sans-serif;
}

.auth-buttons .btn:hover {
    background-color: var(--dark-blue);
}

/* Containers */
.main-content {
    margin: 80px 20px 20px 20px;
    padding: 20px;
    box-sizing: border-box;
    width: calc(100% - 40px);
    border-radius: 8px;
    background-color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.user-avatar-initials {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-blue);
    color: #e7e6df;
    border: 1px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4em;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(25,118,210,0.10);
    text-transform: uppercase;
}

.sidebar {
    position: fixed;
    top: 0px;
    left: -220px;
    width: 220px;
    height: 100vh;
    background-color: var(--accent-light-blue);
    padding-top: 70px;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
    transition: left 0.3s ease-out;
    z-index: 998;
}

.sidebar.active {
    left: 0;
}

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

.sidebar ul li a.nav-link {
    display: block;
    padding: 15px 20px;
    color: var(--text-light);
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.3s ease;
}

.sidebar ul li a.nav-link:hover {
    background-color: var(--dark-blue);
}

/* Forms */
form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
    padding: 10px;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    font-size: 16px;
    background-color: var(--text-light);
    color: var(--text-dark);
}

input[type="submit"],
button {
    padding: 12px;
    background-color: var(--primary-blue);
    color: var(--text-light);
    font-weight: bold;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
    font-family: 'Noto Sans Devanagari', sans-serif;
}

input[type="submit"]:hover,
button:hover {
    background-color: var(--dark-blue);
}

/* Error Message */
.error {
    color: #dc3545;
    margin-bottom: 10px;
}

/* Rating Form */
.rating-section {
    margin-top: 15px;
    padding: 10px;
    border-top: 2px dashed var(--primary-blue);
}

.rating-section label {
    font-weight: bold;
    margin-right: 10px;
    font-family: 'Noto Serif Devanagari', serif;
    color: var(--text-dark);
}

.rating-section select,
.rating-section button {
    padding: 6px 10px;
    font-size: 1rem;
    margin-right: 10px;
}

.success-msg {
    margin-top: 15px;
    color: #28a745;
    font-weight: bold;
    font-family: 'Noto Sans Devanagari', sans-serif;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: var(--primary-blue);
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    z-index: 1000;
    font-family: 'Noto Serif Devanagari', serif;
}

.menu-toggle {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1.8rem;
    cursor: pointer;
    display: none;
}

/* Dashboard Metrics */
.main-content p {
    font-size: 18px;
    margin: 10px 0;
    color: var(--text-dark);
}

/* Answer Section */
textarea {
    resize: vertical;
}

.response {
    background: #e7f5ff;
    border: 1px solid #b3e0ff;
    padding: 20px;
    margin-top: 20px;
    border-radius: 8px;
}

/* Table */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background-color: var(--text-light);
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

th {
    background-color: var(--primary-blue);
    color: var(--text-light);
}

tr:hover {
    background-color: var(--light-gray);
}

/* Login & Register Container */
.login-container,
.register-container {
    max-width: 400px;
    margin: 80px auto;
    background: var(--text-light);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    border: 2px solid var(--primary-blue);
}

.login-container h2,
.register-container h2 {
    margin-bottom: 20px;
    color: var(--primary-blue);
    text-align: center;
    font-family: 'Noto Serif Devanagari', serif;
}

/* Community Section */
.community-container {
    background: var(--text-light);
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    padding: 25px;
}

.section-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 20px;
}

.tab {
    padding: 12px 20px;
    cursor: pointer;
    background: var(--light-gray);
    border-radius: 8px 8px 0 0;
    font-weight: 600;
    color: var(--text-dark);
    transition: all 0.3s ease;
}

.tab:hover,
.tab.active {
    background: var(--primary-blue);
    color: var(--text-light);
}

.tab i {
    margin-right: 8px;
}

.section-box {
    display: none;
}

.section-box.active {
    display: flex;
    flex-direction:column;
}

/* Friend Section */
.users-columns {
    display: flex;
    gap: 20px;
    margin-top: 15px;
}

.users-column {
    flex: 1;
    background: var(--light-gray);
    padding: 15px;
    border-radius: 8px;
    max-height: 500px;
    overflow-y: auto;
}

.users-column h4 {
    text-align: center;
    margin-bottom: 10px;
    font-size: 18px;
    color: black;
}

.grid-container {
    display: grid;
    /* Adjusted to allow more columns for compact view */
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); /* Wider but allows more per row */
    gap: 10px; /* Reduced gap */
    padding: 5px; /* Reduced padding */
}

.friend-card {
    display: flex;
    flex-direction: row; /* Changed to row for compact view */
    align-items: center; /* Align items vertically in the center */
    justify-content: space-between; /* Distribute space between info and actions */
    background: var(--text-light);
    border: 1px solid var(--border-light);
    border-radius: 8px; /* Slightly smaller border-radius */
    padding: 8px 10px; /* Reduced padding for shorter height */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* Lighter shadow */
    transition: transform 0.2s, box-shadow 0.2s;
    height: auto; /* Allow height to adjust */
    width: 100%; /* Occupy full width of grid column */
    margin-bottom: 0;
    position: relative;
}

.friend-card:hover {
    transform: translateY(-2px); /* Less pronounced hover effect */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15); /* Lighter hover shadow */
}

/* Compact Friend Info */
.friend-info-compact {
    display: flex;
    align-items: center;
    gap: 10px; /* Space between avatar and text */
    flex-grow: 1; /* Allow info to take available space */
}

.friend-avatar-compact {
    width: 36px; /* Smaller avatar */
    height: 36px; /* Smaller avatar */
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--primary-blue);
    flex-shrink: 0; /* Prevent avatar from shrinking */
}

.user-details-compact {
    display: flex;
    flex-direction: column; /* Changed to column to stack username and address */
    align-items: flex-start; /* Align text to the left */
    overflow: hidden; /* Hide overflowing text */
    flex-grow: 1; /* Allow details to take available space */
}

.username-compact {
    font-weight: 600; /* Slightly less bold */
    font-size: 0.9em; /* Smaller font size */
    color: var(--primary-blue);
    white-space: nowrap; /* Prevent wrapping */
    overflow: hidden; /* Hide overflow */
    text-overflow: ellipsis; /* Add ellipsis for overflow */
    display: flex; /* Make username a flex container */
    align-items: center; /* Align username text and star icon */
    gap: 5px; /* Space between username and star */
}

.user-address-compact {
    font-size: 0.7em; /* Smaller font size */
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Compact Friend Actions */
.friend-actions-compact {
    display: flex;
    gap: 3px; /* Space between action icons */
    flex-shrink: 0; /* Prevent actions from shrinking */
}

.add-friend-compact,
.request-sent-compact,
.friend-action-icon {
    background: var(--primary-blue);
    color: var(--text-light);
    border: none;
    border-radius: 50%; /* Circular buttons */
    width: 30px; /* Small circular button */
    height: 30px; /* Small circular button */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8em; /* Icon size */
    transition: background-color 0.2s ease, transform 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.add-friend-compact:hover,
.add-friend-compact:hover,
.friend-action-icon:hover {
    background: var(--dark-blue);
    transform: scale(1.05);
}

.friend-action-icon.accept-compact { background: #28a745; }
.friend-action-icon.accept-compact:hover { background: #218838; }
.friend-action-icon.reject-compact { background: #dc3545; }
.friend-action-icon.reject-compact:hover { background: #c82333; }
.friend-action-icon.chat-btn-compact { background: var(--primary-blue); }
.friend-action-icon.chat-btn-compact:hover { background: var(--dark-blue); }
.friend-action-icon.remove-compact { background: #6c757d; }
.friend-action-icon.remove-compact:hover { background: #5a6268; }


.status-dot {
    position: static; /* Make it flow with content */
    margin-left: 8px; /* Add margin to separate from text */
    width: 5px; /* Slightly smaller dot */
    height: 5px; /* Slightly smaller dot */
    flex-shrink: 0;
}


/* Chat Section */
.chat-friend-list .chat-friend-card {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
    transition: background-color 0.2s ease;
}

.chat-friend-list .chat-friend-card:hover {
    background-color: var(--background-pattern-color);
}

.chat-friend-list .chat-friend-card.active {
    background-color: var(--border-light);
}

.chat-friend-list .chat-friend-card .friend-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    margin-right: 10px;
    object-fit: cover;
}

.chat-friend-list .chat-friend-card span {
    font-size: 0.9em;
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-dark);
}

.chat-friend-list .chat-friend-card .status-dot {
    width: 8px;
    height: 8px;
    margin-left: auto;
}

.chat-main .chat-header {
    display: flex;
    align-items: center;
    padding: 8px 15px;
    background-color: var(--light-gray);
    border-bottom: 1px solid var(--border-light);
    position: relative;
}

.chat-main .chat-header .chat-back-btn {
    background: none;
    border: none;
    font-size: 1.2em;
    cursor: pointer;
    margin-right: 10px;
    color: var(--text-dark);
}

.chat-main .chat-header .friend-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    margin-right: 10px;
    object-fit: cover;
}

.chat-main .chat-header h4 {
    margin: 0;
    font-size: 1.1em;
    color: var(--text-dark);
    flex-grow: 1;
}

.chat-main .chat-header .status-dot {
    width: 10px;
    height: 10px;
    position: static;
    margin-left: 8px;
}

.chat-back-btn {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-light);
    cursor: pointer;
    display: none;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: var(--background-pattern-color);
    border-radius: 0 0 8px 8px;
}

.chat-message {
    margin: 10px 0;
    display: flex;
    flex-direction: column;
    max-width: 80%;
    word-wrap: break-word;
    position: relative;
}

.chat-message.self {
    align-items: flex-end;
    margin-left: auto;
}

.chat-message.other {
    align-items: flex-start;
    margin-right: auto;
}

.message-content {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 12px;
    position: relative;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.chat-message.self .message-content {
    background: var(--primary-blue);
    color: var(--text-light);
    border-bottom-right-radius: 4px;
}

.chat-message.other .message-content {
    background: var(--text-light);
    color: var(--text-dark);
    border-bottom-left-radius: 4px;
}

.message-text {
    word-wrap: break-word;
    font-size: 0.95em;
    color: var(--text-dark);
}

.chat-message.self .message-text {
    color: var(--text-light);
}

.chat-message .message-time {
    font-size: 0.7em;
    color: silver;
    text-align: right;
    margin-top: 5px;
    display: block;
}

.message-actions {
    display: none;
    position: absolute;
    top: -15px;
    right: 5px;
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border-light);
    border-radius: 5px;
    padding: 3px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 10;
}

.chat-message:hover .message-actions {
    display: flex;
    gap: 5px;
}

.message-actions button {
    background: none;
    border: none;
    color: #555;
    cursor: pointer;
    font-size: 0.8em;
    padding: 3px 5px;
    border-radius: 3px;
    transition: background-color 0.2s;
}

.message-actions button:hover {
    background-color: var(--border-light);
}

.message-actions .edit-message-btn {
    color: var(--primary-blue);
}

.message-actions .delete-message-btn {
    color: #dc3545;
}

.message-edit-form {
    display: none;
    margin-top: 5px;
    position: relative;
    width: 100%;
}

.message-edit-form textarea {
    width: calc(100% - 70px);
    padding: 5px;
    border: 1px solid var(--border-light);
    border-radius: 5px;
    resize: vertical;
    min-height: 40px;
    box-sizing: border-box;
}

.message-edit-form .edit-actions {
    position: absolute;
    right: 0;
    bottom: 0;
    display: flex;
    gap: 5px;
}

.message-edit-form .edit-actions button {
    padding: 5px 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85em;
}

.message-edit-form .edit-actions .save-edit-btn {
    background-color: #28a745;
    color: var(--text-light);
}

.message-edit-form .edit-actions .cancel-edit-btn {
    background-color: #6c757d;
    color: var(--text-light);
}

.chat-input-container {
    display: flex;
    gap: 10px;
    padding: 15px;
    background: var(--text-light);
    border-top: 1px solid var(--border-light);
    position: sticky;
    bottom: 0;
}

.chat-input {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border-light);
    border-radius: 20px;
    font-size: 16px;
}

.chat-send-btn {
    background: var(--primary-blue);
    color: var(--text-light);
    padding: 10px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
}

.chat-send-btn:hover {
    background: var(--dark-blue);
}

#typing-indicator {
    font-size: 14px;
    color: #666;
    padding: 5px 15px;
}

.load-more-btn {
    display: block;
    width: 200px;
    margin: 20px auto;
    padding: 10px;
    background-color: rgb(70, 148, 226);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-align: center;
}

.load-more-btn:hover {
    background-color: rgb(10, 242, 223);
}

/* Forum Section */
.forum-container {
    display: grid;
    grid-template-columns: 100% 0%;
    gap: 30px;
    align-items: start;
    width: 100%;
    box-sizing: border-box;
    padding: 20px 0;
}

.thread-form-column {
    background-color: #ffffff;
    border-radius: 8px;
    border: 1px solid var(--primary-blue);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    padding: 25px;
}

.thread-form-column label.thread-label {
    font-weight: 600;
    color: var(--primary-blue);
    margin-bottom: 0.3rem;
    margin-left: 0.75rem;
    display: block;
    font-size: 1em;
}

#new-thread-form {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.thread-input,
.thread-textarea {
    width: 100%;
    padding: 10px 15px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
    box-sizing: border-box;
    resize: vertical;
}

.textarea-container {
    position: relative;
    margin-bottom: 15px;
}

.file-attach-label {
    position: absolute;
    bottom: 10px;
    right: 10px;
    cursor: pointer;
    color: #666;
    font-size: 1.2em;
    padding: 5px;
    border-radius: 4px;
    background-color: #f0f0f000;
    transition: background-color 0.3s ease;
}

.file-attach-label:hover {
    background-color: #e0e0e000;
}

.thread-form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#char-count {
    font-size: 0.9em;
    color: #888;
}

.btn-post {
    padding: 10px 20px;
    background-color: var(--primary-blue);
    color: var(--text-light);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease;
}

.btn-post:hover {
    background-color: var(--dark-blue);
}

.threads-container {
    display: grid;
    border-radius: 8px;
    gap: 10px;
}

.thread-card {
    background-color: #e9f3ff;
    border-radius: 8px;
	border: 1px solid #27a567;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    padding: 20px;
    transition: box-shadow 0.2s ease;
}

.thread-card:hover {
    box-shadow: 0 6px 15px rgba(246, 244, 244, 0.08);
}

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

.thread-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
    object-fit: cover;
}

.thread-meta {
    flex-grow: 1;
}

.thread-author {
    font-weight: bold;
    color: var(--dark-blue);
    display: block;
}

.thread-time {
    font-size: 0.85em;
    color: #888;
}

.thread-actions-owner {
    margin-left: auto;
}

.thread-btn {
    background: none;
    border: none;
    color: var(--primary-blue);
    cursor: pointer;
    font-size: 0.9em;
    margin-left: 10px;
    transition: color 0.2s ease;
}

.thread-btn:hover {
    color: var(--dark-blue);
}

.thread-title {
    font-size: 1.4em;
    color: #333;
    margin-bottom: 10px;
}

.thread-body {
    font-size: 1em;
    line-height: 1.6;
    color: #555;
    margin-bottom: 15px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.thread-files {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px dashed #eee;
}

.thread-files h5 {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.thread-files ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.thread-files li {
    font-size: 0.9em;
    margin-bottom: 3px;
}

.thread-files a {
    color: var(--primary-blue);
    text-decoration: none;
}

.thread-files a:hover {
    text-decoration: underline;
}

.thread-actions {
    margin-top: 15px;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.show-comment-form {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s ease;
}

.show-comment-form:hover {
    color: var(--dark-blue);
}

.edit-thread-form,
.comment-form {
    margin-top: 20px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.btn-cancel-edit {
    padding: 10px 15px;
    background-color: #6c757d;
    color: var(--text-light);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.3s ease;
}

.btn-cancel-edit:hover {
    background-color: #5a6268;
}

.thread-comments {
    margin-top: 20px;
    padding-top: 10px;
}

.comment-card {
    background-color: #b1ffca;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
}

.comment-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.comment-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 8px;
    object-fit: cover;
}

.comment-meta {
    flex-grow: 1;
}

.comment-author {
    font-weight: bold;
    color: #333;
    display: block;
    font-size: 0.95em;
}

.comment-time {
    font-size: 0.75em;
    color: #999;
}

.comment-actions-owner {
    margin-left: auto;
}

.comment-btn {
    background: none;
    border: none;
    color: var(--primary-blue);
    cursor: pointer;
    font-size: 0.85em;
    margin-left: 8px;
    transition: color 0.2s ease;
}

.comment-btn:hover {
    color: var(--dark-blue);
}

.comment-body {
    font-size: 0.95em;
    color: #555;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.comment-files {
    margin-top: 10px;
    font-size: 0.85em;
    color: #666;
}

.comment-files h5 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--text-dark);
}

.comment-files ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.comment-files li {
    margin: 5px 0;
}

.comment-files a {
    color: var(--primary-blue);
    text-decoration: none;
}

.comment-files a:hover {
    text-decoration: underline;
}

.edit-comment-form {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #ddd;
}

.comment-textarea {
    width: 100%;
    padding: 8px 12px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9em;
    box-sizing: border-box;
    resize: vertical;
}

.comment-form .textarea-container {
    position: relative;
}

.comment-form .file-attach-label {
    position: absolute;
    bottom: 15px;
    right: 15px;
    cursor: pointer;
}

#forum-section textarea {
    border-radius: 6px;
    border: 1px solid var(--border-light);
    padding: 8px;
}

/* Notification Styles */
.notif-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
    margin: 2rem auto;
    max-width: 1100px;
}

.notif-card {
    flex: 1 1 300px;
    min-width: 280px;
    max-width: 350px;
    background: var(--text-light);
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    padding: 1.5rem 1rem;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
}

.notif-title {
    color: var(--primary-blue);
    font-size: 1.1em;
    font-weight: bold;
    margin-bottom: 0.75rem;
    text-align: center;
}

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

.notif-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.9em;
    text-align: justify;
}

.notif-list li:last-child {
    border-bottom: none;
}

.notif-link {
    background: none;
    border: none;
    color: var(--text-dark);
    text-align: left;
    font-size: 0.95em;
    cursor: pointer;
    padding: 0;
    width: 100%;
    transition: color 0.2s, background 0.2s;
    outline: none;
    display: flex;
    align-items: center;
}

.notif-link:hover, .notif-link:focus {
    color: var(--primary-blue);
    text-decoration: underline;
    background: #f0f8ff;
}

.notif-link .fa {
    margin-right: 0.5rem;
    color: var(--primary-blue);
    min-width: 1.1rem;
    text-align: center;
}

.notif-badge {
    display: inline-block;
    font-size: 0.7em;
    font-weight: bold;
    border-radius: 50%;
    padding: 0.2em 0.5em;
    margin-left: 0.4rem;
    vertical-align: super;
    position: relative;
    animation: notif-blink 1s infinite alternate;
    box-shadow: 0 0 6px #ff000099;
    background: red;
    color: var(--text-light);
    z-index: 1;
    min-width: 1.5em;
    text-align: center;
    line-height: 1.1em;
}

.notif-badge::before {
    font-weight: 900;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%,-60%) scale(1.2);
    color: var(--text-light);
    z-index: 0;
    pointer-events: none;
    font-size: 1em;
    opacity: 0.35;
}

@keyframes notif-blink {
    0% { box-shadow: 0 0 6px #007bff99; opacity: 1; }
    100% { box-shadow: 0 0 16px var(--primary-blue); opacity: 0.8; }
}

/* Advanced Search Bar for Friends */
.advanced-search-bar {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    align-items: flex-end;
    margin-bottom: 1rem;
    background: var(--text-light);
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 4px rgba(67,160,71,0.07);
}

.advanced-search-bar .search-bar,
.advanced-search-bar select {
    padding: 0.3rem 0.6rem;
    border: 1px solid var(--border-light);
    border-radius: 0.3rem;
    font-size: 0.9em;
    background: var(--text-light);
    color: var(--text-dark);
    min-width: 80px;
    height: 28px;
}

.advanced-search-bar .search-bar:focus,
.advanced-search-bar select:focus {
    outline: none;
    border-color: #28a745;
    background: #f9fff9;
}

.advanced-search-bar button.friend-action-btn {
    background: #28a745;
    color: var(--text-light);
    border: none;
    border-radius: 0.3rem;
    padding: 0 0.8rem;
    height: 28px;
    font-size: 1em;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    transition: background 0.2s;
    margin-bottom: 0.5rem;
}

.advanced-search-bar button.friend-action-btn i {
    margin: 0;
    font-size: 1em;
}

.advanced-search-bar button.friend-action-btn span {
    display: none;
}

.advanced-search-bar button.friend-action-btn:hover {
    background: #218838;
}

/* User Type Indicators for Friends - Adjusted for inline display */
.user-type-star {
    position: absolute; /* No longer absolutely positioned */
    width: 20px; /* Smaller star */
    height: 20px; /* Smaller star */
    display: flex;
	align-self: flex-end;
    align-items: center;
    justify-content: center;
    z-index: 2;
    background: transparent;
    border: none;
    box-shadow: none;
    flex-shrink: 0; /* Prevent shrinking */ 
}

.user-type-star .fa-star {
    font-size: 0.9em; /* Smaller star icon */
    color: #28a745;
    z-index: 1;
    filter: drop-shadow(0 1px 2px #a5d6a7);
}

.user-type-letter {
    position: absolute; /* Keep absolute for letter inside star */
    left: 0; top: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.5em; /* Smaller letter */
    color: var(--text-light);
    z-index: 2;
    text-shadow: 0 1px 4px #388e3c, 0 1px 1px #388e3c;
    pointer-events: none;
    font-family: 'Montserrat', Arial, sans-serif;
    letter-spacing: 0.5px;
}

/* Thread Filter Row */
.thread-filter-row {
    display: flex;
    flex-direction: row;
    gap: 0.8rem;
    align-items: flex-end;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.thread-filter-row .filter-group {
    display: flex;
    flex-direction: row;
    min-width: 100px;
}

.thread-filter-row .thread-input {
    min-width: 100px;
    max-width: 160px;
}

/* File Preview for Threads and Comments */
.files-preview {
    margin: 0.3rem 0 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.file-preview {
    background: var(--text-light);
    color: var(--primary-blue);
    border-radius: 0.3rem;
    padding: 0.2rem 0.5rem;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    border: 1px solid var(--primary-blue);
}

.file-preview .remove-file, .file-preview .remove-existing-file {
    color: #dc3545;
    cursor: pointer;
    font-weight: bold;
    margin-left: 0.2rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.7);
    padding-top: 60px;
}

.modal-content {
    background-color: var(--text-light);
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 900px;
    border-radius: 8px;
    box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19);
    position: relative;
    display: flex;
    flex-direction: column;
    height: 80vh;
}

.modal-content h3 {
    text-align: center;
    color: var(--text-dark);
    margin-bottom: 20px;
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    right: 20px;
    top: 10px;
}

.close-button:hover,
.close-button:focus {
    color: var(--text-dark);
    text-decoration: none;
    cursor: pointer;
}

.modal-content .chat-container {
    display: flex;
    flex-grow: 1;
    border: 1px solid var(--border-light);
    border-radius: 5px;
    overflow: hidden;
}

.modal-content .chat-sidebar {
    width: 300px;
    border-right: 1px solid var(--border-light);
    padding: 10px;
    overflow-y: auto;
    flex-shrink: 0;
    background-color: var(--light-gray);
}

.modal-content .chat-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.modal-content .chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px;
    background-color: var(--background-pattern-color);
}

.modal-content .chat-input-container {
    padding: 10px;
    border-top: 1px solid var(--border-light);
    display: flex;
    background-color: var(--text-light);
}

#chat-section.active .chat-container {
    display: none;
}

/* Status Message */
.status-message {
    padding: 8px 12px;
    border-radius: 6px;
    margin: 10px 0;
    font-size: 14px;
    display: none;
}

.status-success {
    background: #d4edda;
    color: #155724;
}

.status-error {
    background: #f8d7da;
    color: #721c24;
}

.loading {
    text-align: center;
    color: #666;
    padding: 20px;
}

.error-message {
    text-align: center;
    color: #dc3545;
    padding: 20px;
}

.no-messages {
    text-align: center;
    color: #666;
    padding: 20px;
    font-style: italic;
}

/* Objective Answer Cards */
.main-content h2 {
    text-align: center;
    margin-bottom: 20px;
    color: var(--dark-blue);
    font-size: 1.5em;
}

.main-content .section-description {
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.1em;
    color: #666;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.card-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: center;
    padding: 20px 0;
}

.feature-card {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    padding: 30px;
    text-align: center;
    flex: 1;
    min-width: 280px;
    max-width: 350px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.feature-card .icon-wrapper {
    background-color: var(--primary-blue);
    color: var(--text-light);
    border-radius: 50%;
    width: 80px;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3em;
    margin-bottom: 25px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.feature-card h3 {
    color: var(--dark-blue);
    margin-bottom: 15px;
    font-size: 1.6em;
}

.feature-card p {
    color: #666;
    font-size: 1em;
    line-height: 1.6;
    margin-bottom: 25px;
    flex-grow: 1;
}

.card-button {
    display: inline-block;
    background-color: var(--primary-blue);
    color: var(--text-light);
    padding: 12px 25px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1em;
    transition: background-color 0.3s ease, transform 0.2s ease;
    border: 2px solid var(--primary-blue);
}

.card-button:hover {
    background-color: var(--dark-blue);
    transform: translateY(-2px);
}

/* Menu Item */
.site-header {
    background-color: var(--primary-blue);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
}

.menu-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.menu-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.menu-left h2 {
    color: whitesmoke;
    font-size: 1.8em;
    font-weight: 900;
    margin: 0;
}

.header-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 20px;
}

.header-nav ul li {
    position: relative;
}

.header-nav ul li a.nav-link {
    color: var(--text-light);
    text-decoration: none;
    font-size: 1.1rem;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background-color 0.3s ease, color 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 5px;
}

.header-nav ul li a.nav-link:hover,
.header-nav ul li a.nav-link:focus {
    background-color: var(--dark-blue);
    color: var(--text-light);
    outline: none;
}

.submenu {
    list-style: none;
    padding: 10px 0;
    margin: 0;
    background-color: var(--dark-blue);
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    border-radius: 0 0 5px 5px;
    z-index: 100;
    display: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
}

.submenu li a.nav-link {
    padding: 10px 20px;
    color: var(--text-light);
    white-space: nowrap;
    display: block;
}

.submenu li a.nav-link:hover {
    background-color: var(--primary-blue);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--text-light);
    border: 1px solid var(--border-light);
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    min-width: 150px;
    display: none;
    z-index: 1001;
}

.user-dropdown a {
    display: block;
    padding: 10px 15px;
    text-decoration: none;
    color: var(--text-dark);
    white-space: nowrap;
}

.user-dropdown a:hover {
    background-color: var(--light-gray);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--text-light);
}

.no-friends-message {
    text-align: center;
    padding: 30px 20px;
    color: #666;
    font-size: 1.1em;
    font-style: italic;
    background-color: var(--light-gray);
    border: 1px dashed #ddd;
    border-radius: 8px;
    margin-top: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    min-height: 150px;
    box-sizing: border-box;
    grid-column: 1 / -1;
}

.no-friends-message .suggestion {
    font-size: 0.9em;
    color: #888;
    margin-top: 10px;
}

.no-friends-message:hover {
    border-color: var(--primary-blue);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.no-friends-message .icon {
    font-size: 3.5em;
    color: var(--primary-blue);
    margin-bottom: 15px;
}

.no-friends-message p {
    margin: 0;
    line-height: 1.6;
}

.no-friends-message a {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: bold;
    margin-top: 15px;
    padding: 8px 15px;
    border: 1px solid var(--primary-blue);
    border-radius: 5px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.no-friends-message a:hover {
    background-color: var(--primary-blue);
    color: var(--text-light);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    /* General */
    body {
        font-size: 14px;
    }

    .navbar {
        padding: 8px 15px;
        gap: 5px;
    }

    .logo-img {
        height: 50px;
    }

    .site-title {
        font-size: 24px;
    }

    .site-slogan {
        font-size: 0.65rem;
    }

    .auth-buttons .btn {
        padding: 8px 15px;
        margin: 5px;
        font-size: 0.9rem;
    }

    .main-content {
        margin: 70px 10px 10px 10px;
        padding: 15px;
        width: calc(100% - 20px);
    }

    .user-avatar-initials {
        width: 36px;
        height: 36px;
        font-size: 1.2em;
    }

    .sidebar {
        width: 200px;
        left: -200px;
        padding-top: 60px;
    }

    .sidebar ul li a.nav-link {
        padding: 10px 15px;
        font-size: 0.9rem;
    }

    .sidebar .has-submenu .submenu {
        display: none;
        position: relative;
        left: 0;
        min-width: 100%;
        background-color: var(--dark-blue);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        border-radius: 0 0 5px 5px;
        opacity: 0;
        visibility: hidden;
        transform: translateY(10px);
        transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    }

    .sidebar .has-submenu:hover > .submenu {
        display: block;
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .sidebar li ul {
        list-style: none;
        padding-left: 20px;
    }

    .sidebar li.expanded > ul {
        display: block;
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    input[type="text"],
    input[type="email"],
    input[type="password"],
    textarea,
    select {
        font-size: 14px;
        padding: 8px;
    }

    input[type="submit"],
    button {
        padding: 10px;
        font-size: 0.9rem;
    }

    .rating-section {
        padding: 8px;
    }

    .rating-section select,
    .rating-section button {
        padding: 5px 8px;
        font-size: 0.9rem;
    }

    .header-nav {
        display: none;
    }

    .menu-toggle {
        display: block;
        font-size: 1.8rem;
        margin-right: 10px;
    }

    .sidebar {
        display: block;
    }

    .login-container,
    .register-container {
        max-width: 90%;
        padding: 20px;
        margin: 70px auto;
    }

    .login-container h2,
    .register-container h2 {
        font-size: 1.4em;
    }

    .community-container {
        padding: 15px;
    }

    .section-tabs {
        display: flex;
        flex-direction: row;
        gap: 5px;
    }
    .section-box.active {
        display:flex;
        flex-direction:column;
        align-items: stretch;
        gap: 3px;
        min-width:220px;
    }
    .tab {
        flex: 1;
        text-align: center;
        padding: 10px 15px;
        font-size: 0.9rem;
    }

    .users-columns {
        flex-direction: column;
    }

    .users-column {
        max-height: none;
    }

    .grid-container {
        grid-template-columns: 1fr; /* Single column on small screens */
        gap: 8px; /* Reduced gap */
        padding: 0; /* No padding */
    }

    .friend-card {
        padding: 6px 8px; /* Even smaller padding */
    }

    .friend-avatar-compact {
        width: 30px; /* Even smaller avatar */
        height: 30px;
    }

    .username-compact {
        font-size: 0.85em; /* Even smaller font */
    }

    .user-address-compact {
        font-size: 0.65em; /* Even smaller font */
    }

    .add-friend-compact,
	.request-sent-compact,
    .friend-action-icon {
        width: 26px; /* Smaller buttons */
        height: 26px;
        font-size: 0.8em; /* Smaller icon */
    }

    .notif-grid {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        margin: 1.5rem 0.5rem;
    }

    .notif-card {
        min-width: 90vw;
        max-width: 95vw;
        padding: 1rem;
    }

    .notif-title {
        font-size: 1em;
    }

    .notif-list li {
        font-size: 0.85em;
    }

    .notif-link {
        font-size: 0.9em;
    }

    .forum-container {
        grid-template-columns: 2fr;
        gap: 20px;
        padding: 15px 0;
    }

    .thread-form-column,
    .threads-column {
        width: 100%;
        max-width: none;
    }

    .thread-form-column {
        padding: 15px;
    }

    .thread-input,
    .thread-textarea {
        font-size: 0.95em;
        padding: 8px 12px;
    }

    .btn-post {
        padding: 8px 15px;
        font-size: 0.9em;
    }

    .thread-card {
        padding: 15px;
    }

    .thread-title {
        font-size: 1.2em;
    }

    .thread-body,
    .comment-body {
        font-size: 0.95em;
    }

    .thread-avatar {
        width: 30px;
        height: 30px;
    }

    .thread-btn {
        font-size: 0.8em;
    }

    .thread-comments {
        margin-left: 1rem;
    }

    .thread-filter-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .thread-filter-row .filter-group,
    .thread-filter-row .thread-input {
        max-width: 100%;
        min-width: 0;
    }

    .comment-card {
        padding: 12px;
        font-size: 0.9em;
    }

    .comment-avatar {
        width: 24px;
        height: 24px;
    }

    .comment-textarea {
        font-size: 0.85em;
    }

    .modal-content {
        width: 95%;
        margin: 2.5% auto;
        height: 90vh;
        padding: 15px;
    }

    .modal-content .chat-sidebar {
        width: 100%;
    }

    .modal-content .chat-container.mobile-chat-active .chat-sidebar {
        display: none;
    }

    .modal-content .chat-main {
        display: flex;
        flex-grow: 1;
    }

    .modal-content .chat-messages {
        padding: 8px;
    }

    .modal-content .chat-input-container {
        padding: 8px;
    }

    .chat-friend-list .chat-friend-card {
        padding: 6px 8px;
    }

    .chat-friend-list .chat-friend-card .friend-avatar {
        width: 30px;
        height: 30px;
    }

    .chat-main .chat-header .friend-avatar {
        width: 32px;
        height: 32px;
    }

    .chat-main .chat-header h4 {
        font-size: 1em;
    }

    .chat-input {
        font-size: 14px;
    }

    .chat-send-btn {
        width: 36px;
        height: 36px;
    }

    .advanced-search-bar {
        flex-direction: row;
        gap: 0.5rem;
        align-items: stretch;
    }

    .advanced-search-bar .search-bar,
    .advanced-search-bar select {
        width: 100%;
        min-width: 0;
        font-size: 0.65em;
    }

    .card-container {
        flex-direction: column;
        align-items: center;
    }

    .feature-card {
        padding: 15px;
        min-width: 90%;
    }

    .feature-card .icon-wrapper {
        width: 60px;
        height: 60px;
        font-size: 2em;
    }

    .feature-card h3 {
        font-size: 1.3em;
    }

    .feature-card p {
        font-size: 0.9em;
    }

    .card-button {
        padding: 8px 16px;
        font-size: 0.85em;
    }

    .no-friends-message {
        padding: 15px;
        font-size: 0.9em;
        min-height: 100px;
    }

    .no-friends-message .icon {
        font-size: 2.5em;
    }
}

@media (min-width: 769px) and (max-width: 992px) {
    /* Tablet Adjustments */
    body {
        font-size: 15px;
    }

    .navbar {
        padding: 10px 15px;
    }

    .logo-img {
        height: 60px;
    }

    .site-title {
        font-size: 28px;
    }

    .site-slogan {
        font-size: 0.7rem;
    }

    .auth-buttons .btn {
        padding: 8px 16px;
        font-size: 0.95rem;
    }

    .main-content {
        margin: 75px 15px 15px 15px;
        padding: 18px;
        width: calc(100% - 30px);
    }

    .user-avatar-initials {
        width: 40px;
        height: 40px;
        font-size: 1.3em;
    }

    .sidebar {
        width: 200px;
        left: -200px;
    }

    .sidebar ul li a.nav-link {
        padding: 12px 15px;
        font-size: 0.95rem;
    }

    .sidebar .has-submenu .submenu {
        display: none;
        position: relative;
        left: 0;
        min-width: 100%;
        background-color: var(--dark-blue);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        border-radius: 0 0 5px 5px;
        opacity: 0;
        visibility: hidden;
        transform: translateY(10px);
        transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    }

    .sidebar .has-submenu:hover > .submenu {
        display: block;
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .sidebar li ul {
        list-style: none;
        padding-left: 20px;
    }

    .sidebar li.expanded > ul {
        display: block;
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    input[type="text"],
    input[type="email"],
    input[type="password"],
    textarea,
    select {
        font-size: 15px;
        padding: 9px;
    }

    input[type="submit"],
    button {
        padding: 11px;
        font-size: 0.95rem;
    }

    .rating-section {
        padding: 9px;
    }

    .rating-section select,
    .rating-section button {
        padding: 6px 9px;
        font-size: 0.95rem;
    }

    .login-container,
    .register-container {
        max-width: 600px;
        padding: 25px;
    }

    .login-container h2,
    .register-container h2 {
        font-size: 1.6em;
    }

    .community-container {
        padding: 20px;
    }

    .section-tabs {
        display: flex;
        flex-direction: row;
        gap: 6px;
    }

    .tab {
        padding: 10px 18px;
        font-size: 0.95rem;
    }

    .users-columns {
        flex-direction: row;
        gap: 15px;
    }

    .users-column {
        max-height: 400px;
    }

    .grid-container {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); /* Adjusted for tablets */
    }

    .friend-card {
        padding: 10px; /* Slightly more padding than mobile */
    }

    .friend-avatar-compact {
        width: 32px; /* Adjusted avatar size */
        height: 32px;
    }

    .username-compact {
        font-size: 0.9em; /* Adjusted font size */
    }

    .user-address-compact {
        font-size: 0.7em; /* Adjusted font size */
    }

    .add-friend-compact,
	.request-sent-compact,
    .friend-action-icon {
        width: 28px; /* Adjusted button size */
        height: 28px;
        font-size: 0.85em; /* Adjusted icon size */
    }

    .notif-grid {
        gap: 1.2rem;
    }

    .notif-card {
        min-width: 250px;
        max-width: 320px;
        padding: 1.2rem;
    }

    .notif-title {
        font-size: 1.05em;
    }

    .notif-list li {
        font-size: 0.9em;
    }

    .notif-link {
        font-size: 0.95em;
    }

    .forum-container {
        grid-template-columns: 1fr 1fr;
        gap: 25px;
    }

    .thread-form-column {
        padding: 20px;
    }

    .thread-input,
    .thread-textarea {
        font-size: 0.95em;
    }

    .btn-post {
        padding: 9px 18px;
        font-size: 0.95em;
    }

    .thread-card {
        padding: 18px;
    }

    .thread-title {
        font-size: 1.3em;
    }

    .thread-body {
        font-size: 0.95em;
    }

    .thread-avatar {
        width: 35px;
        height: 35px;
    }

    .thread-btn {
        font-size: 0.85em;
    }

    .comment-card {
        padding: 14px;
        font-size: 0.95em;
    }

    .comment-avatar {
        width: 28px;
        height: 28px;
    }

    .comment-textarea {
        font-size: 0.9em;
    }

    .modal-content {
        width: 90%;
        max-width: 800px;
        padding: 18px;
    }

    .modal-content .chat-sidebar {
        width: 250px;
    }

    .modal-content .chat-messages {
        padding: 9px;
    }

    .modal-content .chat-input-container {
        padding: 9px;
    }

    .chat-friend-list .chat-friend-card {
        padding: 7px 9px;
    }

    .chat-friend-list .chat-friend-card .friend-avatar {
        width: 32px;
        height: 32px;
    }

    .chat-main .chat-header .friend-avatar {
        width: 35px;
        height: 35px;
    }

    .chat-main .chat-header h4 {
        font-size: 0.95em;
    }

    .chat-input {
        font-size: 15px;
    }

    .chat-send-btn {
        width: 38px;
        height: 38px;
    }

    .card-container {
        gap: 25px;
    }

    .feature-card {
        min-width: 250px;
        max-width: 300px;
        padding: 25px;
    }

    .feature-card .icon-wrapper {
        width: 75px;
        height: 75px;
        font-size: 2.8em;
    }

    .feature-card h3 {
        font-size: 1.5em;
    }

    .feature-card p {
        font-size: 0.95em;
    }

    .card-button {
        padding: 11px 22px;
        font-size: 0.95em;
    }

    .no-friends-message {
        padding: 25px;
        font-size: 1em;
        min-height: 140px;
    }

    .no-friends-message .icon {
        font-size: 3.2em;
    }
}

@media (min-width: 769px) {
    .site-header .menu-toggle {
        display: none;
    }

    .header-nav {
        display: flex;
    }

    .sidebar {
        display: none !important;
        left: -9999px;
    }

    .has-submenu:hover > .submenu {
        display: block;
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
}
