/* Page Search Plugin Styles */

.page-search-container {
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.page-search-wrapper {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    padding: 8px 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
    max-width: 500px;
}

.page-search-wrapper:focus-within {
    border-color: #007cba;
    box-shadow: 0 4px 16px rgba(0, 124, 186, 0.15);
    transform: translateY(-1px);
}

.page-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    padding: 12px 0;
    background: transparent;
    color: #333;
    font-weight: 400;
}

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

.page-search-button {
    background: #007cba;
    border: none;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-left: 8px;
}

.page-search-button:hover {
    background: #005a87;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3);
}

.page-search-button:active {
    transform: translateY(0);
}

.page-search-results {
    margin-top: 16px;
    max-height: 300px;
    overflow-y: auto;
}

.page-search-results-count {
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    text-align: center;
    color: #1976d2;
    font-weight: 500;
    font-size: 14px;
}

.page-search-results-count small {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    opacity: 0.8;
    font-weight: 400;
}

.page-search-navigate-btn {
    background: #007cba;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    flex: 1;
}

.page-search-navigate-btn:hover {
    background: #005a87;
    transform: translateY(-1px);
}



/* Resultados com números */
.page-search-result-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.result-number {
    background: #28a745;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

.page-search-result-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.page-search-highlight-btn {
    background: #007cba;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    flex: 1;
}

.page-search-highlight-btn:hover {
    background: #005a87;
    transform: translateY(-1px);
}

.page-search-copy-btn {
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    flex: 1;
}

.page-search-copy-btn:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

/* Notificação */
.page-search-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    max-width: 300px;
}

.page-search-notification.show {
    transform: translateX(0);
}

.page-search-notification span {
    font-weight: 500;
}

.page-search-result-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 4px solid #007cba;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.page-search-result-item:hover {
    background: #e3f2fd;
    border-color: #007cba;
    transform: translateX(4px);
}

.page-search-result-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 16px;
}

.page-search-result-excerpt {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 8px;
}

.page-search-force-scroll {
    background: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    margin-top: 8px;
}

.page-search-force-scroll:hover {
    background: #218838;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.page-search-force-scroll:active {
    transform: translateY(0);
}

.page-search-result-highlight {
    background: #fff3cd;
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: 600;
}

/* Modal Styles */
.page-search-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.page-search-modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 0;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    animation: modalSlideIn 0.3s ease;
}

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

.page-search-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 16px;
    border-bottom: 1px solid #e9ecef;
}

.page-search-modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 20px;
    font-weight: 600;
}

.page-search-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.page-search-modal-close:hover {
    background: #f1f3f4;
    color: #333;
}

.page-search-modal-body {
    padding: 16px 24px 24px;
    max-height: 60vh;
    overflow-y: auto;
}

.page-search-results-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* No Results State */
.page-search-no-results {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.page-search-no-results svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Loading State */
.page-search-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.page-search-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e9ecef;
    border-radius: 50%;
    border-top-color: #007cba;
    animation: spin 1s ease-in-out infinite;
    margin-left: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .page-search-wrapper {
        max-width: 100%;
        padding: 6px 12px;
    }
    
    .page-search-input {
        font-size: 16px; /* Previne zoom no iOS */
        padding: 10px 0;
    }
    
    .page-search-button {
        padding: 8px;
    }
    
    .page-search-modal-content {
        margin: 10% auto;
        width: 95%;
        max-height: 85vh;
    }
    
    .page-search-modal-header {
        padding: 20px 20px 12px;
    }
    
    .page-search-modal-body {
        padding: 12px 20px 20px;
    }
    
    .page-search-result-item {
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .page-search-wrapper {
        padding: 4px 8px;
    }
    
    .page-search-input {
        padding: 8px 0;
    }
    
    .page-search-modal-header h3 {
        font-size: 18px;
    }
}

/* Highlight para elementos encontrados */
.page-search-highlight {
    animation: pageSearchPulse 3s ease-in-out;
    outline: 3px solid #007cba !important;
    outline-offset: 2px !important;
    border-radius: 4px !important;
    transition: all 0.3s ease !important;
}

@keyframes pageSearchPulse {
    0% {
        outline-color: #007cba;
        outline-width: 3px;
        background-color: rgba(0, 124, 186, 0.1);
    }
    50% {
        outline-color: #005a87;
        outline-width: 4px;
        background-color: rgba(0, 124, 186, 0.2);
    }
    100% {
        outline-color: #007cba;
        outline-width: 3px;
        background-color: rgba(0, 124, 186, 0.1);
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .page-search-wrapper {
        background: #1f2937;
        border-color: #374151;
    }
    
    .page-search-input {
        color: #f9fafb;
    }
    
    .page-search-input::placeholder {
        color: #9ca3af;
    }
    
    .page-search-result-item {
        background: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }
    
    .page-search-result-item:hover {
        background: #1e40af;
    }
    
    .page-search-modal-content {
        background-color: #1f2937;
        color: #f9fafb;
    }
    
    .page-search-modal-header {
        border-bottom-color: #374151;
    }
    
    .page-search-modal-header h3 {
        color: #f9fafb;
    }
}
