/* Dashboard Search & Notifications Styles */

/* Search Results Dropdown */
.search-results-dropdown {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    background-color: #fff;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1055;
    position: fixed !important;
    min-width: 280px;
    max-width: 500px;
}

/* Responsive adjustments for search */
@media (max-width: 768px) {
    .search-results-dropdown {
        min-width: 250px;
        max-width: 90vw;
        max-height: 60vh;
    }
}

.search-results-dropdown .dropdown-item {
    padding: 0.75rem 1rem;
    border: none;
    transition: background-color 0.15s ease-in-out;
}

.search-results-dropdown .dropdown-item:hover {
    background-color: #f8f9fa;
}

.search-results-dropdown .dropdown-item:focus {
    background-color: #e9ecef;
    outline: none;
}

.search-results-dropdown mark {
    background-color: #fff3cd;
    padding: 0.1em 0.2em;
    border-radius: 0.2em;
}

/* Search Result Categories */
.search-category-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
    font-size: 0.875rem;
    color: #6c757d;
}

/* Search Result Item Icons */
.search-result-item i {
    width: 1.5rem;
    text-align: center;
}

/* Notification Styles */
.notification-badge {
    font-size: 0.75rem !important;
    min-width: 1.5rem !important;
    height: 1.5rem !important;
    line-height: 1.5rem !important;
    text-align: center;
    border: 2px solid #fff !important;
    box-shadow: 0 0 15px rgba(220, 53, 69, 0.8) !important;
    font-weight: bold !important;
    animation: pulse 2s ease-in-out infinite;
}

/* Container improvements for proper positioning */
.search-container {
    position: relative;
    overflow: visible !important;
}

.notification-container {
    position: relative;
    overflow: visible !important;
}

/* Ensure parent containers don't clip */
.card-body,
.d-flex {
    overflow: visible !important;
}

/* Fix for Bootstrap navbar overflow issues */
.navbar,
.navbar-nav {
    overflow: visible !important;
}

/* Enhanced pulse animation */
@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 0 10px rgba(220, 53, 69, 0.7);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        box-shadow: 0 0 20px rgba(220, 53, 69, 1);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 0 10px rgba(220, 53, 69, 0.7);
    }
}

.notification-dropdown {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    background-color: #fff;
    min-width: 280px;
    max-width: 400px;
    position: fixed !important;
    z-index: 1055 !important;
    margin-top: 5px !important;
    max-height: 80vh !important;
    overflow-y: auto !important;
    transform: translateX(-50%);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .notification-dropdown {
        min-width: 250px;
        max-width: 90vw;
        right: 10px !important;
        left: auto !important;
        transform: none;
    }
}

/* Better dropdown items */
.notification-dropdown .dropdown-item {
    padding: 0.75rem 1rem;
    border: none;
    transition: background-color 0.15s ease-in-out;
    white-space: normal;
    word-wrap: break-word;
    min-height: auto;
}

.notification-dropdown .dropdown-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
    color: #495057;
    padding: 0.5rem 1rem;
}

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

.notification-dropdown .badge {
    width: 2rem;
    height: 2rem;
    line-height: 2rem;
    font-size: 0.75rem;
}

/* Responsive Search */
@media (max-width: 768px) {
    .search-results-dropdown {
        left: -100px !important;
        right: -100px !important;
        width: auto;
    }
    
    .notification-dropdown {
        right: -150px !important;
        min-width: 280px;
    }
}

/* Loading Spinner Animation */
.fa-spinner.fa-spin {
    animation: fa-spin 1s infinite linear;
}

@keyframes fa-spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Search Input Enhancement */
.search-enhanced {
    position: relative;
}

.search-enhanced::after {
    content: '\f002';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    pointer-events: none;
}

/* Notification Priority Colors */
.notification-priority-high {
    border-left: 4px solid #dc3545;
}

.notification-priority-medium {
    border-left: 4px solid #ffc107;
}

.notification-priority-low {
    border-left: 4px solid #17a2b8;
}

/* Search No Results */
.search-no-results {
    padding: 2rem 1rem;
    text-align: center;
    color: #6c757d;
}

.search-no-results i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

/* Accessibility Improvements */
.search-results-dropdown:focus-within,
.notification-dropdown:focus-within {
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Keyboard Navigation Highlights */
.search-result-item:focus,
.notification-dropdown .dropdown-item:focus {
    background-color: #007bff;
    color: #fff;
}

.search-result-item:focus mark {
    background-color: rgba(255, 255, 255, 0.3);
    color: #fff;
}

/* Animation for notifications */
.notification-badge {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* Disable animation after initial load */
.notification-badge.no-animation {
    animation: none;
}

/* Dark mode support (if implemented) */
@media (prefers-color-scheme: dark) {
    .search-results-dropdown,
    .notification-dropdown {
        background-color: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .search-results-dropdown .dropdown-item:hover,
    .notification-dropdown .dropdown-item:hover {
        background-color: #4a5568;
    }
    
    .search-category-header {
        background-color: #4a5568;
        border-color: #718096;
        color: #a0aec0;
    }
}
