.nav-btn {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.nav-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Search Functionality Styles */
.search-highlight {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 3px;
    padding: 2px 4px;
}

mark {
    background-color: #ffeb3b;
    color: #333;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 500;
}

.search-result {
    border-left: 4px solid #007bff;
    transition: all 0.3s ease;
}

.search-result:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
}

/* Search Input Enhancements */
.search-container {
    position: relative;
}

.search-container .form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.search-btn {
    transition: all 0.3s ease;
}

.search-btn:hover {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

/* Note Card Enhancements */
.note-card {
    transition: all 0.3s ease;
    border: 1px solid #dee2e6;
}

.note-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    border-color: #007bff;
}

.note-card .card-title {
    color: #333;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.note-card .card-text {
    color: #666;
    line-height: 1.5;
}

/* Empty State Styles */
.empty-state-icon {
    color: #6c757d;
    font-size: 4rem;
    margin-bottom: 1rem;
}

/* Search Results Counter */
.search-results-info {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.search-results-info .badge {
    font-size: 0.875rem;
}

/* Clear Search Button */
.clear-search-btn {
    position: absolute;
    right: 45px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 4px;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.clear-search-btn:hover {
    color: #495057;
    background-color: #f8f9fa;
}

/* Loading Spinner for Search */
.search-loading {
    display: none;
    position: absolute;
    right: 45px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

/* Search Input with Clear Button */
.search-input-wrapper {
    position: relative;
}

.search-input-wrapper .form-control {
    padding-right: 80px;
}

/* Responsive Search */
@media (max-width: 768px) {
    .search-container {
        width: 100% !important;
        margin-top: 0.5rem;
    }
    
    .search-container .input-group {
        width: 100%;
    }
}

/* Advanced Search Styles */
.advanced-search-panel {
    position: relative;
    z-index: 1000;
    display: none;
}

.advanced-search-panel .card {
    border: 1px solid #007bff;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
}

.advanced-search-panel .card-title {
    color: #007bff;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.advanced-search-panel .form-label {
    font-weight: 500;
    color: #495057;
}

/* Search History Dropdown */
.search-history-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 0.375rem 0.375rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
}

.search-history-header {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6c757d;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.search-history-item {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
}

.search-history-item:hover {
    background-color: #f8f9fa;
}

.search-history-item i {
    margin-right: 0.5rem;
    color: #6c757d;
}

/* Search keyboard shortcuts hint */
.search-shortcuts-hint {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: #6c757d;
    pointer-events: none;
}

/* Enhanced search input focus state */
.search-container .form-control:focus + .search-shortcuts-hint {
    display: none;
}

/* Advanced search toggle button */
#advancedSearchToggle {
    color: #6c757d;
    text-decoration: none;
    transition: color 0.2s ease;
}

#advancedSearchToggle:hover {
    color: #007bff;
}

/* Custom date range inputs */
#customDateRange input[type="date"] {
    font-size: 0.875rem;
}

/* Search filters responsive design */
@media (max-width: 768px) {
    .advanced-search-panel .row {
        flex-direction: column;
    }
    
    .advanced-search-panel .col-md-4 {
        margin-bottom: 0.75rem;
    }
    
    /* Hide Advanced Search on mobile */
    .advanced-search-panel,
    #advancedSearchToggle {
        display: none !important;
    }
}

/* Search relevance indicators */
.relevance-score {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.relevance-high {
    background-color: #28a745;
}

.relevance-medium {
    background-color: #ffc107;
}

.relevance-low {
    background-color: #dc3545;
}

/* Search statistics */
.search-stats {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

/* No results illustration enhancement */
.no-results-illustration {
    opacity: 0.6;
    transform: scale(0.8);
    transition: all 0.3s ease;
}

.no-results-illustration:hover {
    opacity: 0.8;
    transform: scale(0.85);
}

/* Pinned Notes Styling */
.note-card[data-pinned="true"] {
    border-top: 4px solid #ffc107;
    background: linear-gradient(135deg, #fff9e6 0%, #ffffff 100%);
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.2);
    position: relative;
}

.note-card[data-pinned="true"]:hover {
    border-top-color: #ffb300;
    box-shadow: 0 8px 25px rgba(255, 193, 7, 0.3);
    transform: translateY(-5px);
}

.note-card[data-pinned="true"]::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    background: linear-gradient(45deg, #ffc107, #ffeb3b, #ffc107);
    border-radius: inherit;
    z-index: -1;
    opacity: 0.1;
}

.pin-indicator {
    color: #ffc107;
    animation: pinPulse 2s infinite;
}

@keyframes pinPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Category Badges */
.category-badge {
    font-size: 0.7rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* Enhanced Card Hover Effects */
.note-card {
    border: 1px solid #e9ecef;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.note-card:hover {
    border-color: #007bff;
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Form Validation Enhancement */
.was-validated .form-control:invalid {
    border-color: #dc3545;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath d='m5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.was-validated .form-control:valid {
    border-color: #198754;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='m2.3 6.73.9-.83L4.2 7l2.1-2.5.9.83L4.2 8.5z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

/* Action Buttons Enhancement */
.btn-group .btn {
    transition: all 0.2s ease;
}

.btn-group .btn:hover {
    transform: translateY(-1px);
}

/* Delete Confirmation Modal Enhancement */
.modal-content {
    border-radius: 0.75rem;
    border: none;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.modal-header {
    border-bottom: 1px solid #f1f3f4;
    padding: 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid #f1f3f4;
    padding: 1.5rem;
}

/* Success and Error Toasts Enhancement */
.toast {
    border-radius: 0.75rem;
    border: none;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.toast-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-weight: 600;
}

/* Loading States */
.btn.loading {
    position: relative;
    color: transparent !important;
}

.btn.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* View Toggle Buttons */
.btn-group .btn {
    transition: all 0.2s ease;
}

.btn-group .btn.active {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
}

.btn-group .btn:hover:not(.active) {
    background-color: #f8f9fa;
    border-color: #007bff;
    color: #007bff;
}

/* List View Styles */
.list-view .card {
    margin-bottom: 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.list-view .card:hover {
    border-color: #007bff;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
    transform: translateY(-2px);
}

.list-view .card[data-pinned="true"] {
    border-left: 4px solid #ffc107;
    background: linear-gradient(90deg, #fff9e6 0%, #ffffff 100%);
}

.list-view .card[data-pinned="true"]:hover {
    border-left-color: #ffb300;
    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.25);
}

.list-view .card-body {
    padding: 1.25rem;
}

.list-view .card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
}

.list-view .card-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #666;
    margin-bottom: 0.75rem;
}

.list-view .badge {
    font-size: 0.75rem;
    margin-right: 0.5rem;
}

.list-view .btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* List view responsive adjustments */
@media (max-width: 768px) {
    .list-view .row .col-md-8,
    .list-view .row .col-md-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .list-view .text-end {
        text-align: left !important;
        margin-top: 1rem;
    }
    
    .list-view .d-flex.justify-content-end {
        justify-content: flex-start !important;
    }
    
    /* Hide view toggle buttons on mobile */
    .btn-group[role="group"][aria-label="View toggle"] {
        display: none !important;
    }
}