


.global-search-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
    z-index: 10000;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.global-search-modal.active {
    display: flex;
}

.global-search-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
    backdrop-filter: blur(4px);
}

.global-search-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 70vh;
    animation: slideDown 0.2s ease-out;
}


@media (prefers-color-scheme: dark) {
    .global-search-container {
        background: #2d2d2d;
        color: #e0e0e0;
    }
}

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


.global-search-header {
    flex-shrink: 0;
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
}

@media (prefers-color-scheme: dark) {
    .global-search-header {
        border-bottom-color: #4a4a4a;
    }
}

.global-search-input-wrapper {
    display: flex;
    align-items: center;
    position: relative;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px 12px;
    transition: all 0.2s ease;
}

@media (prefers-color-scheme: dark) {
    .global-search-input-wrapper {
        background: #3d3d3d;
        border-color: #5a5a5a;
    }
}

.global-search-input-wrapper:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.global-search-icon {
    font-size: 18px;
    margin-right: 8px;
    opacity: 0.6;
}

.global-search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 16px;
    color: inherit;
    padding: 0;
}

@media (prefers-color-scheme: dark) {
    .global-search-input {
        color: #e0e0e0;
    }
}

.global-search-input::placeholder {
    color: #9ca3af;
}

@media (prefers-color-scheme: dark) {
    .global-search-input::placeholder {
        color: #6b7280;
    }
}

.global-search-shortcut-hint {
    font-size: 12px;
    background: #e5e7eb;
    padding: 4px 8px;
    border-radius: 4px;
    margin-left: 8px;
    color: #6b7280;
    white-space: nowrap;
}

@media (prefers-color-scheme: dark) {
    .global-search-shortcut-hint {
        background: #4a4a4a;
        color: #9ca3af;
    }
}


.global-search-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 0;
    min-height: 100px;
    max-height: calc(70vh - 140px);
}


.global-search-content::-webkit-scrollbar {
    width: 8px;
}

.global-search-content::-webkit-scrollbar-track {
    background: transparent;
}

.global-search-content::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.global-search-content::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

@media (prefers-color-scheme: dark) {
    .global-search-content::-webkit-scrollbar-thumb {
        background: #555;
    }
    
    .global-search-content::-webkit-scrollbar-thumb:hover {
        background: #666;
    }
}


.global-search-loading,
.global-search-empty,
.global-search-no-results {
    padding: 40px 20px;
    text-align: center;
    color: #6b7280;
}

@media (prefers-color-scheme: dark) {
    .global-search-loading,
    .global-search-empty,
    .global-search-no-results {
        color: #9ca3af;
    }
}

.global-search-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}


.btn-expand-empty {
    background: transparent;
    border: 1px solid #d1d5db;
    color: #3b82f6;
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-block;
}

@media (prefers-color-scheme: dark) {
    .btn-expand-empty {
        border-color: #6b6b6b;
        color: #60a5fa;
    }
}

.btn-expand-empty:hover {
    background: #e5e7eb;
    border-color: #3b82f6;
}

@media (prefers-color-scheme: dark) {
    .btn-expand-empty:hover {
        background: #4a4a4a;
        border-color: #60a5fa;
    }
}

.btn-expand-empty:active {
    transform: scale(0.98);
}


.search-more-link,
.search-less-link {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.15s ease, text-decoration 0.15s ease;
    cursor: pointer;
    display: inline;
}

.search-more-link:hover,
.search-less-link:hover {
    color: #2563eb;
    text-decoration: underline;
}

@media (prefers-color-scheme: dark) {
    .search-more-link,
    .search-less-link {
        color: #60a5fa;
    }
    .search-more-link:hover,
    .search-less-link:hover {
        color: #93c5fd;
    }
}


.spinner {
    border: 3px solid #e5e7eb;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    animation: spin 0.8s linear infinite;
    margin-bottom: 12px;
}

@media (prefers-color-scheme: dark) {
    .spinner {
        border-color: #4a4a4a;
        border-top-color: #60a5fa;
    }
}

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


.global-search-results {
    display: none;
}

.search-category {
    padding: 8px 0;
}

.search-category:not(:last-child) {
    border-bottom: 1px solid #f3f4f6;
}

@media (prefers-color-scheme: dark) {
    .search-category:not(:last-child) {
        border-bottom-color: #3d3d3d;
    }
}

.search-category-title {
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: #6b7280;
    letter-spacing: 0.5px;
}

@media (prefers-color-scheme: dark) {
    .search-category-title {
        color: #9ca3af;
    }
}

.search-category-items {
    display: flex;
    flex-direction: column;
}


.search-result-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
    gap: 12px;
}

.search-result-item:hover {
    background: #f9fafb;
    border-left-color: #3b82f6;
}

@media (prefers-color-scheme: dark) {
    .search-result-item:hover {
        background: #3d3d3d;
    }
}

.search-result-item.active {
    background: #3b82f6;
    color: white;
    border-left-color: #3b82f6;
}

@media (prefers-color-scheme: dark) {
    .search-result-item.active {
        background: #2563eb;
    }
}

.search-result-icon {
    font-size: 18px;
    min-width: 24px;
    text-align: center;
}

.search-result-content {
    flex: 1;
    min-width: 0;
}

.search-result-title {
    font-size: 14px;
    font-weight: 500;
    color: inherit;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-title mark {
    background: rgba(59, 130, 246, 0.2);
    font-weight: 600;
    padding: 0 2px;
    border-radius: 2px;
}

.search-result-item.active .search-result-title mark {
    background: rgba(255, 255, 255, 0.3);
}

.search-result-subtitle {
    font-size: 12px;
    color: #9ca3af;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

@media (prefers-color-scheme: dark) {
    .search-result-subtitle {
        color: #6b7280;
    }
}

.search-result-item.active .search-result-subtitle {
    color: rgba(255, 255, 255, 0.7);
}

.search-result-metadata {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

.badge-secondary {
    background: #e5e7eb;
    color: #374151;
}

.badge-primary {
    background: #dbeafe;
    color: #1e40af;
}

@media (prefers-color-scheme: dark) {
    .badge-success {
        background: #064e3b;
        color: #86efac;
    }
    
    .badge-danger {
        background: #7f1d1d;
        color: #fca5a5;
    }
    
    .badge-warning {
        background: #78350f;
        color: #fcd34d;
    }
    
    .badge-info {
        background: #1e3a8a;
        color: #93c5fd;
    }
    
    .badge-secondary {
        background: #4a4a4a;
        color: #d1d5db;
    }
    
    .badge-primary {
        background: #1e3a8a;
        color: #93c5fd;
    }
}

.search-result-actions {
    display: flex;
    gap: 4px;
}

.search-result-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background: #f3f4f6;
    color: #6b7280;
    text-decoration: none;
    font-size: 12px;
    transition: all 0.15s ease;
}

@media (prefers-color-scheme: dark) {
    .search-result-action {
        background: #3d3d3d;
        color: #9ca3af;
    }
}

.search-result-action:hover {
    background: #e5e7eb;
    color: #374151;
}

@media (prefers-color-scheme: dark) {
    .search-result-action:hover {
        background: #4a4a4a;
        color: #d1d5db;
    }
}

.search-result-item.active .search-result-action {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}


.history-item {     
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.history-item:hover {
    background: #f9fafb;
}

@media (prefers-color-scheme: dark) {
    .history-item:hover {
        background: #3d3d3d;
    }
}


.global-search-footer {
    flex-shrink: 0;
    padding: 12px 16px;
    border-top: 1px solid #e5e7eb;
    background: #ffffff;
    font-size: 12px;
    color: #6b7280;
}

@media (prefers-color-scheme: dark) {
    .global-search-footer {
        border-top-color: #4a4a4a;
        background: #1f1f1f;
        color: #9ca3af;
    }
}

.search-keyboard-hints {
    display: flex;
    gap: 16px;
    justify-content: center;
    align-items: center;
}

.search-keyboard-hints span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.search-keyboard-hints kbd {
    background: #ffffff;
    padding: 3px 6px;
    border-radius: 4px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: #9ca3af;
    border: 1px solid #e5e7eb;
    box-shadow: inset 0 -2px 0 0 #e5e7eb;
}

@media (prefers-color-scheme: dark) {
    .search-keyboard-hints kbd {
        background: #3d3d3d;
        border-color: #555;
    }
}


@media (max-width: 640px) {
    .global-search-modal {
        padding-top: 0;
        align-items: flex-start;
    }
    
    .global-search-container {
        width: 100%;
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
        box-shadow: none;
    }
    
    .global-search-content {
        max-height: calc(100vh - 180px);
    }
    
    .search-result-item {
        padding: 10px 12px;
    }
    
    .search-result-actions {
        display: none;
    }
    
    .search-keyboard-hints {
        flex-wrap: wrap;
        gap: 8px;
    }
}


@media print {
    .global-search-modal {
        display: none !important;
    }
}


.search-result-item:focus-within {
    outline: 2px solid #3b82f6;
    outline-offset: -2px;
}


@media (prefers-contrast: more) {
    .global-search-container {
        border: 3px solid currentColor;
    }
    
    .search-result-item:hover,
    .search-result-item.active {
        border-left-width: 5px;
    }
}


.global-search-floating-launcher {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(209, 213, 219, 0.4);
    padding: 10px 18px;
    border-radius: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.02);
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 13.5px;
    font-weight: 500;
    color: #374151;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.global-search-floating-launcher:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.04);
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(59, 130, 246, 0.4);
}

.global-search-floating-launcher .launcher-icon {
    font-size: 14px;
    color: #3b82f6;
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
}

.global-search-floating-launcher:hover .launcher-icon {
    transform: rotate(15deg) scale(1.1);
}

.global-search-floating-launcher .launcher-text {
    font-size: 13px;
    letter-spacing: -0.01em;
}

.global-search-floating-launcher .launcher-shortcut {
    font-size: 10px;
    opacity: 0.85;
}

.global-search-floating-launcher .launcher-shortcut kbd {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    box-shadow: inset 0 -1.5px 0 0 #d1d5db;
    color: #6b7280;
    padding: 2.5px 5px;
    border-radius: 4px;
    font-size: 9px;
    font-family: inherit;
    font-weight: 600;
}


@media (prefers-color-scheme: dark) {
    .global-search-floating-launcher {
        background: rgba(45, 45, 45, 0.75);
        border-color: rgba(255, 255, 255, 0.08);
        color: #e0e0e0;
    }
    .global-search-floating-launcher:hover {
        background: rgba(55, 55, 55, 0.85);
        border-color: rgba(96, 165, 250, 0.4);
    }
    .global-search-floating-launcher .launcher-icon {
        color: #60a5fa;
    }
    .global-search-floating-launcher .launcher-shortcut kbd {
        background: #3d3d3d;
        border-color: #555;
        box-shadow: inset 0 -1.5px 0 0 #2b2b2b;
        color: #9ca3af;
    }
}


@media (max-width: 640px) {
    .global-search-floating-launcher {
        bottom: 20px;
        right: 20px;
        padding: 12px;
        border-radius: 50%;
        width: 46px;
        height: 46px;
        justify-content: center;
    }
    .global-search-floating-launcher .launcher-text,
    .global-search-floating-launcher .launcher-shortcut {
        display: none !important;
    }
}
