/* ==========================================================================
   1. GLOBAL & RESET STYLES
   ========================================================================== */
* {
    margin: 0;
    box-sizing: border-box;
    font-family: sans-serif;

}

body {
    background-color: #FBFBFB;
    font-family: sans-serif;
}


/* ==========================================================================
   2. LAYOUT CONTAINERS
   ========================================================================== */
.home-container {
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: 24px;
    padding: 0px;
    max-width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

.left-sidebar {
    background-color: #f9fafb;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    max-width: 100%;
}


.profile-container {
    display: flex;
    gap: 20px;
    height: 280vh;
}

.room-container {
    display: flex;
    gap: 20px;
    padding: 20px;
    max-width: 100%;
    flex-wrap: wrap;
    /* ⬅️ Ensures children wrap on small screens */
    box-sizing: border-box;
    height: 100vh;
}

.room-container main {
    flex: 3.0;
    min-width: 0;
    height: 100%;

}



.room-top {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.room-title {
    font-size: 50px;
    font-weight: bold;
    margin-right: 10px;

}

.room-title-edit {
    font-size: 30px;
}



.center-container {
    display: flex;
    justify-content: center;
    /* Center the search form */
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

/* ==========================================================================
   3. NAVIGATION BAR
   ========================================================================== */
.navbar-cus {
    background: #eaeaedff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0px;
}

.navbar-cus .container {
    padding-top: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.navbar-brand {
    font-size: 16px;
    text-decoration: none;
    color: grey;
    font-weight: 500;
    letter-spacing: 5px;
}

.navbar-brand:hover {
    font-weight: 600;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 15px;
}

.nav-item-to-edit {
    display: inline;
    margin-top: 10px;
}

.nav-links .nav-item-to-edit a {
    text-decoration: none;
    color: white;
    padding: 8px 12px;
    transition: font-weight 0.2s ease;
}

.nav-links .nav-item-to-edit a:hover {
    font-weight: bold;
}

.nav-user-name {
    display: inline;
    margin-top: 10px;
}

.nav-user-name a {
    text-decoration: none;
    color: white;
    transition: color 0.3s ease;
}

.nav-user-name a:hover {
    color: rgb(76, 76, 233);
    font-weight: bold;
}

#username-link {
    color: rgb(76, 76, 233);
    text-decoration: none;
}

.navbar-profile-pic {
    width: 40px;
    height: 40px;
    border-radius: 100%;
    object-fit: cover;
    margin-top: 5px;
    border: 3px solid #ddd;
    transition: transform 0.3s ease-in-out;
}

.navbar-profile-pic:hover {
    transform: scale(1.2);
}

#nav-logout-button {
    /* Specific to logout button in navbar */
    margin-top: 5px;
}

.menu-toggle {
    display: none;
    font-size: 1.5rem;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
}



/* ==========================================================================
   4. SIDEBARS & LISTS (Topics, Activity, Participants)
   ========================================================================== */

.topic-box {
    margin: 5px 2px 5px 12px;
    padding: 5px 10px 5px 10px;
    text-align: left;
    border-radius: 5px;
    transition: 0.25s;
}

.topic-box:hover {
    background: #dadde2;
}

.topic-box a {
    text-decoration: none;
    color: black;
    font-weight: 300;
}


.topic-container .headings {
    display: none;
}

/* --- Activity Feed & Related --- */
.activity-container {
    position: relative;
    height: 95%;
    overflow-y: auto;
    padding: 0px 10px 20px 10px;
    margin-top: 10px;
    margin-right: 6px;
    border-style: inset;
    border-radius: 15px;
    border-color: black;

}

.activity-box {
    background-color: #f6f7f8;
    padding: 5px 10px 10px 10px;
    margin-top: 3px;
    margin-bottom: 3px;
    border-style: groove;
    border-color: black;
}



.activity-box-option {
    display: flex;
    justify-content: space-between;
}

/* --- Participants List --- */
.toggle-participants-btn {
    display: none;
    background: #6366f1;
    color: white;
    border: none;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    cursor: pointer;
}

.toggle-participants-btn:hover {
    background: #4f46e5;
}



.participants-list li {
    padding: 5px;
    background: #6366f1;
    color: white;
    margin-bottom: 5px;
    border-radius: 5px;
    text-align: center;
    overflow: hidden;
    transition: 0.2s;
    position: relative;
}

.li-wrapper {
    overflow: hidden;
    /* Contains the scale effect */
}

.participants-list li::after {
    display: block;
    background: black;
    height: 5px;
    width: 6px;
    position: absolute;
    top: 0;
}

.participants-list li:hover {
    transform: scale(1.06);
    box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.09);
    background: #3336ee;

}

.participants-list a {
    text-decoration: none;
    color: white;
}

.participants-container {
    height: 700px;
    overflow-y: auto;
    padding: 20px 10px;
    margin-left: 6px;
    margin-right: 6px;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
    border-radius: 15px;
    background-color: #F7F9F7;
    list-style: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0.7;
}

.participants-scroll-wrapper {
    overflow-x: auto;
    max-width: 100%;
    white-space: nowrap;
}

.participants-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0;
    margin: 0;
    list-style: none;
}



/* --- General Headings --- */
.sticky-header .headings {
    font-weight: 500;
    font-size: 22px;
    position: sticky;
    top: 0;
    /* ✅ this is the critical fix */
    z-index: 10;
    background-color: white;
    /* ✅ ensure it's not transparent */
    margin: 0px;
    padding: 4px;

}

.headings a {
    color: black;
    text-decoration: none;
    transition: color 0.3s ease;
}

.sticky-header {
    position: sticky;
    top: 0;
    background-color: white;
    z-index: 10;
    display: flex;
    justify-content: center;
    padding: 10px;
}

.headings a:visited {
    color: black;
}


/* ==========================================================================
   5. MAIN FEED & ROOM CONTENT
   ========================================================================== */
.main-feed {
    background-color: #ffffff;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);

    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.room-box {
    padding: 30px;
    margin-top: 10px;
    margin-bottom: 10px;
    border: none;
    border-radius: 10px;
    background: #f6f7f8;

    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}


.room-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    border-color: #6366f1;
    /* Changes border to blue on hover */
}

/* The colored top bar that appears on hover */
.room-box::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #6366f1, #06b6d4);
    transform: scaleX(0);
    transition: transform 0.25s ease;
}

.room-box:hover::after {
    transform: scaleX(1);
}

.room-box small {
    font-size: 12px;
}

.room-desc {
    font-size: 14px;
}

/* --- Tags & Badges --- */

.host-span,
.user-name,
.topics,
.topic-component {
    display: inline-block;
    margin-right: 5px;
    margin-bottom: 5px;
}

.host-span {
    padding: 5px 8px;
    background: black;
    color: white;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 400;
}

.user-name {
    text-decoration: none;
    padding: 5px 8px;
    background: #dadde2;
    color: black;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 400;
    transition: 0.3s;
}

.user-name:active,
.user-name:hover {
    color: red;
}

.topics {
    padding: 5px 8px;
    background: black;
    color: white;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 400;
}

.topic-component {
    padding: 5px 8px;
    background: #dadde2;
    color: black;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 300;
}

.topic-list-container {
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    gap: 8px;
    max-width: 100%;
    padding-bottom: 4px;

}


/* ==========================================================================
   6. SEARCH COMPONENT
   ========================================================================== */
/* input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
    -webkit-appearance: none;
    display: none;
} */

.search-form {
    display: flex;
    width: 100%;
    max-width: 400px;
}

.search-box {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem 0 0 0.5rem;
    outline: none;
    font-size: 1rem;
}

.search-button {
    padding: 0.5rem 1rem;
    background-color: #6366f1;
    color: white;
    border: none;
    border-radius: 0 0.5rem 0.5rem 0;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.search-button:hover {
    background-color: #4f46e5;
}

.search-result {
    display: flex;
    justify-content: center;
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 1rem;
}




/* ==========================================================================
   7. AUTHENTICATION BUTTONS (Login, Logout, Signup)
   ========================================================================== */
.logout-button {
    background-color: #dc3545;
    color: white;
    margin-right: 8px;
    padding: 5px 10px;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.logout-button:hover {
    background-color: #b02a37;
}

.login-button {
    background-color: #007bff;
    color: white;
    margin-right: 8px;
    padding: 5px 10px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.login-button:hover {
    background-color: #0056b3;
    transform: scale(1.05);
}

.login-button:active {
    background-color: #004494;
    transform: scale(0.98);
}

.signup-button {
    background-color: #28a745;
    color: white;
    padding: 5px 10px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.signup-button:hover {
    background-color: #218838;
    transform: scale(1.05);
}

.signup-button:active {
    background-color: #1e7e34;
    transform: scale(0.98);
}

/* ==========================================================================
   8. FORMS & INPUTS (Login, Signup, Create Room)
   ========================================================================== */

/* --- Login Form --- */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.login-box {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    text-align: center;
    width: 300px;
}

.login-box input {
    width: 100%;
    padding: 8px;
    margin: 5px 0;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.login-box button {
    width: 30%;
    padding: 10px;
    background-color: #3787b3;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-bottom: 5px;
}

.login-box button:hover {
    background-color: #286d8a;
}

/* --- Signup Form --- */
.signup-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: 20px;
}

.signup-box {
    background: #f9fafb;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    text-align: center;
    width: 800px;
}

.signup-box input {
    width: 60%;
    padding: 8px;
    margin: 5px 0;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.signup-box .helptext {
    display: block;
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.signup-box button {
    width: 10%;
    padding: 10px;
    background-color: #3787b3;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 8%;
    margin-bottom: 8%;
}

.signup-box button:hover {
    background-color: #286d8a;
}

/* --- Create Room Form --- */
.create-room-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #f4f4f4;
}

.create-room-box {
    width: 50%;
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.create-room-box h2 {
    margin-bottom: 20px;
    color: #333;
}

.create-room-box button {
    width: auto;
    background-color: #007bff;
    color: white;
    padding: 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
}

.create-room-box button:hover {
    background-color: #0056b3;
}

.create-room-box div {
    text-align: left;
    margin-bottom: 10px;
}

/* --- General Form Elements --- */
.form-label {
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
    text-align: left;
}

.form-control {
    width: 100%;
    padding: 6px;
    margin-bottom: 15px;
    border: 1px solid #161414;
    border-radius: 5px;
    background: #f9f9f9;
}

.scrollable-dropdown {
    max-height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
    width: 100%;
}

.dropdown-toggle {
    width: 100%;
}

.topic-checkbox {
    border-color: black;
}

/* ==========================================================================
   9. MESSAGE AREA
   ========================================================================== */
.message-container {
    display: flex;
    flex-direction: column;
    border-style: ridge;
    margin-bottom: 10px;
    padding: 10px 20px 10px 20px;
    height: 100%;
}

.message-container-top {
    flex: 5;
    height: 80%;
    overflow-y: auto;
    margin-bottom: 10px;
}

.message-container-bottom {
    flex: 0.5;
    margin-bottom: 10px;
    padding: 10px 0px 10px 0px;
}

.message-input {
    width: 80%;
    padding: 8px;
    margin-right: 5px;
    margin-left: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
}


.message-send-button {
    background-color: #3430a7;
    color: white;
    height: 40px;
    border-radius: 20px;
    width: 70px;
}


.message-box-self {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 10px;
    border-radius: 8px;
    background: #ede9e9;
    margin-bottom: 10px;
    position: relative;
    width: 80%;
    max-width: 800px;
    word-wrap: break-word;
    float: right;
    clear: both;
}

.message-box-other {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 10px;
    border-radius: 8px;
    background: #ede9e9;
    margin-bottom: 10px;
    position: relative;
    width: 80%;
    max-width: 800px;
    word-wrap: break-word;
    float: left;
    clear: both;
}

.message-content {
    /* Contains the actual message text */
    width: 70%;
    max-width: 800px;
    word-wrap: break-word;
}

.message-text {
    color: rgb(18, 17, 17);
    font-size: larger;
}

.message-time {
    font-size: 13px;
    text-align: right;
}


.delete-icon {
    position: relative;
    cursor: pointer;
    color: red;
    margin-left: 5px;
    border-style: none;
}

.edit-icon {
    border-style: none;
    color: blue;
}

.message-line {
    display: flex;
    justify-content: space-between;
    align-items: end;
}

.modify-div-container {
    display: flex;
    justify-content: right;
    align-items: end;
}

.message-title {
    color: blue;
    line-height: 20px;
}

.deleted-or-edited-message {
    color: #656262;
    font-style: italic;
    margin: 0;
}

.login-from-room {
    /* Prompt if user needs to login to post message */
    display: flex;
    font-size: larger;
    font-weight: bold;
    justify-content: center;
}


/* ==========================================================================
   10. MODALS (Delete Confirmation, Message Update)
   ========================================================================== */

/* --- Delete Confirmation Modal --- */
.delete-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 50vh;
    width: 50vw;
    border-style: groove;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.delete-box {
    justify-content: center;
    margin: 15px 10px 15px 10px;
}

.delete-option {
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: 80%;
}

/* --- Message Update Modal --- */
.message-update-container {
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
    height: 55vh;
    width: 50vw;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-style: groove;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    padding-top: 3%;
}

.msg-update-btn {
    background-color: #007bff;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s ease-in-out;
    margin: 2% 50% 5% 33%;
}

.update-btn:hover {
    /* Typo in original, likely meant .msg-update-btn:hover */
    background-color: #0056b3;
}


/* ==========================================================================
   11. PAGINATION
   ========================================================================== */

/* .number-pages {
  padding: 5px 8px;
  background: #dadde2;
  color: black;
  border-radius: 5px;
  font-size: 14px;
  font-weight: 300;
} */

.pagination-option {
    display: flex;
    justify-content: center;
    gap: 5px;
}

.pagination-option>* {
    text-decoration: none;
    padding: 5px 8px;
    background: #dadde2;
    color: black;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 400;
    transition: 0.1s;
}

.pagination-option a {
    text-decoration: none;
}

.pagination-option *:hover {
    background: grey;
    color: white;
}

.number-pages {
    background: #a3a3c2;
}

.number-pages:hover {
    background: #7575a3;

}


/*
.pagination-option > * { /* Applies to both 'a' and 'span' (like .number-pages) */
/* padding: 10px;
} */

/* ==========================================================================
   12. PROFILE PAGE
   ========================================================================== */
.profile-detail-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 10%;
}

.profile-pic {
    width: 200;
    height: 200px;
    border-radius: 51%;
    object-fit: cover;
    border: 3px solid #ddd;
    display: block;
}

/* ==========================================================================
   13. MISCELLANEOUS / UTILITIES
   ========================================================================== */
.Admin:hover {
    /* Style for admin users, perhaps on their username */
    color: lightgreen;
}





/* ==========================================================================
   FIXED & RESPONSIVE NAVIGATION
   ========================================================================== */

.navbar-cus {
    background: #ffffff;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid #e2e8f0;
}

.navbar-cus .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: #6366f1;
    text-decoration: none;
    letter-spacing: -0.025em;
    transition: all 0.15s ease-in-out;
}

.navbar-brand:hover {
    color: #4f46e5;
    transform: translateY(-1px);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item-to-edit {
    display: flex;
    align-items: center;
}

.nav-links .nav-item-to-edit a {
    color: #64748b;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.15s ease-in-out;
    position: relative;
}

.nav-links .nav-item-to-edit a:hover {
    color: #6366f1;
    background: #e0e7ff;
}

.nav-user-name {
    display: flex;
    align-items: center;
}

.nav-user-name a {
    color: #374151;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.15s ease-in-out;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
}

.nav-user-name a:hover {
    color: #6366f1;
    background: #e0e7ff;
}

#username-link {
    color: #6366f1;
    text-decoration: none;
    font-weight: 600;
}

.navbar-profile-pic {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e2e8f0;
    transition: all 0.25s ease-in-out;
    cursor: pointer;
    margin-left: 0.5rem;
}

.navbar-profile-pic:hover {
    transform: scale(1.1);
    border-color: #6366f1;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

/* Fixed logout button positioning */
#nav-logout-button {
    margin: 0;
}

.logout-button {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    font-size: 0.875rem;
}

.logout-button:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

.auth-buttons {
    display: flex;
    align-items: center;
    border: 1px solid #6366f1;
    border-radius: 0.5rem;
    overflow: hidden;
}

.auth-buttons a {
    padding: 0.5rem 1.25rem;
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    transition: all 0.15s ease-in-out;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
}

.login-button {
    background: white;
    color: #6366f1;
}

.login-button:hover {
    background: #f0f4ff;
}

.signup-button {
    background: #6366f1;
    color: white;
}

.signup-button:hover {
    background: #4f46e5;
}




/* Mobile menu toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #64748b;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.15s ease-in-out;
}

.menu-toggle:hover {
    background: #f1f5f9;
    color: #374151;
}

/* Mobile Responsive Styles */

/* ==========================================================================
   RESPONSIVE NAVIGATION
   ========================================================================== */


/* ==========================================================================
   FIXED SIDE NAVIGATION (TOPIC LIST)
   ========================================================================== */

.topic-container {
    background: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    padding: 0px 7px;
    height: 100%;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    position: sticky;
    top: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;

    box-sizing: border-box;
    max-width: 100%;
}

.topic-container::-webkit-scrollbar {
    width: 6px;
}

.topic-container::-webkit-scrollbar-track {
    background: transparent;
}



/* Show the headings now */
.topic-container .headings {
    display: block;
    margin-bottom: 1.5rem;
    color: #1e293b;
    font-size: 1.25rem;
    font-weight: 700;
    padding: 0.75rem;
    border-bottom: 2px solid #e2e8f0;
    top: 0;
    z-index: 10;
    background-color: white;
    margin: 0px;
    position: sticky;
}

.topic-container .headings a {
    color: #1e293b;
    text-decoration: none;
    transition: all 0.15s ease-in-out;
}

.topic-container .headings a:hover {
    color: #6366f1;
}

.topic-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}



.topic-box {
    margin: 0;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    transition: all 0.25s ease-in-out;
    cursor: pointer;
    border: 1px solid transparent;
    position: relative;
}

.topic-box:hover {
    background: #f1f5f9;
    transform: translateX(4px);
    border-color: #e2e8f0;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
}

.topic-box a {
    color: #475569;
    text-decoration: none;
    font-weight: 500;
    display: block;
    font-size: 0.95rem;
    line-height: 1.4;
    transition: all 0.15s ease-in-out;
}

.topic-box:hover a {
    color: #6366f1;
    font-weight: 600;
}

/* Active/selected topic styling */
.topic-box.active {
    background: #e0e7ff;
    border-color: #6366f1;
    transform: translateX(4px);
}

.topic-box.active a {
    color: #6366f1;
    font-weight: 600;
}

/* Add a subtle left border indicator */
.topic-box::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: #6366f1;
    border-radius: 0 2px 2px 0;
    transition: height 0.25s ease-in-out;
}

.topic-box:hover::before,
.topic-box.active::before {
    height: 60%;
}

/* Search integration if you have search in topics */
.topic-search {
    margin-bottom: 1rem;
    position: relative;
}

.topic-search input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    outline: none;
    transition: all 0.15s ease-in-out;
    background: #f8fafc;
}

.topic-search input:focus {
    border-color: #6366f1;
    background: #ffffff;
    box-shadow: 0 0 0 3px #e0e7ff;
}

.topic-search input::placeholder {
    color: #94a3b8;
}

/* Topic count badge */
.topic-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e2e8f0;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    margin-left: auto;
    min-width: 1.5rem;
    height: 1.5rem;
    transition: all 0.15s ease-in-out;
}

.topic-box:hover .topic-count {
    background: #6366f1;
    color: white;
}




/* ==========================================================================
   FIXED SEARCH COMPONENT (targeted specifically)
   ========================================================================== */

/* Remove webkit search styling */
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
    -webkit-appearance: none;
    display: none;
}

/* Target only forms that contain search-box */
form:has(.search-box) {
    display: flex;
    align-items: stretch;
    /* Makes both elements same height */
    width: fit-content;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    border-radius: 0.75rem;
    overflow: hidden;
    /* Ensures clean corners */
}

/* Alternative if :has() isn't supported - use a class */
.search-form {
    display: flex;
    align-items: stretch;
    width: fit-content;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    border-radius: 0.75rem;
    overflow: hidden;
    margin-top: 10px;
}

.search-box {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-right: none;
    /* Remove right border to connect with button */
    border-radius: 0.75rem 0 0 0.75rem;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    width: 280px;
    height: 48px;
    /* Fixed height */
    outline: none;
    transition: all 0.15s ease-in-out;
    font-family: inherit;
    box-sizing: border-box;
    margin: 0;
    /* Remove any default margins */
}

.search-box:focus {
    border-color: #6366f1;
}

.search-box::placeholder {
    color: #94a3b8;
}

.search-button {
    background: #6366f1;
    color: white;
    border: 2px solid #6366f1;
    border-left: none;
    /* Remove left border to connect with input */
    border-radius: 0 0.75rem 0.75rem 0;
    padding: 0 1.25rem;
    cursor: pointer;
    font-size: 1rem;
    height: 48px;
    /* Same fixed height as input */
    transition: all 0.15s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    margin: 0;
    /* Remove any default margins */
}

.search-button:hover {
    background: #4f46e5;
    border-color: #4f46e5;
}

.search-button:active {
    transform: scale(0.98);
}

.search-button i {
    font-size: 1rem;
}

/* Focus state for search forms only */
form:has(.search-box):focus-within,
.search-form:focus-within {
    box-shadow: 0 0 0 3px #e0e7ff, 0 1px 3px 0 rgb(0 0 0 / 0.1);
}

/* Modal container */
.modal {
    display: none;
    position: fixed;
    z-index: 999;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

/* Modal content box */
.modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 20px;
    border-radius: 10px;
    width: 80%;
    max-width: 600px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* Close button */
.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.mobile-nav {
    display: none;
    margin-bottom: 1rem;
    gap: 0.5rem;
}

.main-feed-profile {
    margin-top: 8%;
    margin-bottom: 5%;
    height: 90%;
    width: 70%;
}

.profile-for-other {
    padding: 5px;

}

.right-sidebar-profile {
    height: 100%;
    width: 30%;
}

/* Responsive adjustments */


@media (max-width: 768px) {
    .navbar-cus .container {
        padding: 0.75rem 1rem;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        border-top: 1px solid #e2e8f0;
        box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
        flex-direction: column;
        padding: 1rem;
        gap: 0.5rem;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links .nav-item-to-edit,
    .nav-user-name {
        width: 100%;
    }

    .nav-links .nav-item-to-edit a,
    .nav-user-name a {
        width: 100%;
        text-align: center;
        padding: 0.75rem 1rem;
    }

    .navbar-profile-pic {
        width: 32px;
        height: 32px;
        margin-left: 0.25rem;
    }

    .menu-toggle {
        display: block;
    }

    .login-button,
    .signup-button {
        width: 100%;
        margin: 0.25rem 0;
        justify-content: center;
    }

    .logout-button {
        width: 100%;
        margin: 0.25rem 0;
    }
}

@media (max-width: 480px) {
    .navbar-brand {
        font-size: 1.25rem;
    }

    .navbar-cus .container {
        padding: 0.5rem 0.75rem;
    }

    .navbar-profile-pic {
        width: 28px;
        height: 28px;
    }
}



@media (max-width: 768px) {

    form:has(.search-box),
    .search-form {
        width: 100%;
        max-width: 100%;
    }

    .search-box {
        width: 100%;
        flex: 1;
        min-width: 0;
    }

    .search-button {
        padding: 0 1rem;
        min-width: 60px;
        flex-shrink: 0;
    }
}

@media (max-width: 480px) {
    .search-box {
        font-size: 0.875rem;
        padding: 0.625rem 0.875rem;
    }

    .search-button {
        font-size: 0.875rem;
    }

    .search-button i {
        font-size: 0.875rem;
    }
}

@media (max-width:798px) {
    .message-container-bottom {
        flex-direction: row;
        padding: 1rem;
    }

    .message-input {
        width: 70%;
    }

    .message-send-button {
        width: 20%;
    }
}

@media (max-width:786px) {

    .room-title {
        font-size: 30px;

    }

    .room-title {
        width: 70%;
    }

    .join-leave-button {
        width: 20%;
    }

    .room-title-edit {
        font-size: 15px;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        flex-direction: column;
        gap: 10px;
        position: absolute;
        background: #333;
        width: 100%;
        left: 0;
        top: 50px;
        padding: 10px;
    }

    .nav-links.active {
        display: flex;
    }

    .menu-toggle {
        display: block;
    }
}


@media (max-width: 768px) {
    .room-container {
        flex-direction: column;
        padding: 1rem;
    }

    .room-container main {
        height: 60%;
    }

    .participants-container {
        height: 15%;
        width: 100%;
        gap: 1rem;
        display: none;

        .participants-container ul {

            flex-direction: row;
            overflow-x: auto;
        }

        .participants-list {
            flex-direction: row;
        }

        .participants-scroll-wrapper {
            overflow-x: auto;
            white-space: nowrap;
        }


    }
}

@media (max-width: 768px) {
    .home-container {
        display: block;
        max-width: 100%;
        overflow-x: hidden;
    }

    .left-sidebar,
    .main-feed {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .search-form {
        display: flex;
        width: 100%;
        max-width: 100%;
    }

}

@media (max-width: 500px) {
    .auth-buttons {
        flex-direction: column;
        width: 100%;
    }

    .auth-buttons a {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .navbar-cus .container {
        flex-wrap: wrap;
        padding: 0.75rem 1rem;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        margin-top: 0.5rem;
        padding: 0;
        background-color: #ffffff;
        border-top: 1px solid #e2e8f0;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links .nav-item-to-edit a {
        padding: 0.75rem 1rem;
        width: 100%;
    }

    .menu-toggle {
        display: block;
    }

    .nav-user-name {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }

    .navbar-profile-pic {
        margin: 0.5rem 0 0 0;
    }
}

@media (max-width: 768px) {
    .topic-list {
        display: flex;
        flex-direction: row;
        /* 🔁 change to horizontal */
        overflow-x: auto;
        /* 🔁 allow horizontal scroll */
        gap: 0.5rem;
        white-space: nowrap;
        max-width: 100%;
    }

}

@media (max-width: 798px) {

    .create-room-container {
        align-items: unset;
        height: 50%;
        margin-top: 20%;
    }

    .create-room-box {
        width: 90%;
    }

    .delete-container {
        height: 40vh;
        width: 90vw;
        top: 40%;
        left: 50%
    }
}

@media (max-width: 768px) {
    .profile-container {

        display: flex;
        flex-direction: column;
        height: 100%;
        padding-bottom: 10px;
    }

    .profile-pic {
        width: 150;
        height: 150px;
        border-radius: 51%;
        object-fit: cover;
        border: 3px solid #ddd;
        display: block;
    }

    .mobile-nav {
        display: flex;
        justify-content: center;
        gap: 1rem;
        margin-bottom: 10;
    }

    .toggle-btn {
        padding: 10px 20px;
        background-color: #f3f4f6;
        border: 1px solid #d1d5db;
        border-radius: 5px;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.3s ease;
    }

    .toggle-btn:hover {
        background-color: #e5e7eb;
    }

    .toggle-btn.active {
        background-color: #4f46e5;
        color: white;
        border-color: #4f46e5;
    }

    .main-feed-profile,
    .right-sidebar-profile {
        display: none;
        width: 100%;
    }

    .section-visible {
        display: block !important;
    }
}

@media (max-width:786px) {

    .login-container {
        margin-top: 10%;
        height: 50vh;
    }

    .login-box {
        width: 85%;
        background-color: #f9fafb;
    }

    .login-box h6 {
        margin-bottom: 15%;
    }

    .login-box button {
        margin-bottom: 13%;
    }

    .signup-box button {
        width: 24%;
    }
}

@media (max-width:768px) {
    .message-container {
        height: 60%;
    }
}