/* 
 * TEERA COMPONENTS CSS
 * Centralized styling for notifications, search bar, and other common components
 */

/* =================== NOTIFICATION PANEL STYLES =================== */

/* 
 * NOTIFICATION SYSTEM IMPROVEMENTS - 2024-05-22
 * The following fixes enhance the notification system with better visual feedback,
 * smoother transitions, and clearer read/unread status indicators.
 * These changes improve user experience by making notifications more intuitive
 * and providing immediate visual feedback when notifications are read.
 */

/* NOTIFICATION FIX: Added styling for zero-count badge to prevent disappearing */
.badge-counter-zero {
    background-color: #e0e0e0 !important;
    color: #858796 !important;
    opacity: 0.7 !important;
    transition: all 0.3s ease !important;
}

/* NOTIFICATION FIX: Enhanced styling for expanded message center */
.dropdown-list.message-center-expanded {
    transition: all 0.3s ease-in-out !important;
    max-height: 85vh !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
    z-index: 1050 !important; /* Ensure it appears above other elements */
    overflow-y: hidden !important; /* Remove outer scrollbar */
}

.activity-logs-container {
    max-height: calc(85vh - 100px) !important;
    overflow-y: auto !important;
    padding-bottom: 10px !important;
    scrollbar-width: thin !important; /* For Firefox */
}

/* Customize scrollbar for Webkit browsers */
.activity-logs-container::-webkit-scrollbar {
    width: 6px !important;
}

.activity-logs-container::-webkit-scrollbar-track {
    background: #f1f1f1 !important;
    border-radius: 10px !important;
}

.activity-logs-container::-webkit-scrollbar-thumb {
    background: #c1c1c1 !important;
    border-radius: 10px !important;
}

.activity-logs-container::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1 !important;
}

/* Message center panel - basic styling */
.dropdown-list.dropdown-menu[aria-labelledby="messagesDropdown"] {
    width: 350px !important;
    padding: 0 !important;
    margin: 0 !important;
    max-height: 500px !important;
    min-width: 0 !important;
    overflow-y: auto !important;
    border: none !important;
    border-radius: 8px !important;
    background-color: #fff !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
}

/* Force the dropdown to be shown when it has the show class */
.dropdown-list.dropdown-menu[aria-labelledby="messagesDropdown"].show {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Header styling */
.dropdown-list.dropdown-menu[aria-labelledby="messagesDropdown"] .dropdown-header {
    display: block !important;
    text-align: center !important;
    background-color: #4e73df !important;
    color: white !important;
    font-weight: 600 !important;
    padding: 0.75rem 1rem !important;
    font-size: 0.9rem !important;
    letter-spacing: 0.05em !important;
    border-bottom: 1px solid rgba(0,0,0,0.05) !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
}

/* Remove styles for the close button since it's no longer used */
.dropdown-list .dropdown-header .close-btn {
    display: none !important;
}

/* Remove the notification category (Recent) */
.dropdown-list .notification-category {
    display: none !important;
}

/* Message item styling - update font styles */
.dropdown-list.dropdown-menu[aria-labelledby="messagesDropdown"] .dropdown-item {
    padding: 0.75rem 1rem 0.75rem 1.5rem !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    border-bottom: 1px solid rgba(0,0,0,0.05) !important;
    position: relative !important;
    transition: background-color 0.2s ease !important;
}

/* NOTIFICATION FIX: Added smooth transition for notification state changes */
.notification-transition {
    transition: all 0.3s ease-in-out !important;
}

/* Hide the icon-related elements completely */
.dropdown-list.dropdown-menu[aria-labelledby="messagesDropdown"] .dropdown-item .icon-circle,
.dropdown-list.dropdown-menu[aria-labelledby="messagesDropdown"] .dropdown-item .me-3 {
    display: none !important;
}

/* NOTIFICATION FIX: Improved styling for read notifications */
.notification-read {
    background-color: #fcfcfd !important;
    opacity: 0.8 !important;
    position: relative !important;
    border-left: none !important;
    box-shadow: none !important;
}

.notification-read:hover {
    background-color: #f8f9fc !important;
    opacity: 0.9 !important;
}

.notification-read .fw-bold {
    font-weight: 400 !important;
    color: #858796 !important;
}

/* NOTIFICATION FIX: Enhanced styling for unread notifications with better visibility */
.dropdown-list.dropdown-menu[aria-labelledby="messagesDropdown"] .dropdown-item:not(.notification-read) {
    background-color: #edf2ff !important; /* Light blue background for unread notifications */
    border-left: 3px solid #4e73df !important; /* Blue left border */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

.dropdown-list.dropdown-menu[aria-labelledby="messagesDropdown"] .dropdown-item:not(.notification-read):hover {
    background-color: #e6edff !important; /* Slightly darker on hover */
}

.dropdown-list.dropdown-menu[aria-labelledby="messagesDropdown"] .dropdown-item:not(.notification-read) .fw-bold {
    color: #2e59d9 !important; /* Darker blue for unread notification title */
    font-weight: 600 !important;
}

/* NOTIFICATION FIX: Added blue dot indicator for unread notifications */
.dropdown-list.dropdown-menu[aria-labelledby="messagesDropdown"] .dropdown-item:not(.notification-read)::before {
    content: "•" !important;
    position: absolute !important;
    left: 6px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    color: #4e73df !important;
    font-size: 24px !important;
    line-height: 0 !important;
}

/* NOTIFICATION FIX: No blue dot for read notifications */
.dropdown-list.dropdown-menu[aria-labelledby="messagesDropdown"] .dropdown-item.notification-read::before {
    display: none !important;
}

/* Title styling for notification items */
.dropdown-list.dropdown-menu[aria-labelledby="messagesDropdown"] .fw-bold {
    font-weight: 600 !important;
    font-size: 0.95rem !important;
    color: #333 !important;
    margin-bottom: 2px !important;
    transition: color 0.3s ease !important;
}

/* Content styling for notification details */
.dropdown-list.dropdown-menu[aria-labelledby="messagesDropdown"] .small {
    font-size: 0.8rem !important;
    color: #666 !important;
    line-height: 1.4 !important;
    transition: color 0.3s ease !important;
}

/* Date styling */
.dropdown-list.dropdown-menu[aria-labelledby="messagesDropdown"] .small.text-gray-500 {
    color: #a7a9bc !important;
    font-size: 0.75rem !important;
    margin-top: 5px !important;
}

/* View all link styling */
.dropdown-list.dropdown-menu[aria-labelledby="messagesDropdown"] .dropdown-item.text-center {
    color: #4e73df !important;
    font-size: 0.8rem !important;
    border-bottom: none !important;
    justify-content: center !important;
    background-color: #f8f9fc !important;
    padding: 0.6rem !important;
    font-weight: 500 !important;
    transition: all 0.2s ease-in-out !important;
}

/* NOTIFICATION FIX: Added styling for disabled View All Messages link */
.dropdown-list.dropdown-menu[aria-labelledby="messagesDropdown"] .dropdown-item.text-center.disabled {
    cursor: default !important;
    color: #858796 !important;
    background-color: #f8f9fc !important;
}

/* Style the icon circles */
.icon-circle {
    width: 36px !important;
    height: 36px !important;
    border-radius: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-right: 12px !important;
    flex-shrink: 0 !important;
    transition: transform 0.2s ease !important;
}

.dropdown-item:hover .icon-circle {
    transform: scale(1.05) !important;
}

/* Color definitions for icons - softer colors */
.icon-circle.bg-primary { background-color: #5a7bef !important; }
.icon-circle.bg-success { background-color: #2dd4a4 !important; }
.icon-circle.bg-danger { background-color: #ff6b6b !important; }
.icon-circle.bg-info { background-color: #4dc6da !important; }
.icon-circle.bg-warning { background-color: #ffc75f !important; }

/* =================== SEARCH BAR STYLES =================== */

/* SEARCH FIX: Enhanced search bar styling with animations and borders */
.teera-search-input {
    border-radius: 20px 0 0 20px !important;
    border: 1px solid #e3e6f0 !important;
    padding-left: 15px !important;
    transition: all 0.3s ease-in-out !important;
    box-shadow: none !important;
}

.teera-search-input:focus {
    border-color: #4e73df !important;
    box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25) !important;
}

.navbar-search .btn-primary {
    border-radius: 0 20px 20px 0 !important;
    background-color: #4e73df !important;
    border-color: #4e73df !important;
    transition: all 0.3s ease-in-out !important;
}

.navbar-search .btn-primary:hover {
    background-color: #2e59d9 !important;
    border-color: #2653d4 !important;
}

/* Search results dropdown styling */
.search-results-dropdown {
    width: 350px !important;
    max-height: 500px !important;
    overflow-y: auto !important;
    padding: 0 !important;
    margin-top: 0.5rem !important;
    border: none !important;
    border-radius: 0.35rem !important;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15) !important;
    animation: fadeIn 0.3s ease-in-out !important;
}

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

.search-results-dropdown .dropdown-header {
    background-color: #f8f9fc !important;
    border-bottom: 1px solid #e3e6f0 !important;
    font-weight: 800 !important;
    font-size: 0.65rem !important;
    color: #b7b9cc !important;
    padding: 0.75rem 1rem !important;
}

.search-category {
    color: #4e73df !important;
    font-size: 0.7rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    padding: 0.5rem 1rem !important;
    margin-top: 0.5rem !important;
}

.search-result-item {
    padding: 0.5rem 1rem !important;
    display: flex !important;
    align-items: center !important;
    transition: all 0.2s ease-in-out !important;
    border-left: 3px solid transparent !important;
}

.search-result-item:hover {
    background-color: #f8f9fc !important;
    border-left: 3px solid #4e73df !important;
}

.search-highlight {
    font-weight: 700 !important;
    color: #4e73df !important;
    background-color: rgba(78, 115, 223, 0.1) !important;
    padding: 0.1rem 0.2rem !important;
    border-radius: 0.2rem !important;
}

/* Mobile search dropdown */
@media (max-width: 768px) {
    .search-results-dropdown {
        width: 100% !important;
        left: 0 !important;
        right: 0 !important;
    }
}

/* Search bar container */
.topbar .form-inline {
    width: 100%;
    max-width: 400px;
}

.topbar .input-group {
    width: 100%;
}

/* Search input styling */
.topbar .form-control {
    border-radius: 20px 0 0 20px;
    border-right: none;
}

/* Search button styling */
.topbar .btn-primary {
    border-radius: 0 20px 20px 0;
    background-color: #4e73df;
    border-color: #4e73df;
}

/* Mobile search dropdown */
.dropdown-search {
    width: 100%;
    padding: 1rem;
}

/* =================== RESPONSIVE STYLES =================== */

/* Responsive styling for large screens */
@media (min-width: 1200px) {
    .dropdown-list.dropdown-menu[aria-labelledby="messagesDropdown"] {
        width: 350px; /* Wider on large screens */
    }
    
    .dropdown-list.message-center-expanded {
        width: 400px !important; /* Even wider when expanded on large screens */
    }
}

/* Responsive styling for tablets */
@media (max-width: 992px) {
    .dropdown-list.dropdown-menu[aria-labelledby="messagesDropdown"] {
        width: 300px; /* Default size for tablets */
    }
    
    .dropdown-list.message-center-expanded {
        width: 320px !important;
    }
    
    .topbar .form-inline {
        max-width: 300px;
    }
}

/* Responsive styling for mobile devices */
@media (max-width: 768px) {
    .dropdown-list.dropdown-menu[aria-labelledby="messagesDropdown"] {
        position: fixed !important;
        width: 100% !important;
        top: 60px !important;
        left: 0 !important;
        right: 0 !important;
        border-radius: 0 !important;
    }
    
    .dropdown-list.message-center-expanded {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 80vh !important;
        position: fixed !important;
        top: 60px !important;
        right: 0 !important;
        left: 0 !important;
        border-radius: 0 !important;
        margin: 0 !important;
    }
    
    .topbar .form-inline {
        display: none;
    }
} 