/* ===== Search Modal Styles ===== */

/* Search Modal Backdrop */
.search-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.search-modal-backdrop.show {
    opacity: 1;
    visibility: visible;
}

/* Search Modal Container */
.search-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 600px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    overflow: hidden;
}

.search-modal.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

/* Search Modal Header */
.search-modal-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 16px;
}

.search-modal-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 18px;
    font-weight: 500;
    color: #1a1a1a;
    background: transparent;
    font-family: var(--font-primary);
}

.search-modal-input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.search-modal-close {
    width: 40px;
    height: 40px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6b7280;
}

.search-modal-close:hover {
    background: #e5e5e5;
    color: #374151;
}

.search-modal-close i {
    font-size: 16px;
}

/* Search Modal Results */
.search-modal-results {
    max-height: 400px;
    overflow-y: auto;
    padding: 8px 0;
}

.search-modal-result {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f8f8f8;
}

.search-modal-result:last-child {
    border-bottom: none;
}

.search-modal-result:hover {
    background: #f9f9f9;
}

.search-modal-result.highlighted {
    background: #f0f9ff;
}

.search-modal-result-icon {
    width: 20px;
    height: 20px;
    background: #e5e7eb;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
    flex-shrink: 0;
}

.search-modal-result-icon i {
    font-size: 12px;
    color: #6b7280;
}

.search-modal-result-content {
    flex: 1;
}

.search-modal-result-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
    line-height: 1.4;
}

.search-modal-result-excerpt {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.4;
    margin-bottom: 6px;
}

.search-modal-result-meta {
    font-size: 12px;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-modal-result-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.search-modal-result-meta i {
    font-size: 10px;
}

/* Search Modal Loading */
.search-modal-loading {
    padding: 40px 24px;
    text-align: center;
    color: #6b7280;
}

.search-modal-loading i {
    font-size: 24px;
    margin-bottom: 12px;
    display: block;
}

/* Search Modal No Results */
.search-modal-no-results {
    padding: 40px 24px;
    text-align: center;
    color: #6b7280;
}

.search-modal-no-results i {
    font-size: 32px;
    margin-bottom: 16px;
    display: block;
    color: #d1d5db;
}

.search-modal-no-results h3 {
    font-size: 18px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.search-modal-no-results p {
    font-size: 14px;
    margin: 0;
}

/* Search Modal Footer */
.search-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
    text-align: center;
}

.search-modal-footer a {
    color: var(--secondary-color);
    font-weight: 600;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
}

.search-modal-footer a:hover {
    color: var(--primary-color);
}

/* Search Modal Keyboard Shortcuts */
.search-modal-shortcuts {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    text-align: center;
}

.search-modal-shortcuts span {
    background: rgba(0, 0, 0, 0.3);
    padding: 4px 8px;
    border-radius: 4px;
    margin: 0 4px;
    font-family: monospace;
}

/* ===== Responsive Design ===== */

/* Mobile adjustments */
@media (max-width: 768px) {
    .search-modal {
        width: 95%;
        max-width: none;
        margin: 20px;
        border-radius: 12px;
    }
    
    .search-modal-header {
        padding: 20px 20px 12px;
    }
    
    .search-modal-input {
        font-size: 16px;
    }
    
    .search-modal-result {
        padding: 12px 20px;
    }
    
    .search-modal-result-title {
        font-size: 15px;
    }
    
    .search-modal-result-excerpt {
        font-size: 13px;
    }
    
    .search-modal-footer {
        padding: 12px 20px;
    }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    .search-modal {
        max-width: 500px;
    }
}

/* Large desktop */
@media (min-width: 1200px) {
    .search-modal {
        max-width: 700px;
    }
    
    .search-modal-results {
        max-height: 500px;
    }
}

/* Animation for modal entrance */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes modalSlideOut {
    from {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -40%) scale(0.95);
    }
}

/* Body scroll lock when modal is open */
body.search-modal-open {
    overflow: hidden;
}
