/* Your Custom CSS Goes here */

/* Search Results Styling */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 0 11px 1px rgba(0,0,0,.05);
    margin-top: 10px;
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
    padding: 15px;
}

.search-results .search-result-item {
    padding: 12px 15px;
    border-bottom: 1px solid #e3e6ea;
    display: flex;
    align-items: center;
    transition: all .2s ease-in-out;
    margin-bottom: 8px;
    border-radius: 8px;
}

.search-results .search-result-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.search-results .search-result-item:hover {
    background-color: #f4f7fa;
    transform: translateY(-1px);
}

.search-results .search-result-item .search-result-icon {
    width: 45px;
    height: 45px;
    background: #f4f7fa;
    border-radius: 10px;
    text-align: center;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.search-results .search-result-item .search-result-icon i {
    font-size: 20px;
    color: #2269f5;
}

.search-results .search-result-item .search-result-content {
    flex: 1;
    padding-right: 15px;
}

.search-results .search-result-item .search-result-title {
    font-weight: 500;
    color: #27313f;
    margin-bottom: 4px;
    display: block;
    font-size: 14px;
}

.search-results .search-result-item .search-result-subtitle {
    color: #919ba7;
    font-size: 13px;
    line-height: 1.4;
}

.search-results .search-result-item .search-result-meta {
    color: #919ba7;
    font-size: 12px;
    margin-left: 15px;
    white-space: nowrap;
}

.search-results .no-results {
    padding: 25px 20px;
    text-align: center;
    color: #919ba7;
    font-size: 14px;
}

/* Search Input Styling */
.search-input-container {
    position: relative;
    padding: 0 15px;
}

.search-input-container .form-control {
    padding: 10px 15px 10px 40px;
    border-radius: 20px;
    background: #f4f7fa;
    border: none;
    height: 42px;
    font-size: 14px;
}

.search-input-container .search-icon {
    position: absolute;
    left: 30px;
    top: 50%;
    transform: translateY(-50%);
    color: #919ba7;
    font-size: 16px;
}

.search-input-container .form-control:focus {
    background: #fff;
    box-shadow: 0 0 11px 1px rgba(0,0,0,.05);
}

/* Search Results Container */
.search-container {
    position: relative;
    padding: 15px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 0 11px 1px rgba(0,0,0,.05);
}

/* App Menu Height Adjustment */
.app-menu {
    height: calc(100vh - 180px) !important;
    overflow-y: auto;
    margin-bottom: 60px;
}

/* Sidebar Footer */
.app-sidebar-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 260px;
    padding: 1rem;
    text-align: center;
    z-index: 1000;
}

.app-sidebar-footer .btn-outline-light {
    width: 100%;
    padding: 0.5rem;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    border: 1px solid #2269f5;
    color: #2269f5;
    background: transparent;
}

.app-sidebar-footer .btn-outline-light:hover {
    background: #2269f5;
    color: #fff;
    transform: translateY(-1px);
}

.app-sidebar-footer .btn-outline-light .material-icons-two-tone {
    font-size: 1.1rem;
}

/* Scrollbar Styling for App Menu */
.app-menu::-webkit-scrollbar {
    width: 4px;
}

.app-menu::-webkit-scrollbar-track {
    background: transparent;
}

.app-menu::-webkit-scrollbar-thumb {
    background: rgba(34, 105, 245, 0.2);
    border-radius: 2px;
}

.app-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(34, 105, 245, 0.3);
}

.app-sidebar {
    background-color: #fff;
    box-shadow: 0 0 11px 1px rgba(0,0,0,.05);
}

.sidebar-footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 15px 30px;
    background-color: #f4f7fa;
    border-top: 1px solid #e3e6ea;
}

.sidebar-footer .btn-logout {
    width: 100%;
    padding: 10px 20px;
    background-color: #2269f4;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-weight: 500;
    transition: all .2s ease-in-out;
}

.sidebar-footer .btn-logout:hover {
    background-color: #3e7dfa;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,.1);
}

.sidebar-footer .btn-logout i {
    margin-right: 8px;
    vertical-align: middle;
}

/* Pin Icon Styles */
.pin-icon {
    cursor: pointer;
    font-size: 18px;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
    opacity: 0.5;
}

.pin-icon:hover {
    background-color: rgba(0, 0, 0, 0.1);
    opacity: 1;
}

.pin-icon.pinned {
    opacity: 1;
    color: #2269f5;
}

/* Pinned Menu Items in Header */
.pinned-menu-items {
    display: flex;
    align-items: center;
    margin-right: 1rem;
}

.pinned-menu-items .nav-item {
    margin-right: 0.5rem;
}

.pinned-menu-items .nav-link {
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    color: #40475c;
}

.pinned-menu-items .nav-link:hover {
    background-color: rgba(34, 105, 245, 0.1);
    color: #2269f5;
}

.pinned-menu-items .nav-link.active {
    background-color: rgba(34, 105, 245, 0.1);
    color: #2269f5;
}

/* Search Results Styles */
.search-results {
    max-height: 400px;
    overflow-y: auto;
}

.search-results .list-group-item {
    border: none;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    text-decoration: none !important;
}

.search-results .list-group-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
    transform: translateX(5px);
}

.search-results .list-group-item .material-icons {
    font-size: 1.25rem;
    margin-right: 0.75rem;
    color: #666;
}

.search-results .list-group-item .title {
    font-weight: 500;
    color: #333;
    margin-bottom: 0.25rem;
    text-decoration: none !important;
}

.search-results .list-group-item .subtitle {
    font-size: 0.875rem;
    color: #666;
    text-decoration: none !important;
}

.search-results .list-group-item a {
    text-decoration: none !important;
    color: inherit;
}

.search-results .list-group-item a:hover {
    text-decoration: none !important;
}

/* Notifications Toggle */
.nav-notifications-toggle {
    position: relative;
    padding: 0.5rem;
    color: #40475c;
    transition: all 0.2s ease;
}

.nav-notifications-toggle:hover {
    color: #2269f5;
}

.nav-notifications-toggle .material-icons {
    font-size: 1.5rem;
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #ff3b30;
    color: #fff;
    font-size: 0.7rem;
    padding: 0.15rem 0.35rem;
    border-radius: 50%;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Notifications Dropdown */
.notifications-dropdown {
    width: 320px;
    padding: 0;
    border: none;
    box-shadow: 0 0 11px 1px rgba(0,0,0,.05);
    border-radius: 10px;
    margin-top: 10px;
}

.notifications-dropdown-header {
    padding: 1rem;
    border-bottom: 1px solid #e3e6ea;
}

.notifications-dropdown-header .dropdown-header {
    padding: 0;
    margin: 0;
    font-size: 0.9rem;
    font-weight: 500;
}

.notifications-dropdown-list {
    max-height: 360px;
    overflow-y: auto;
}

.notification-item {
    padding: 1rem;
    border-bottom: 1px solid #e3e6ea;
    transition: all 0.2s ease;
}

.notification-item:hover {
    background-color: #f4f7fa;
}

.notification-item.unread {
    background-color: rgba(34, 105, 245, 0.05);
}

.notification-item.unread:hover {
    background-color: rgba(34, 105, 245, 0.1);
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    flex-shrink: 0;
}

.notification-icon i {
    color: #fff;
    font-size: 1.25rem;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 500;
    color: #27313f;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.notification-text {
    color: #919ba7;
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.notification-time {
    color: #919ba7;
    font-size: 0.75rem;
}

.notifications-dropdown-footer {
    padding: 0.75rem;
    border-top: 1px solid #e3e6ea;
    text-align: center;
}

.notifications-dropdown-footer .dropdown-item {
    color: #2269f5;
    font-size: 0.9rem;
    padding: 0.5rem;
}

.notifications-dropdown-footer .dropdown-item:hover {
    background-color: rgba(34, 105, 245, 0.05);
}

/* Scrollbar for notifications */
.notifications-dropdown-list::-webkit-scrollbar {
    width: 4px;
}

.notifications-dropdown-list::-webkit-scrollbar-track {
    background: transparent;
}

.notifications-dropdown-list::-webkit-scrollbar-thumb {
    background: rgba(34, 105, 245, 0.2);
    border-radius: 2px;
}

.notifications-dropdown-list::-webkit-scrollbar-thumb:hover {
    background: rgba(34, 105, 245, 0.3);
}

/* Nav Icons */
.nav-icon-hover {
    position: relative;
    padding: 0.5rem;
    color: #40475c;
    transition: all 0.2s ease;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.nav-icon-hover:hover {
    background: #f4f7fa;
    color: #2269f5;
    transform: translateY(-1px);
}

.nav-icon-hover .material-icons {
    font-size: 1.5rem;
}

/* Navbar Styles */
.navbar {
    padding: 0.5rem 1rem;
    background: #fff;
    border-bottom: 1px solid #e3e6ea;
}

.navbar-nav {
    display: flex;
    align-items: center;
}

.nav-link {
    padding: 0.5rem;
    color: #40475c;
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: #2269f5;
}

.nav-link .material-icons {
    font-size: 1.5rem;
}

/* Dropdown Styles */
.dropdown-menu {
    border: none;
    box-shadow: 0 0 11px 1px rgba(0,0,0,.05);
    border-radius: 10px;
    margin-top: 10px;
}

.dropdown-item {
    padding: 0.75rem 1rem;
    color: #40475c;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: #f4f7fa;
    color: #2269f5;
}

.dropdown-item .material-icons {
    font-size: 1.25rem;
    margin-right: 0.5rem;
    vertical-align: middle;
}

/* Chat Module */
.chat-module {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

/* Users List */
.users-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 10px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.user-bubble {
    position: relative;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s;
    background: none;
    box-shadow: none;
    z-index: 9999;
}

.user-bubble:hover {
    transform: scale(1.1);
}

.user-bubble.active {
    transform: scale(1.1);
}

.user-bubble img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e4e6eb;
}

.user-bubble.active img {
    border: 3px solid #0084ff;
}

.status-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    background-color: #31a24c;
    border-radius: 50%;
    border: 2px solid white;
}

.user-bubble .unread-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #ff3b30;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    border: 2px solid white;
}

.user-bubble .tooltip {
    position: absolute;
    right: 60px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
    z-index: 10000;
}

.user-bubble .tooltip::after {
    content: '';
    position: absolute;
    right: -5px;
    top: 50%;
    transform: translateY(-50%);
    border-left: 5px solid rgba(0, 0, 0, 0.8);
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
}

.user-bubble:hover .tooltip {
    opacity: 1;
    visibility: visible;
    right: 65px;
}

.user-bubble .tooltip .name {
    font-weight: 500;
    margin-bottom: 2px;
    display: block;
}

.user-bubble .tooltip .role {
    font-size: 11px;
    opacity: 0.8;
}

/* Chat Container */
.chat-container {
    position: fixed;
    right: 90px;
    top: 50%;
    transform: translateY(-50%);
    width: 350px;
    height: 500px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

.chat-container.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.chat-header {
    padding: 15px;
    border-bottom: 1px solid #e4e6eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-header-right {
    display: flex;
    gap: 10px;
}

.back-btn, .header-btn {
    background: none;
    border: none;
    color: #666;
    padding: 5px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.back-btn:hover, .header-btn:hover {
    background: #f5f5f5;
    color: #333;
}

.chat-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-user-info img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.chat-user-info h4 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

.status-text {
    font-size: 12px;
    color: #31a24c;
}

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.message-date {
    text-align: center;
    margin: 10px 0;
}

.message-date span {
    background: #f5f5f5;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    color: #666;
}

.message {
    max-width: 80%;
    display: flex;
    flex-direction: column;
}

.message.user {
    align-self: flex-end;
}

.message.other {
    align-self: flex-start;
}

.message-content {
    padding: 10px 15px;
    border-radius: 15px;
    position: relative;
}

.message.user .message-content {
    background-color: #0084ff;
    color: white;
}

.message.other .message-content {
    background-color: #e4e6eb;
    color: #1c1e21;
}

.message-time {
    font-size: 11px;
    margin-top: 5px;
    opacity: 0.7;
}

.message.user .message-time {
    text-align: right;
}

.chat-input {
    padding: 15px;
    border-top: 1px solid #e4e6eb;
    display: flex;
    gap: 10px;
    align-items: center;
}

.input-btn, .emoji-btn, .send-btn {
    background: none;
    border: none;
    color: #666;
    padding: 8px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.input-btn:hover, .emoji-btn:hover, .send-btn:hover {
    background: #f5f5f5;
    color: #333;
}

.message-input {
    flex: 1;
    display: flex;
    align-items: center;
    background: #f5f5f5;
    border-radius: 20px;
    padding: 5px 10px;
}

.message-input input {
    flex: 1;
    border: none;
    background: none;
    padding: 8px;
    outline: none;
    font-size: 14px;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .chat-module {
        right: 10px;
    }

    .users-list {
        gap: 10px;
    }

    .user-bubble {
        width: 40px;
        height: 40px;
    }

    .chat-container {
        right: 60px;
        width: 300px;
        height: 450px;
    }
}

@media (max-width: 480px) {
    .chat-module {
        right: 5px;
    }

    .users-list {
        gap: 8px;
    }

    .user-bubble {
        width: 35px;
        height: 35px;
    }

    .chat-container {
        right: 45px;
        width: 280px;
        height: 400px;
    }
}